Create a sub event and compare on reload : if (maxammo-clipammo) greater than ammoleft, add ammoleft to clipammo and set ammoleft to 0. ELSE do the previously mentioned logic.
Hello again, im wondering, its possible to make this same events but without global variables?
i try to make something similiar but with instance variables of One sprite.
If sprite have instance variables:
-'ammoleft' "100"
-'ammoinclip'
-'maxammo' in clip "12 (this variable can stay as a global variable if that help, because maxc ammo clip i can change easily in events)
-'Type' 0 or 1
type 0 means is inventory type sprite and should be storage for 'ammo left' instance variable.
type 1 means its weapon, and use 'ammo in clip' and 'max ammo' too
so i have in layout two sprites (the same sprite object) with variables:
'Type 0' and 'ammo left' is 100
and
second sprite 'Type 1' its storage for 'ammo clip'
When i tap 'R" reload weapon and fill clip size
After shoot, from sprite 'Type 1' substract 1 from his 'ammo clip' variable
(Because in future when i add other weapons, each weapon should not use this same global variables)