Maybe you think this is obvious, but I've never done it..
I want my "monsters" to act like the koopas in mario, moving blindly towards a direction and the changing it when hitting a wall or obstacle. And falling when there's no ground under it. Anyone have a suggestion?
There you go. Sorry I didn't feel like converting it to text.
13. It goes right if its facing right
14. It changes direction if overlapping something
15 left
16 like 14 only for the left collision
17 goes down
18 oops, theres a platform, goes back up
note that this gravity doesn't accelerate. Its a rather simple enimy movement and behaves just like a goomba.
Hrgh. It really doesn't work. It climbs over the obstacles and it won't change direction.
EDIT: I tried changing it's initial direction to left. When it's goin left and hits an obstacle it changes direction and moves on fine, but when its moving right and hits an obstacle it just keeps movin past it. Weird...
Originally Posted by Toxic Avenger Hrgh. It really doesn't work. It climbs over the obstacles and it won't change direction.
EDIT: I tried changing it's initial direction to left. When it's goin left and hits an obstacle it changes direction and moves on fine, but when its moving right and hits an obstacle it just keeps movin past it. Weird...
Edited by the Author.
This is a working engine. Possible causes of your problem:
1. It must be ordered exactly as above in order to work
2. HOT SPOTS The Hot hotspot must be in the center of the object at all times.
3. Frames must all be the same size all the time
4. Disable fine collision detection
Originally Posted by I am AndyUK (honest) A few small little differences though is that goombas collide with each other and don't change direction when they touch the floor.
These guys don't change direction when they touch the floor. They did in my old game though .
For changing direction when colliding with each other. Insert this event after or before all the others:
-Duck overlapping duck
+set direction to direction +16
note: If they land on top of each other, this code will make them get stuck on each other. To avoid that, you'll have to wait until I or someone else come up with a solution (most like involving setting a flag, spreading avaule, and doing a fast loop)