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

#1 2013-04-19 18:07:26

devone
Scratcher
Registered: 2013-03-19
Posts: 13

help with shooting bullets etc

today i created my first game,
a recreation of an atari classic

check it out here
http://scratch.mit.edu/projects/devone/3276562

compare it to this one
https://www.scratch.mit.edu/ext/youtube/?v=puaS9g4xGTs

i took it as far as i can,
i would like advice on how to improve it,
just explain to me or remix my project and ill learn from your code.

as you can see its far from finished,

* i dont know how to shoot more than 1 bullet/nuke at a time
* add a highscore
* throw the nuke into the air left/right direction before sinking into the ocean
* minimap which displays enermys before they arrive on your screen
* enermys come from both directions

if anybody can help with any of these things please go ahead

Offline

 

#2 2013-04-19 18:45:53

Maltese_Falcon
Scratcher
Registered: 2013-03-25
Posts: 100+

Re: help with shooting bullets etc

Well...Let's think here...for high score, in the nuke's coding, I'd say

if <touching color [#bbffff] //if touching the nuke
change (score) by [1] //change the score by one
end
and
when gf clicked
forever //always check for:
if <(score) > (highscore)> //if the score is higher than the high score
set (highscore) to (score) //set your highscore to the current score
end
end
[/scratchbolocks]
As for nukes, I think to do this efficiently, 2.0 has cloning, I think, so you'd have the bullet clone itself. Otherwise, you're just going to have to make a bunch of nukes and have a variable called CurrentNuke. After a nuke either hits the bottom or hits a submarine, have it set CurrentNuke to whatever number it is. When space is pressed, make each nuke a script like this:
When [space key v] pressed
if <(CurrentNuke) = [Number of the Nuke]
go to [ship v]
show
repeat until <touching color [#bbffff]
 change y by [-2]
end
end

Offline

 

Board footer