How do I Make creating object for short time

Get help using Construct 2

Post » Mon Mar 17, 2014 6:33 pm

Hi,

Let me explain you what is my problem ! I'm trying to make a little plateform game; in this game my Super-Hero can creat litle plateform under is feet. So I made a Sprite "Created_Plateform".

Hero is on jump Spawn Created_Plateform
'Created_Bloks' = 0 Then Set 'Created_Bloks' to 1
Space pressed

And

'Created_Bloks' = 1 Then Wait 2 Seconds
Destroy "Created_Bloks"
Set 'Created_Bloks' to 1

The first time it works perfectly but the second time if I let space pressed it spawn many bloks !!!!

And secondly, I created a sprite ''DIE" when my hero touch it the sceen scroll to this block and the screen shake but if i dont touch it scroll is disable but the screen doesn't follow my hero !!

Here is the document !!Sorry for my english, and thaks a lot.
B
4
S
1
Posts: 6
Reputation: 364

Post » Mon Mar 17, 2014 6:50 pm

Try it like that, you need 1 boolean variable, can be a player instance var. call it canCreatePlatform for example.

Player > On Jump> Set canCreatePlatform to true.

Player > On Jump--------------------------- canCreatePlatform = 1---------> Set canCreatePlatform to 0
Space pressed ------------------/ Create platform under hero's feet.

Player > On landed > Set canCreatePlatform to 0

Platform > On created > Wait 2 seconds.
Destroy

As for the scroll, I don't know what is happening. Are you using System> set scroll to object (Hero)??
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Mon Mar 17, 2014 7:27 pm

Thanks !

EDIT: It works !!
B
4
S
1
Posts: 6
Reputation: 364


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 24 guests