Results 1 to 1 of 1
Thread: ActionScript Flash
Hybrid View
-
17th April 2008 11:21 #1
ActionScript Flash
Code:onClipEvent (load) { power = 2; radius = 6; _x = 360; _y = 265; } onClipEvent (enterFrame) { if (Key.isDown(Key.LEFT)) { _x -= power; } if (Key.isDown(Key.RIGHT)) { _x += power; } if (Key.isDown(Key.UP)) { _y -= power; } if (Key.isDown(Key.DOWN)) { _y += power; } while (_root.levels.wall.hitTest(_x, _y+radius, true)) { _y--; } while (_root.levels.wall.hitTest(_x, _y-radius, true)) { _y++; } while (_root.levels.wall.hitTest(_x-radius, _y, true)) { _x++; } while (_root.levels.wall.hitTest(_x+radius, _y, true)) { _x--; } if (_root.levels.exit.hitTest(_x, _y, true)) { _root.levels.gotoAndStop(2); } if ((_root.cop.hitTest(_x, _y+radius, true)) or (_root.cop.hitTest(_x, _y-radius, true)) or (_root.cop.hitTest(_x+radius, _y, true)) or (_root.cop.hitTest(_x-radius, _y, true))) { _x = 360; _y = 265; } }
() _x _y. , . ?




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in