Allow only one instance at a time.

Get help using Construct 2

Post » Sun May 06, 2012 12:44 pm

Hi everyone,

I'm having a little trouble. I'm making a game where a frogs tongue uses a bullet movement towards the mouse upon click. So of course there should be only one instance of the tongue at any time. Seems like this should be easy but nothing is working.

I gave the tongue an instance variable set to false.
made a mouse click condition with an inverted check of the tongues variable.
and one the tongue is created set the variable to true.

I tried a couple other ways as well. Am I doing this right?
One possible problem is that I'm using r88. I tried to revert back to r84 to test there but was unable to open the file because of a complaint that it was from a newer version.

Any help would be great appreciated.
B
10
S
2
G
3
Posts: 13
Reputation: 2,907

Post » Sun May 06, 2012 1:26 pm

Hey kalon, if you post a cap.x of the problem its much easier to help you out. Depending on the rest of your project it could be anything, maybe you have another action that conflicts?
ImageImage
B
73
S
16
G
6
Posts: 1,039
Reputation: 10,475

Post » Sun May 06, 2012 2:26 pm

Looks like I can get the proper behavior if I just move the one instance of the tongue instead of spawning new ones. I'm sure to run into more trouble later though so it's nice to know there is such a great community here.
B
10
S
2
G
3
Posts: 13
Reputation: 2,907

Post » Sun May 06, 2012 2:59 pm

If you spawn tongues, make sure you destroy them when they disappear. Then you can add a "System -> Compare two values" condition to your spawn event:

[code]
TongueSprite.Count < 1
[/code]
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 1 guest

cron