[solved] How to make enemy doesn't fall over the edge with their movement?

corbanwolf

  • Posts: 223
How to make enemy goes from one edge of platform to another and never fall? I could place invisible actor that collides only with enemy that would prevent from falling, but this solution is not very mobile and versatile. I thought about collision shapes. But if right/left border isn't hit doesn't work.

https://youtu.be/5apu4ML9Wto?t=5m38s
just like this red tortoise doesn't fall off

« Last Edit: March 11, 2018, 10:11:18 am by corbanwolf »
♪♪♪♪♪♪

Vaibhav Sangwan

  • Posts: 160
The actors were a good idea.You can create long vertical,invisible actors set to cannot be pushed.
You can try using regions.
At the very beginning of scene,add all the regions,which are at edges of platforms, in a list and in when updating event of enemy,continuously check if it is inside any region from the list.
Currently working on:-
http://www.stencyl.com/game/play/42376
Feedback will be really appreciated

LIBERADO

  • *
  • Posts: 2718
You can use the Tile API to detect if the enemy is near the edge of any platform made with tiles:



<a href="http://static.stencyl.com/games/38390-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/38390-0.swf</a>

« Last Edit: March 10, 2018, 02:22:02 am by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Vaibhav Sangwan

  • Posts: 160
Why didn't I think that?
I will get better with time.
Currently working on:-
http://www.stencyl.com/game/play/42376
Feedback will be really appreciated

corbanwolf

  • Posts: 223
Thanks. I didn't know that TILE API exist and what is it. I can see this is a very powerfull tool for making movement of enemies more natural. That's what I managed to do. I attach the pic so maybe it will be helpful for someone.
♪♪♪♪♪♪

MNR Art

  • *
  • Posts: 48
this was very useful thanks

Bombini

  • *
  • Posts: 1400
Nerver under estimate almighty TILE API guys  :D
Seriously..so many cool things can be done.