Allow only one instance at a time.

0 favourites
  • 4 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • 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.

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

  • Try Construct 3

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

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