Ammunition in SURVIVAL

Started by timlump, Sun 19/11/2006 01:48:24

Previous topic - Next topic

timlump

In my zombie action free roaming game i have the shooting system working how i would like it or at least accept it but how would i make it so that say i use and object "ammo" which has twenty rounds adds 20 rounds to your gun and also every time you shoot (note the gun is a cursor)
it deducts 1 round until it reahes 0 and runs a code of my choice.

Please help as it would greatly speed my rather slow progress.

p.s by slow i mean slow, my rather shameful game Zombie Nation took 3 years,
I'm determined but rather lazy although i really have just been studying to hard!
300 hours in 3 weeks cant be good.

monkey0506

#1
You fool! That would leave you spending 40.47619047619047619047619047619% of your time not working on your game! A dedicated game maker devotes 100% of his/her time!!! :P

Would something like this work for you?:

Code: ags
// script header
import int ammo;

// global script
int ammo = 20;
export ammo;

// fire gun script
if (ammo) { // this is the same as if (ammo != 0)
  ammo--;
  // show bullet firing, etc
  }

// pick up ammo script
ammo = 20;


It requires some work on your part figuring out where that should go (namely because AGS doesn't have built-in fire_gun() or pick_up_ammo() functions ;)), though if you have any idea how to accomplish what you're trying to do it shouldn't be too hard to get.

[EDIT:]

To clarify what I said, I'll be willing to help with individual tasks, such as storing ammunition, but I won't script your game for you. ;)

timlump

thanks for the scripting help
also you forgot to factor in i sleep 7 hours a day

Ponch

Sleep is for the weak!

No sleep until you finish your zombie game. AGS is seriously lacking in zombie themed games. And hentai games! Why are there no AGS hentai games?

Ooh! Make a zombie hentai game! It would have something for everyone!

R4L

Or just go to Newgrounds...

monkey0506

Someone wrote an AGS Zombie-Hentai game in Flash?!?!? AWESOME!

......Wait a second...someone ported AGS to Flash?!?!? OMFG!!! SWEET!

;)


SMF spam blocked by CleanTalk