|
Post by pailong on Mar 10, 2004 15:17:41 GMT -5
I already have variable ammo and it's working fine. The problem is how do i show the amount of ammo left at the screen?
For eg. I picked up a weapon, the sprite is displayed and the ammo is set to 10. I can shoot for 10 times. The prob. is, I need to know how much exactly the amount of ammo I have left instead of counting how much I have shot.
I tried to draw variable ammo at the creation event but it says error. "unknown variable ammo"
Pls help.
(preferably no scripts)
|
|
|
Post by IsmAvatar on Mar 10, 2004 15:20:50 GMT -5
1) This makes the fifth time, you are supposed to draw stuff in the DRAW event 2) you told it to draw variable ammo before initializing it. you need to initialize a variable before calling it. (Yes I have been counting)
|
|
|
Post by hamalnamal on Mar 10, 2004 20:52:25 GMT -5
just make an event thats invisible and in the create event set varible ammo to 0, and when you pick up ammo or a gun make vaible ammo go up whatever amount, than in the draw event of the invisible object make it if varible ammo 0 draw nothing if varible ammo > 0 than draw varible ammo at whatever,whatever
|
|
|
Post by IsmAvatar on Mar 10, 2004 20:57:37 GMT -5
hamalnamal, test before speaking. drawing must take place in a VISIBLE object. it will draw what is in the draw event instead of it's sprite. if you want it to draw the sprite, draw_sprite(sprite_index,-1,x,y)
if you don't feel right having an object with a sprite be visible and have a draw event, then dont' give it a sprite.
|
|