0 Favourites

Allow only one instance at a time.

  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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?

  • 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.

  • 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:

    TongueSprite.Count < 1
    
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
234 61,222
DARKSETH's avatar
DARKSETH
Unread hot topic
132 10,994
Burvey's avatar
Burvey
Unread hot topic
0 Favourites
Time to move forward?
110 9,561
GG-Works's avatar
GG-Works