OK so, is there an efficient way to detect on what array you’re currently on by using the KeyListener?
My code: http://www.javadan.pastebin.com/X68VyuGL
What I am trying to do here is see if the current tile I am on is BLOCKED.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m guessing you don’t want to have to traverse the entire matrix every time to find out what tile the users on after a key event. Why not keep the state of the last position of the player on the board and use it when you’re updating for each key event that occurs?
Alright, you wanted some more information on how to do this, I’ll seed the answer for you and you can finish it :