Crate Gravity Problems

For questions about using Classic.

Post » Thu Feb 17, 2011 5:11 am

[quote="PixelRebirth":2a5m1vhc]If you only want your crates to simply fall down when they're not on ground, the physics behavior might be a little overkill.

Here is how I made your events work with some minor adjustments and most important of all an For each loop:

[url:2a5m1vhc]http://dl.dropbox.com/u/2306601/crategrav.cap[/url:2a5m1vhc][/quote:2a5m1vhc]
I don't really get how the "For Each" event works but this is definately what I was trying to do. I'm still split between using the physics behavior or a custom movement. A custom movement would be less glitchy, but the Physics Behavior looks alot better. fV:
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Thu Feb 17, 2011 10:40 pm

For Each is like a loop which loops through the objects created. If you want conditions to be checked against each crate, you add sub-events. If you place events with the for each, it will do those to each crate.

For Each (Crate) : Y = Self.Y+1
- If Crate.Value('health') =< 0 : Destroy crate

This would make all crates move down by 1 pixel, and if one were out of health, destroy it. The health part is a sub-event.
B
3
S
1
G
4
Posts: 37
Reputation: 1,299

Post » Thu Feb 17, 2011 11:57 pm

[quote="Azu":1vihn2u0]Platform behavior should work.[/quote:1vihn2u0]

Works quite well actually.
Just use a start of layout to set user input ignored.
And set the attribute solid.
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests