to many blocks

Get help using Construct 2

Post » Sat Sep 15, 2012 12:52 pm

hey, i need help!

the problem is quite simple im sure but i cant figure it out...

ive have a game were the player can pick up blocks that make up the floor
ive got that working but i cant stop the player being able to continuously pick up blocks from the floor. i only want the player to pick up one block at a time. ive created conditions for the picking up of the block, can i then put a block on this condition when other conditions are met?

any help would be great!
B
10
S
1
G
1
Posts: 74
Reputation: 1,637

Post » Sun Sep 16, 2012 3:23 am

I don't understand clearly but have you tried adding a condition to the "picking" block... like

if:      "player.free = true" (free is a boolean instance value)
        "player" (does whatever action triggers the picking)

then:    set player.free to false
        do the "picking" thing


I guess this would keep the player from picking infinite blocks

and when it "drops" the block --- set player.free=true again

hope it helps
Image
B
42
S
11
G
5
Posts: 269
Reputation: 10,790

Post » Sun Sep 16, 2012 3:49 am

you could also achieve the same result with groups

put the event(s) that lets the character pick up a block in a group, then when the player is holding a block, you disable that group (meaning the events can't be executed at all) and activate the group when the player isn't holding a block.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Sun Sep 16, 2012 9:20 am

ok that sounds quite complex ive never used a group or a boolean instance before, ill have to have a good look in the manual see if i can figure it out.

thanks for the replies
B
10
S
1
G
1
Posts: 74
Reputation: 1,637


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, dieblume86, Kagubro, Yahoo [Bot] and 3 guests