Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

How to check if a variable(s) is in an array? (Pokemon Game)

$
0
0

I have a sprite Ash that is animated on keydown events. Also for keydown I have a background image that moves while Ash stays in place to give the illusion of movement. Each time an arrow key is pressed a variable X or Y is increased or decresed by 1. This is to give an X,Y coordinate.

 

How do I place multiple out of bound coordinates into an array and have them check against the var X and Y? If the coordinates match then the background image PC will not move but Ash will continue to walk in place (yes I want it to walk into walls just like the original game).

 

Here's my project https://app.box.com/s/4w1ls5xviyte5se6feqg


Viewing all articles
Browse latest Browse all 9897

Trending Articles