My spawning bug. HELP!

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I have put a system in place where an object spawns every 24 seconds.

    The only thing is, there is an exploit that could be found here.

    If the player were to jump into the item spawn at the 24 second mark,

    the player gets a bunch of the items all at once.

    I tried making it spawn 'Once while true' but that doesn't seem to work either.

    Got any ideas?

    The other bit of code is whether or not the spawn is 'On'. I've made it so if the item it spawns is overlapping, the spawn turns off.

  • Without the trigger once it would spawn a lot of items anyway I guess. With the trigger once it could be fine but maybe if the item gets destroyed and the bool toggles then it will also spawn a lot of items. The fix kind of depends on the design of the game but you could add a check if player is overlapping the spawn point. You could also think about adding timer behaviour to the spawn point so each has their own timer and if player is overlapping it then it doesn't start counting.

  • That's a good idea. I haven't played with the timer behavior yet.

  • And actually that makes a lot of sense. That could be the problem.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Without the trigger once it would spawn a lot of items anyway I guess. With the trigger once it could be fine but maybe if the item gets destroyed and the bool toggles then it will also spawn a lot of items. The fix kind of depends on the design of the game but you could add a check if player is overlapping the spawn point. You could also think about adding timer behaviour to the spawn point so each has their own timer and if player is overlapping it then it doesn't start counting.

    Hey dude! I decided to go with the simplified approach.

    My spawning variables were too complicated. Think it would be better if I simplified that bit of code without on/off variables.

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