enemy behavior - crawl around platforms [SOLVED]

For questions about using Classic.

Post » Wed Jun 13, 2012 10:32 pm

no matters just use my dummy plattaforms and overlaps yours TB then make them invisible at start... they works as references...

EDIT: added some tiledBackgrounds to show how use the method with yours...
EDIT 2: a last tip, to my plattaforms dummies uncheck the plattaform attribute, and check it to your TiledBackgrounds so enemies move over your TBs and use the dummies as references to change gravity...Yaottabyte2012-06-13 22:40:04
B
4
S
1
G
1
Posts: 69
Reputation: 863

Post » Wed Jun 13, 2012 11:49 pm

[QUOTE=robit_studios] @zyblade Thanks for the example. I considered the path movement option, but it won't work for my purposes. I don't want the enemies to have a fixed path. I want the enemies to be able to thrown off of their platform and attach themselves to wherever they land and continue moving. [/QUOTE]

link

With following layer if too close^^ and moving back to path, if you are too far away from the enemy.

I didn't pay much attention to setting up the path movement exactly.
This is just an example and it could look much better if you rearrange the path.zyblade2012-06-13 23:52:06
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Thu Jun 14, 2012 1:54 am

Thank you everyone for all your help, suggestions and examples. I'm happy to report that I got this working exactly the way I wanted it to. It took a lot of trial and error but the end result was worth it.

To fix my problem I just tested for when the object reached the corner of a platform. Then test a "collision at offset" in all four diagonal directions. When if hits a platform is sets the X and Y position of the enemy to the edge of that platform, rotates the direction 90 degrees and sends it on it's way. I can now set the enemy to any speed less than 650 and it seems to work great.

Here's a cap if you want to check it out. If you see anyway I can make this even more efficient let me know.

https://dl.dropbox.com/u/28484936/crawling_enemy_2.cap

Thanks again.robit_studios2012-06-14 01:57:09
B
20
S
5
G
3
Posts: 65
Reputation: 3,764

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests