Report as inappropriate.
You may use this class for anything you want to make.
The Mover class is a class that handles collision detection between actors. To use it you make a subclass, set the movement speed and gravity in the constructor, and call methods. Use the method setBlockingClasses(Class) to set which classes of objects the actor cannot go through. Call the doGravity() method every act cycle to cause the actor to fall if it isn't supported and to move upwards if it recently jumped. I used this for the scenario I still need a name for. Please drop a comment on that scenario with what you think I should call it.
CONTROLS for the demo:
A - move left
D - move right
W - jump
Press multiple keys to do both actions at once.
Want to leave a comment? You must first log in.
No votes yet.