Groups | Blog | Home
all groups > flash actionscript > august 2006 >

flash actionscript : maze game



nardove
8/19/2006 4:11:41 PM
hi there

i need to do a maze game using the mouse to drag and find the exit, the
problem i have is the walls, dont know what to do whit them i got something
wornking but when you got to a wall the object stops mving and thas fine but it
looks like it sticks to te wall, any ideas

i think the best thing to do is to restric the movement of the player to a
invisible guide so when you press the object, just move on top of that guide
but i have no idea how to do that!!!

thanks
kglad
8/19/2006 4:25:07 PM
nardove
8/19/2006 4:37:23 PM
how can i show what i got?

kglad
8/19/2006 4:45:07 PM
nardove
8/19/2006 5:39:41 PM
function movePlayer(instance, checkInstance) {
instance.onPress = function() {
instance.onEnterFrame = function() {
checkInstance._x = _root._xmouse;
checkInstance._y = _root._ymouse;
if (route.hitTest(checkInstance._x, checkInstance._y, true)) {
instance._x += (checkInstance._x-instance._x)/5;
instance._y += (checkInstance._y-instance._y)/5;
} else {
//delete instance.onEnterFrame;
}
};
updateAfterEvent();
};
instance.onRelease = function() {
delete instance.onEnterFrame;
};
}
movePlayer(player, player_area);

AddThis Social Bookmark Button