PDA

View Full Version : [AS2] Maze Game with Arrow Keys


TastyTeo
05-02-2009, 11:48 AM
Hello World, I Want to make a Maze Game that plays with Arrow Keys,
My Class = Begginer
__________________________________________________ ________
I Made the Menu (Preloader , Play Button, Instructions Button)
Now i want to make a Movie Clip with this
onClipEvent(load){ speed=7; } onClipEvent(enterFrame){ if(Key.isDown(Key.RIGHT)){ _x+=speed; } if(Key.isDown(Key.LEFT)){ _x-=speed; } if(Key.isDown(Key.DOWN)){ _y+=speed; } if(Key.isDown(Key.UP)){ _y-=speed; } }
I Made it, now i can move with Arrow Keys Arround the Map.
But i have made another MovieClip, i named it "Wall 1".
Wall 1 is a Movie Clip, that when i hit it with the MovieClip "Player"
Player = Is the ball, that take place in the game.
when i hit it with the MovieClip "Player" the MovieClip "Wall 1"
I Want to go to Frame 5(the losing screen).
Also i have made another MC, "end" that's the region, that when the "Player"
hit it i want to go to frame 6(Winning Screen).
i Want to know the ActionScript for the Following:
1. Wall 1
2. Player
3. Win
__________________________________________________ ____________
I appreciate that, if you give me the AS.

crosshair
05-02-2009, 11:55 AM
I think this is what you mean, i read your post quickly...
if(this.hitTest(_root.wall1)) {
_root.gotoAndStop(5);
}

if(this.hitTest(_root.end)) {
_root.gotoAndStop(6);
}