How to make a movable entity


(Eva Droch) #1

Do not scold my English -_- Created player, and the world with borders. How to make the player move objects (stone, box, etc.)? I drew attention to the moveCollideX, moveCollideY but do not know how to use. Help me please =(


(Martí Angelats i Ribera) #2

You have to make a custom Entity class (a new class which extends Entity). In the update you move it modifying the x and y values. That’s all.

PS: BTW, i’d recommend you to check out the beginners tutorials like the ones you can find here. (this question is in the Keyboard and Mouse input section)


(Jacob Albano) #3

It sounds like the idea is more to have the player pushing objects around, not controlling them with the mouse and keyboard. Is that right @Achatacha?