Standing on non-solid platforms

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Mon Aug 03, 2009 5:47 am

How does the platform behavior detect when a player is standing on a non-solid platform?
How does it detect walls, celilings?

I'm thinking of ways for a 2.5D behavior and I can't get this bit right
ThX
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Mon Aug 03, 2009 6:03 pm

I think it basically does an 'is overlapping at offest' test - ie. moves the object 1 pixel down and tests a collision there, and if there is one, the player is on the floor.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Mon Aug 03, 2009 11:20 pm

but that test would also stop a sprite from falling if, say, its head is 1px above the platform.

For solid platforms is not an issue, as the rest of the sprite cannot overlap the platform.
When the platform is not solid (solid attribute unchecked, platform attribute checked) a 1px offset collision would yield true both for the player standing on top of the platform and overlapping the platform but with its feet poking out of it.

I can't think of a way that doesn't involve a think detector sprite and that woudln't work if the sprite is going faster than 1px per frame, that's why I ask :)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Mon Aug 03, 2009 11:52 pm

Oh, for platforms I think it only tests if it's overlapping when the object is falling. Moving up or side to side doesn't check so acts as if it's not there. This allows you to jump upwards through the platform and land on top. You'll have to ask Davo for more detail, he wrote the platform behavior.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Fri Aug 07, 2009 12:23 am

Paging Dr David...
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests