Results 1 to 3 of 3

Thread: How do I make a reload feature for a gun?

  1. #1

    How do I make a reload feature for a gun?

    Is there an easy way to make a reload feature for a gun? Currently I have it so when you pickup ammo it goes straight into the gun so every time you pick some up it just gains more and you don't have to reload. I want to make it so that picking up ammo adds the ammo to the reserve then pressing R adds say 15 to the gun. Currently I have all the info stored in global values since there are multiple different weapons. Id like this to be rather easy to port over to new weapons as well if I decided to add them. Current global values

    Last edited by Camomano99; 23rd December 2016 at 02:17 AM.

  2. #2

    Unhappy this is a very basic way

    this is a very very basic way

    make a counter set to say 5 (Mario) and one to 0 (Toad)

    when you collision with a reload icon, if the counter starting with 5 (Mario) is equal to 1 or above, then add 5 to the counter with 0 (Toad)

    then if the counter starting with 0 (Toad) is equal to 5, plus pressing (reload) button, add 5 to counter (Mario)

    However your be able to reload with counter (Mario) still full which is a problem, as your waste a reload
    and its not much use with multiple weapons, sorry
    Last edited by Daniels1980; 11th January 2017 at 07:41 PM.

  3. #3
    This is me just trouble shooting, and I only just began using the program, however, I think I can get through this with a couple ideas.
    Create an object along the lines of "clip" if you use different guns, make one for each gun.
    Give each "Clip" a set number of lives/health
    Whenever you fire the weapon, subtract 1 life/health
    If clip lives/health = 0 and you fire the weapon check for box (see below)
    if box > 0 set clip to max lives/health (+ animations, sounds etc.)

    Create an item called "box"
    give the box a maximum health/lives
    whenever you pick up a "Ammo" item, add that number to the box
    whenever you reload, subtract the clip from the box

    add some math for if you have bullets left in your clip.

    Viola! you have an ammo system, hide or show these things as you see fit in your game.

Similar Threads

  1. How do I make a save/load feature.
    By Camomano99 in forum Developer Services
    Replies: 1
    Last Post: 12th December 2016, 09:04 AM
  2. Replies: 1
    Last Post: 26th June 2015, 10:28 PM
  3. Overlay reload bmp
    By crugh in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 29th December 2007, 07:52 AM
  4. [Request] Picture object - Reload
    By joewski in forum Extension Development
    Replies: 1
    Last Post: 16th March 2007, 11:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts