I have made small game, but my animation is going out of the dcreen when I move it. Can somebody please give me the code how can I stop the animation when it riches the end of the screen.
This is the code that I have in my game:
then I have try with this, but I don't know how to finish...:Code:function moveHeli(speed) { if (Key.isDown(Key.UP)) { _root.longbow._y -= speed; } else if (Key.isDown(Key.LEFT)) { _root.longbow._x -= speed; } else if (Key.isDown(Key.DOWN)) { _root.longbow._y += speed; } else if (Key.isDown(Key.RIGHT)) { _root.longbow._x += speed; } } _root.onEnterFrame = function() { moveHeli(5);
Code:stage_x = 550; stage_y = 650; hero_x = getProperty("longbow", _width); hero_y = getProperty("longbow", _height); function moveHeli(speed) { if (Key.isDown(Key.UP)) { _root.longbow._y -= speed; } else if (Key.isDown(Key.LEFT)) { _root.longbow._x -= speed; } else if (Key.isDown(Key.DOWN)) { _root.longbow._y += speed; } else if (Key.isDown(Key.RIGHT)) { _root.longbow._x += speed; } } _root.onEnterFrame = function() { moveHeli(5);





Bookmarks