For Each and Opacity question

Get help using Construct 2

Post » Tue Apr 02, 2013 5:52 pm

Quick question:

I create these 5 blocks, and then there is a For Each of those blocks that says change opacity to 80, then wait 1 second, change opacity 60, wait 1 sec, etc until I get to 20 opacity then destroy the sprite.

The problem is the first opacity setting changes the sprites just fine, but then it just does each of the waits but doesn't do the opacity changes in between. Is this a limitation in For Each or am I missing something?

Thanks!
Twitter: https://twitter.com/pudgyplatypus

Learn to make a clicker game for cheap!
https://www.scirra.com/store/games-with ... e-game-666

Try out Pixel Golf on the Scirra Arcade!
https://www.scirra.com/arcade/sports-ga ... el-golf-67

Pudgy Platypus Games website!
www.pudgyplatypus.com
B
53
S
16
G
5
Posts: 206
Reputation: 6,826

Post » Tue Apr 02, 2013 6:39 pm

Try this:

Every 1 seconds
.. block.opacity = block.opacity-40

block.opacity<= 0
.. block.destroy

Fade behavior might also be of use, if you don't mind smooth opacity change. :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Wed Apr 03, 2013 6:24 pm

Awesome, yes that works!

I was half asleep last night doing this so I was having trouble finding the Fade behavior and by that time I had already made it the first way so maybe Ill try the fade tonight.

Thanks again!
Twitter: https://twitter.com/pudgyplatypus

Learn to make a clicker game for cheap!
https://www.scirra.com/store/games-with ... e-game-666

Try out Pixel Golf on the Scirra Arcade!
https://www.scirra.com/arcade/sports-ga ... el-golf-67

Pudgy Platypus Games website!
www.pudgyplatypus.com
B
53
S
16
G
5
Posts: 206
Reputation: 6,826


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests