Sine Help

Get help using Construct 2

Post » Mon Feb 29, 2016 9:12 pm

Hi,
I want to have object A grow in size when object B touches it.If I do this with the sine behavior, it will grow and then decrease in size. I want it to remain at the new size.
How can I achieve this?

Thanks!
B
6
Posts: 17
Reputation: 286

Post » Mon Feb 29, 2016 9:54 pm

Hello,

Check every tick or every seconds if the object's size has reached a value, then disable the Sine behavior and set the object's size by yourself if needed (using scale object property, or dimensions directly).
B
14
S
4
Posts: 112
Reputation: 1,287

Post » Mon Feb 29, 2016 10:06 pm

How would I check every tick if the objects size has reached a value? Every tick is an event and compare x and y is an event @Nabu0001
B
6
Posts: 17
Reputation: 286

Post » Mon Feb 29, 2016 10:07 pm

Hi,
the way that definitely works:
set objBox sine wave active (e.g. when colliding)
wait x seconds (x= half of the wave - if the wave would need 2 seconds set it to 1)
set objBox sine wave inactive

Should also work
You could check the sine cycle position in an IF statement

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Mon Feb 29, 2016 10:13 pm

Thanks. Would I do that through events? if so, which? @fm4fanAT
B
6
Posts: 17
Reputation: 286

Post » Mon Feb 29, 2016 10:33 pm

here is the smallest version I can think of

make on sprite object and give it the sine behaviour
set the sine movement to size and period to 4, magnitude 50

in events
system > on start of layout | objSprite > set sine active
| system > wait 1 second
| objSprite > set sine inactive

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests