I want To make a square that has keyboard movement (up, down, left, right) and will stop when it hits another object such as a wall.
EDIT: I already have a square and a keyboard layout but if that needs to be something specific then please tell me!
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.
jackson, all you need to do is
You are not beeing specific, but I am 100% sure that if you google a bit more into what you need you will find it as there are tons of flash gaming tutorials.
Here is a minimal setup
Oviously it’s not ideal, but it’s basic and it illustrates the points states at the top easily.
You might want to use some smooth keys and update your game onEnterFrame.
Goodluck