0 Favourites

Constant PowerUps

  • Space is down, every 0.7 seconds, spawn bullet blah blah blah.

    How do I make it that when the Player collides with the power up, the time changes to 0.6 and stays like that until the game is restarted or another power up is collected and brought down another o.1? Been annoying for ages now and I need to sort it.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Use a global variable, Space is down , every (global variable) , do something , on collision with powerup , decrease global variable by what ever you want.

  • I don't understand what you mean, I want to be able to change the time from 0.7 down by 0.1 every time I collide with a PowerUp making the bullet spawn rate from the Players character spawn bullets faster but I don't see how I would able to use a Global Variable to change time of delay for bullet spawning.

  • Sorry I was not more specific and actually you need two variable's. A object variable and a global.

    space key is down

    (subevent) object variable greater than 0--->subtract 1 from object variable

    (subevent) object variable =0------->spawn bullet

    ------->set object variable to global variable

    on collision between player and powerup---->destroy powerup

    ----> subtract from global variable

    ---->set object variable to global variable

    Play around with your initial settings , set your object and global variable's the same initially and subtract from your global an amount that gives you the speed increase that you want , remember 60 ticks per second or what ever your fps is. So if you start with 60 and then subtract 10 every time you hit a powerup your spawn rate will increase as per powerup's. You might want to clamp your global variable so as not to go below a certain number . Hope this will help and is more clear !

  • Oh and if you restart your level make sure you set your global to its initial state or it will start off at it's last setting .

  • I have my powerups working but I have my powerups set so that:

    (Global Variable - EnemyDeath) = 10 ---> Create object PowerUp on layer "Background"

    Set Bullet Speed to random(10-80)

    Add 1 to Enemy Death {to stop them spawning repeatedly}

    But how can I make this so it's every 10 enemy deaths spawn a PowerUp without spamming them and needing to add another just to to them spamming? I'm sure there is a more efficient way.

    Basically, just make so for every 10 enemy deaths, spawn a single powerup.

    Thanks for your help so far btw!

  • Make 2 events

    1) Enemy=destroyed & Global Variable EnemyDeath<10 | add value 1 to Global variable EnemyDeath & destroy enemy

    2) Enemy=destroyed & Global Variable EnemyDeath>9 | Spawn power ups at enemy & Set GlobalVariable EnemyDeath = 0 & Destroy enemy

  • here is one way (but then again I've not read all the previous posts so I might be missing something important )

    using latest beta - download found at bottom of most screens

    edit - I am sure the two posts above weren't there before - Oh well, it still might be useful ?

  • How much powerups can we make?

  • ikke2902;

    I did what you said to the exact same but the PowerUps don't seem to spawn,

    I looked at it during debug and it seems that one has spawned and is moving off screen very very fast but I'm not sure. I used the On Destroyed for the enemy being detected as destroyed but I'm not sure if it might be the global variable messing up.

  • RamPackWobble;

    I will look at what you've sent, just need to redownload to an updated version of construct-_-

    Edit: Will not update it ._.

  • Can be done a few ways but here's how I'd go about it.

    Set the enemy spawning events under a group.

    On enemy destroyed, add one to a variable.

    When that variable equals ten, Set group 'enemy spawning' deactivated, create object power up.

    On collision with power up, wait a couple seconds, set group 'enemy spawning' activated. This removes the need for a variable to determine whether or not enemies are spawning.

    Make sure you apply the "trigger once when active" condition so that only one power up spawns.

    Also, I would do a separate event like Powerup - on created -> set bullet speed to random(10,80).

    Is this what you're having trouble with or something I haven't picked up on?

  • Not exactly, I want it so that when the player kills 10 enemies, on the tenth spawn a power up and reset it so that the game can recount to 10 again to making another power up. Like the user ikke2902 explained in an earlier post, but it doesn't seem to be working properly.

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