hi looking for help with this code
the above code works fine, but but when my player hits the wall in certain places it seems to remove the player movie clip... can someone please help?Code:onClipEvent (load) { power = 1; yspeed = 0; xspeed = 0; friction = 0.95; gravity = 0.1; thrust = 0.75; radius = 10; } onClipEvent (enterFrame) { xspeed *= friction; yspeed += gravity; _y += yspeed; _x += xspeed; if (Key.isDown(Key.LEFT)) { xspeed -= power; } if (Key.isDown(Key.RIGHT)) { xspeed += power; } if (Key.isDown(Key.UP)) { yspeed -= power*thrust; } if (Key.isDown(Key.DOWN)) { yspeed += power*thrust; } if (Key.isDown(Key.SPACE)) { _root.player.player_beaming.gotoAndStop(2); } else { _root.player.player_beaming.gotoAndStop(1); } while (_root.world1_1_walls.hitTest(_x, _y+radius, true)) { _y--; } while (_root.world1_1_walls.hitTest(_x, _y-radius, true)) { _y++; } while (_root.world1_1_walls.hitTest(_x-radius, _y, true)) { _x++; } while (_root.world1_1_walls.hitTest(_x+radius, _y, true)) { _x--; } }





Reply With Quote