Hi, I am trying to learn how to:
1) make an enemy sprite to walk left to right on a floating bridge. Below is an example. The problem I am having is that the enemy walks right to the end of the blue sprite and stops there. But it does not get mirrored to the left to show it turns around, nor does it walk left once it reaches the right end of the blue sprite. It is walking, but stuck at that area.
The code I have used for this on my Layer Sheet is:
2) I also would like to ask if anyone can let me know what is the standard ways to make the enemy walk left and right on the ground platform where there is no edge? Is there any links to any video tutorials for this?
Develop games in your browser. Powerful, performant & highly capable.
1. The same code works for me.. Maybe the goblin sprite has some weird collision polygon or an origin image point position? Try with a rectangular polygon and the image point in the middle.
2. You can use invisible sprites to limit movement. When enemy collides with such sprite, toggle its direction.