a bug? Bullet speed not increasing

  • i made a poweup for the game im making so that when the player collides with it, it increases the bullet speed (Super Ammo). then destroys itself

    it destroys itself but the bullets are not coming out faster.

    why is this?

  • Impossible to say without either seeing your code or a .capx - there's no way for us to know how you have set it up.

  • Have you set the acceleration to increase / decrease properly?

  • anyone?

  • Just to be clear, that will only increase the speed of bullets that exist at that time. It won't affect future bullets. You'd need a global to manage that.

  • GLOBALVARIABLEBULLETSPEED = 100

    bullet on created : set speed to GLOBALVARIABLEBULLETSPEED

    player on collision SUPERAMMO : set GLOBALVARIABLEBULLETSPEED to 200

  • GLOBALVARIABLEBULLETSPEED = 100

    bullet on created : set speed to GLOBALVARIABLEBULLETSPEED

    player on collision SUPERAMMO : set GLOBALVARIABLEBULLETSPEED to 200

    This worked! Thank you!

    is their a list of global Vars that i can see that are used within construct 2?

  • You can use a global variable pretty much anytime you can type a number in the events mode. You can name the variables anything you want as long as construct isn't already using that name for something else. The above example would work if you used the name superCat. This would make it difficult to remember what it did, though.

    It will also be important to reset the variable when you are done with the level or your bullets will always be speed 200.

  • You can use a global variable pretty much anytime you can type a number in the events mode. You can name the variables anything you want as long as construct isn't already using that name for something else. The above example would work if you used the name superCat. This would make it difficult to remember what it did, though.

    It will also be important to reset the variable when you are done with the level or your bullets will always be speed 200.

    but then how would construct no what im talking about is i just named any random variable? EG if i said variableExp.

    How would construct no im talking about the EXP or points without it being somehow linked to that object ect

  • what global vars are used in construct? a list perhaps

  • There are none. You misunderstand. You make globals when you need them. You need to do some more tutorials to understand how things work.

  • There are none. You misunderstand. You make globals when you need them. You need to do some more tutorials to understand how things work.

    You are a god!! lol thank you i now know what the vars are used for. making things much easier

  • Construct2 does not know what your variables names stand for. It is up to you to give them meaning.

    For a software a variable called MaxSpeed and another called Playerlifes are basically the same, just 2 variables that store numbers. Variable names are useful for you, the programmer, to remember how are you going to use them

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Variables are sort of like files on your computer, you can name it (almost) anything you want you just need to make sure you use the same name the next time you use it.

    You tell construct which one you want to use by writing the name in when construct asks for a number.

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