3 Random of How do I Questions..

Get help using Construct 2

Post » Thu Mar 22, 2012 9:55 am

Hello,

1. How do you save the file so that you wouldn't need to always open construct 2 to play it, and only need to play via browser? do you export it as a html 5 file?

2. In my game when you click M1 you spawn a block, how would I create a delay so that every say, 0.5-1 seconds you can spawn another block oppose to people being able to spam blocks?

3. How would I create a block limit so that if someone creates lets say 10 blocks and then they create one more block it deletes the first block they placed, if they create another, it deletes the second block they placed, would this have something to do with instance variables?

Thanks.
B
3
G
1
Posts: 13
Reputation: 526

Post » Thu Mar 22, 2012 10:02 am

1. Yes

2. How about setting up a variable that will be set a specific value when a block is spawned and the status will be reset every x seconds?

3. I would suggest an array here and filling it with the IDs of the spawned blocks... after the tenth Block, the first will be destroyed and the array has to be reordered to move everything one place in front.
B
42
S
9
G
6
Posts: 437
Reputation: 5,626

Post » Thu Mar 22, 2012 11:05 am

Thank you for your response, is there a step by step tutorial anywhere for the number 2?
B
3
G
1
Posts: 13
Reputation: 526

Post » Thu Mar 22, 2012 1:32 pm

not really...

my quick idea would be:

Set up an boolean instance variable on the player called something like "canbuild".

If the Boolean is true, then you can build. When you build a block, set that variable to false.

On an addition event that triggers every x seconds, set that value back to true.
B
42
S
9
G
6
Posts: 437
Reputation: 5,626

Post » Thu Mar 22, 2012 2:45 pm

Thanks, I've done the Boolean, but what do I put for the event for it to not allow the player to build?
B
3
G
1
Posts: 13
Reputation: 526

Post » Thu Mar 22, 2012 2:51 pm

you should have an event where you create the block. All you need is to add a condition based on the boolean.
B
42
S
9
G
6
Posts: 437
Reputation: 5,626

Post » Thu Mar 22, 2012 9:26 pm

Here's a simple way to do a delay:

Dropbox: SimpleSpawnDelay.capx
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests