Having problems with creating functions that repeat in my game, help please D: !!!!!!

0 favourites
  • 2 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I'm making a simple Shoot 'em Up game, started to use functions and ran into some troubles

    So the enemy shark is supposed to spawn 15 times before wave 2 happens, but what ends up happening is only one shark spawns and the inimigosSpawnados is stuck with the value "1"

    I believe the problem is on the "every 2 seconds" not being implemented correctly, but I don't know how to implement it correctly

    please if you know how to fix this, or even a better way to implement waves (I'm still kind of a beginner), do please tell i would apreciate it very much :DDD

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The way you are using functions is very wrong. Functions should be at the top level, avoid nesting them under other events or conditions. Also, "Every X seconds" inside the function won't work.

    And that chain of functions calling each other is completely unnecessary..

    Say, you want to spawn a new wave of sharks every 2 seconds. And each wave should contain 5 more sharks. Then you can do something like this:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)