Need help with changeing (every x seconds) system command

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • so basicly ive made it so...

    on Right arrow pressed, Spawn sprite 2 on sprite 1

    (system) every 1.0 seconds

    on Up arrow pressed, Spawn sprite 2 on sprite 1

    (system) every 1.0 seconds

    on left arrow pressed, Spawn sprite 2 on sprite 1

    (system) every 1.0 seconds

    on down arrow pressed, Spawn sprite 2 on sprite 1

    (system) every 1.0 seconds

    and say i get a power up for my character and i want to change All of the (system) every 1.0 seconds at the same time and keep it that way thought the entire game, how would i go about doing so?

  • Hi dmt90001

    If you want to change all the 1 seconds to 2 seconds:

    1) add a global variable spawnTime and set it to 1.

    2) replace the "1.0" in each "every 1.0 seconds "so that it reads "every spawnTime seconds".

    3) on power-up collected change the value of spawnTime from 1 to 2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yep. As mekonbekon has said, use a variable to control things that you want to, vary, at runtime.

    Using variables is an easy yet powerful way to change anything in your code on the fly... I even use them in the design process when I'm experimenting with things, so that I don't have to change a value in 10 different events... I can just change a global variable value and it does everything else for me!

    ~Sol

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