How do I create sprites that follow walls/the ceiling?

Get help using Construct 2

Post » Fri Aug 14, 2015 12:17 am

Hey,

I'm looking to make a sprite that follows the walls, floor, and ceiling (with the solid behavior) - that is, one that circles around landforms. I'm trying to do this without using external triggers that alter the direction of the sprite, as the landforms have the potential to change via adding blocks to them. See the image below for an example of what I'm looking for:

Image

Right now I have it semi-working by using a bunch of "is overlapping at offset" commands, but this is very iffy and the sprites periodically fall off of the wall and float out into oblivion.

Can anyone think of a failproof way to make this work? I would be extremely grateful. Thanks.
Ruby Winds: a top-down adventure game inspired by the Oracle series of Zelda games.
Twitter - Devlog/Site
B
15
S
6
G
13
Posts: 55
Reputation: 7,530

Post » Fri Aug 14, 2015 1:05 am

well, this is a sample I made for someone over a year ago, but it uses external triggers... maybe it will give you some ideas. http://www.rieperts.com/games/forum/Wall-Tracing.capx

how fast do the objects move? how close do they need to be to the surface? how square are the land forms? are the objects thin like a person walking, or wide like a car or tank? Rotate as they go around? How do the new land forms appear? slide out of existing ones? or fall down? just appear? Do the objects just stick to the surface or does gravity hold them down?

It is definitely going to be tricky to do it without external triggers... and have it be failproof.
B
98
S
34
G
20
Posts: 438
Reputation: 17,825

Post » Fri Aug 14, 2015 1:48 am

Thanks for the sample, but yeah, those "GravityZone"-like sprites wouldn't really be possible in my case since the playing field is dynamic.

In regards to your questions: the speed of the objects is set to about 60, but they could go as fast as ~250ish. They should be reasonably close to the surface (within 5-10 pixels). The objects are about 24x24 pixels, whereas the rest of the tiles are 32x32. They don't necessarily need to rotate as they go around corners. The new landforms appear out of thin air (you create them by clicking). Finally, the objects are held down by gravity (when they're on the floor; when they're following the ceiling, the gravity is set to 0).

If you (or anyone else) can think of anything that might work with that information, I'm all ears. Thanks again.
Ruby Winds: a top-down adventure game inspired by the Oracle series of Zelda games.
Twitter - Devlog/Site
B
15
S
6
G
13
Posts: 55
Reputation: 7,530

Post » Fri Aug 14, 2015 5:01 am

Here's one possible way that could give you ideas.
help-with-retro-enemy-behavior-move-along-solids_p713155?#p713155

It solves the cornering in an exact way by positioning the detectors relative to the object's rounded position as I recall.
B
94
S
33
G
113
Posts: 5,354
Reputation: 73,269

Post » Fri Aug 14, 2015 11:16 am

This is exactly what I need. It relies on the walls themselves, which is perfect. I'll have to play with this a bit.

Thank you!
Ruby Winds: a top-down adventure game inspired by the Oracle series of Zelda games.
Twitter - Devlog/Site
B
15
S
6
G
13
Posts: 55
Reputation: 7,530

Post » Fri Aug 14, 2015 11:21 am

This is very simple, just create variable time and every (a) amount of time the object moves (x) or (y) along the layout, shame that the construct still does not allow the creation of an imaginary curve where you can position the object, however it can be programmed manually and it works very well.
B
32
S
9
G
3
Posts: 280
Reputation: 4,262


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests