issue with grass..again.

For questions about using Classic.

Post » Tue Jun 26, 2012 2:45 pm

ok so i lied a little about not having problems with my grass blades swaying in my other thread. i do, apparently.

i really dont know how to properly solve this:

i have made the swaying with the sine- behavior. and the rough code is:

player is overlapping a grass blade
-set sine angle range/speed to bigger than it is while not overlapping.

now the problems start.
im having issues on how to handle single blades of the grass object, in other words, im having problems picking the specific instances.

i dont really know how to set sine to normal to those blades the player just stopped overlapping since it does it for every instance.

also encountered an issue with sine:

resetting sine angle to something specific is rather problematic,since it doesnt have a default angle to revert to. so,when the range is bigger and i want to set it to smaller, the grass swaying can start from a completely different angle than the sine originally was..?

if i sound confusing, i can make a simple .cap to get my point across lol

anybody wanna help a guy out?
i have candy...
B
4
S
2
G
2
Posts: 109
Reputation: 1,318

Post » Tue Jun 26, 2012 6:17 pm

Try putting your events under a "For each object > Grass blade" loop event from the System object. That should pick better based on the conditioning I think.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Tue Jun 26, 2012 7:04 pm

This is from another thread I helped out someone with grass.
linkzyblade2012-06-26 19:04:48
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Tue Jun 26, 2012 9:34 pm

thanks guys, i got it working pretty much as i hoped, although the problem with the sine angle not resetting to default angle still persist, but i guess theres no simple way to fix that, and it looks good as it is now.
B
4
S
2
G
2
Posts: 109
Reputation: 1,318

Post » Wed Jun 27, 2012 4:28 am

The sine behavior just sets the sprite's properties. You can reset them by just entering the original values. For example, if sine behavior changes the sprite's angle, add a pv 'startAngle' to the sprite, set it to Sprite.Angle at start of layout, then whenever needed, set Sprite.Angle = 'startAngle'.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests