How do I change object scale at 1 instance only

Get help using Construct 2

Post » Mon Feb 13, 2017 12:48 pm

Hi, greeting everyone, I am new here and at first would like to thank you all in advance, I have learned a lot with you.

ok, I am messing around with construct 2 to learn more, right now im doing a fruit ninja like game, but I am stuck in a problem that I cant find the properly answer. The problem is I want to make the fruits to increase their size (scale/zoom) smoothly when it goes up and keep the higher value until it gets destroyed. For reference the fruits get spawned at the middle bottom of the screen and have a bullet angle of motion to random(240,290).

Any help will be very appreciate.
B
12
S
6
G
1
Posts: 24
Reputation: 1,612

Post » Mon Feb 13, 2017 11:50 pm

Increase size of the fruit as Y value goes down(up the screen), seems easy enough. Then when it hits a certain Y value, stop changing the size. Because you've used a bullet, you could set the Y starting location as a variable when it spawns, then as the Y value reduces every tick, increase the width/height by 1 every tick, or slower than this if you want. Then when the fruit is at a certain Y value, say the middle of the screen, stop increasing its size by toggling a boolean to lock it out.
B
46
S
16
G
74
Posts: 2,092
Reputation: 44,193

Post » Tue Feb 14, 2017 3:23 am

Sorry dude, I tried that and nothing, I guess is because I am using Families for the fruits sprite. Really dont know what am I doing wrong.
B
12
S
6
G
1
Posts: 24
Reputation: 1,612

Post » Tue Feb 14, 2017 3:38 am

ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Tue Feb 14, 2017 6:42 am

blackhornet, thanks for the example. That is what I got so far, but as I mention before, my fruits sprites has Physics Behavior, so when they fall down there size also decrease back to normal state, I want to prevent it, but dont know how to do, what do I need to check. If it was an object with platform behavior it such be easier, because I could check if the object was falling, but its not my case. Is there a way to check if the object in my case is falling down?
B
12
S
6
G
1
Posts: 24
Reputation: 1,612

Post » Tue Feb 14, 2017 6:58 am

Just store the scale and only set it if it is larger than before:
http://www.blackhornettechnologies.com/Construct2Stuff/FruitishNinjaScaleB.capx
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Tue Feb 14, 2017 7:13 am

thank you very much, that fixed my problem. Thank you both blackhornet and plinkie.
B
12
S
6
G
1
Posts: 24
Reputation: 1,612


Return to How do I....?

Who is online

Users browsing this forum: LaDestitute, OBLIVION, yiuyiu6666 and 16 guests