This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-02-25 14:00:26

nathanh123
Scratcher
Registered: 2012-02-17
Posts: 11

Please help with My 2D zombie survival game

Hey  smile  so here is the problem, im making a 2D zombie survival game, im getting a bit stuck on making 'limmited Ammunition' as a game feature. Ive tried a few different meathods but i just dont really know how or where to start. i will need 'Ammo' as a varriable, I know that much, please help me thanks  smile

Offline

 

#2 2012-02-25 14:02:20

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Please help with My 2D zombie survival game

if <(ammo) > (0)>
    set [can_shoot v] to (1)
else
    set [can_shoot v] to (0)
end
Like that?

Offline

 

#3 2012-02-25 15:22:32

ConnorJamesMcIntosh
New Scratcher
Registered: 2012-02-25
Posts: 14

Re: Please help with My 2D zombie survival game

What is a 2d zombie survival what the name of all the scrip i need

Offline

 

#4 2012-02-25 15:22:35

nathanh123
Scratcher
Registered: 2012-02-17
Posts: 11

Re: Please help with My 2D zombie survival game

mm... not really, what ive been trying to do is like, 'when you fire, change ammo by -1' and also 'if ammo = 0 then don't allow to fire'   I just dont know how to script this correctly??

Offline

 

#5 2012-02-25 15:38:23

Stickman704
Scratcher
Registered: 2009-01-31
Posts: 1000+

Re: Please help with My 2D zombie survival game

On your firing script, add an "if" to it and make it check your ammo count (if ammo > 0) etc.

when i receive [fire v]
if <(ammo) > (0)>
firing script here

Last edited by Stickman704 (2012-02-25 15:41:26)


Dun dun dun dun dun dun.... dun dun dun dun dun dun...  tongue

Offline

 

#6 2012-02-25 16:16:41

nathanh123
Scratcher
Registered: 2012-02-17
Posts: 11

Re: Please help with My 2D zombie survival game

ok thanks that was helpfull  smile

Offline

 

#7 2012-02-26 07:33:23

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Please help with My 2D zombie survival game

Here's a script.
(for the bullet)

when gf clicked
forever
if <choose condition>
if <(ammo) > (0)>
shooting script here
change [ammo v] by (-1)
end
end
Replace the CHOOSE CONDITION block with a <KEY ??? PRESSED?> or a <MOUSE DOWN?> block.

Offline

 

Board footer