-
Flash Maze Game
Hello,
I am creating a Simple Flash Maze Game,
and i have 2 'Movie Clips' that i want to react when the collide.
IE. When 'CHAR_LVL1' (A Movie Clip, controlled with the Arrow Keys) comes into contact with 'WALL_LVL1'. I want it to 'gotoAndStop(27);'
I am using the code:
Code:
onClipEvent(enterFrame) {
if (_root.CHAR_LVL1, hitTest(_root.WALL_LVL1)) {
gotoAndPlay(27);
}
}
What am i doing wrong.
FYI:
I am using Flash CS5 and Action Script 2.0
-
ok, i have tried your script and the clips instance names are correct
to test i made another game, and the same thing is happening
this is my entire code for the first clip:
Actionscript Code:
onClipEvent(enterFrame){ if(Key.isDown(Key.RIGHT)){ this._x += 2; } if(Key.isDown(Key.LEFT)){ this._x -= 2; } if(Key.isDown(Key.UP)){ this._y -= 2; } if(Key.isDown(Key.DOWN)){ this._y += 2; } }
onClipEvent (enterFrame) { if (_root.moving, hitTest(_root.block)) { gotoAndStop(2); } }
and i have no script for the other clip (block)
here is a link, i uploaded it and you can see what is happening if you want
http://jhtechno.com/projects/flash/testgame.swf (for some reason if wont work in the browser)
http://jhtechno.com/projects/flash/testgame.fla (if you want the original)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|