so basically i want an actor call "blueCircle" to move in 1 direction at a random and move at the same speed the whole time it also needs to move in a straight line, please help, thank you

This site requires JavaScript, please enable it in your browser!

To consistently move the same speed and in a straight line in any direction, use a smooth moving system.

Coltz wrote...

please could you give me an example of thispublic class Bullet extends Actor { double x, y, dx, dy; int speed = 5; protected void addedToWorld(World world) { x = getX(); y = getY(); dx = Math.cos(Math.PI*getRotation()/180)*speed; dy = Math.sin(Math.PI*getRotation()/180)*speed; } public void act() { move(); } public void move() { x += dx; y += dy; setLocation((int)x, (int)y); } }

You need to login to post a reply.