Discord
Login
Community
DARK THEME

How to make an enemy an object and make it move back and forth?

I have tried many times it is not working. IDK why but it is still not working. can someone help.

If you use object-oriented programming (classes), then you must include all the logic of the enemies, their movement and detection that they should change the direction of movement in the Enemy class.

If you just want it to move horizontally, you can change its X position each frame and reverse the direction if it's outside of the movement limits.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community