About reload ammo please help

0 favourites
  • 2 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello

    I'm a newbie here but I wonder how to set ammo whenever player reload them.

    ex. ammo remain (max 10)/ ammo backup (max 20)

    10/ 20

    if player once shot 1 time ammo of player will be 9/20 right? but now player want to reload, So now will be 10 /19 and can't not reload until ammo remain is lower 10 again.

    How can i set like this ? please advice me.

    thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As the developer you will have to decide where to store the values and what to name them, but the logic is as follows:

    You will need two variables weaponAmmo & storedAmmo.

    weaponAmmo = 10; storedAmmo = 20;

    Events would look something like this:

    Condition: On Fire; Action: subtract 1 from weapon ammo;

    Condition: On Reload & weaponAmmo is less than 10; Action 1: Set storedAmmo to (storedAmmo-(10-weaponAmmo)); Action 2: Set weaponAmmo to 10

    Start there, you will need to adavance the algorythm for when storedAmmo is less than ammo need to fill it gun.

    By the question I suppose you are pretty new to this stuff, stick with it and get used to creating your own logic, use the manual.

    Good Luck!

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