Access to 'Solid' Attribute

For questions about using Classic.

Post » Tue Dec 09, 2008 8:22 pm

Hi everybody, first post, very impressed with the software! Thank you devs for developing something like this under the GPL!

I was wondering if it was possible to access the 'Solid' attribute via events. I am trying to build a little platformer and would like to switch off the collision detection on platforms & slopes that are above the player (so he can jump & walk through them from below). This is easy for platforms (I compare the Y-Positions of two ImagePoints on platform and player), but for slopes it gets tricky. It would be a lot easier if I could switch the 'Solid' attribute and still benefit from the built-in collision detection to determine wether or not to toggle the slope solid. As it is right now, I am switching off the collision detection by setting the 'Collisions' property to 'none'. With collisions off, however, it gets tricky to check when e.g. the player is overlapping the slope sprite and jumps (but does not leave the slope's bounding box) above the slope - which should toggle the slope solid.

(example cap here [url:nwo7fxi3]http://www.scirra.com/phpBB3/viewtopic.php?f=16&t=2119[/url:nwo7fxi3])

Sooo... is there any way to do this besides a) using phantom sprites for the detection or b) calculating the y-height of the slope myself (with lerp or similar) and comparing it with Imagepoints on the player? And if not - which of the two would you recommend? :)

Thanks for your time!
B
2
S
2
G
4
Posts: 171
Reputation: 1,792

Post » Tue Dec 09, 2008 8:31 pm

Setting the collisions like that is currently the only way to turn solids on and off at runtime.

There is a jump-through platform feature being added to the platform behavior though, if you can wait for it. Otherwise, you'll have to code your own custom collisions.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests