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

#1 2012-11-23 13:51:58

GenChico
Scratcher
Registered: 2012-11-08
Posts: 100+

Bullet firing help

Hi Guys, i need some help on a Halo 4 inspired game. I need help making the brute fire his gun. Link to project:http://scratch.mit.edu/projects/GenChica/2931221


http://i.imgur.com/Cb8HC.png

Offline

 

#2 2012-11-23 13:55:23

GenChico
Scratcher
Registered: 2012-11-08
Posts: 100+

Re: Bullet firing help

GenChico wrote:

Hi Guys, i need some help on a Halo 4 inspired game. I need help making the brute fire his gun. Link to project:http://scratch.mit.edu/projects/GenChica/2931221

Hate that new scratchers can't edit posts... I want him to fire every time you press space.


http://i.imgur.com/Cb8HC.png

Offline

 

#3 2012-11-23 14:11:28

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Bullet firing help

Okay, I see the problem. In your brute, you have a script like this:

when [space v] key pressed
go to [brute v]
show
repeat until <not <(Master Chief Life) = (0)>>
 wait (1) secs
 point towards [master chief v]
 wait (0.000001) secs
 forever if <not <(touching [master chief v]?) or (touching color [#fcff00]?)>>
  move (10) steps

First of all, you'll need to remove the first repeat until loop. Then, you might want to remove the not in the forever if and replace the forever if with a repeat until loop. Make sure it looks like this:

when [space v] key pressed
go to [brute v]
show
wait (1) secs
point towards [master chief v]
wait (0.000001) secs
repeat until <(touching [master chief v]?) or (touching color [#fcff00]?)>
 move (10) steps
end

And once you've done that, you're game should be up and running.

I hope that this helps!


http://i46.tinypic.com/35ismmc.png

Offline

 

#4 2012-11-23 14:15:20

GenChico
Scratcher
Registered: 2012-11-08
Posts: 100+

Re: Bullet firing help

ErnieParke wrote:

Okay, I see the problem. In your brute, you have a script like this:

when [space v] key pressed
go to [brute v]
show
repeat until <not <(Master Chief Life) = (0)>>
 wait (1) secs
 point towards [master chief v]
 wait (0.000001) secs
 forever if <not <(touching [master chief v]?) or (touching color [#fcff00]?)>>
  move (10) steps

First of all, you'll need to remove the first repeat until loop. Then, you might want to remove the not in the forever if and replace the forever if with a repeat until loop. Make sure it looks like this:

when [space v] key pressed
go to [brute v]
show
wait (1) secs
point towards [master chief v]
wait (0.000001) secs
repeat until <(touching [master chief v]?) or (touching color [#fcff00]?)>
 move (10) steps
end

And once you've done that, you're game should be up and running.

I hope that this helps!

Thanks, Ernie. Now it works, i will put credit in my project notes.


http://i.imgur.com/Cb8HC.png

Offline

 

#5 2012-11-23 15:04:58

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Bullet firing help

GenChico wrote:

ErnieParke wrote:

Okay, I see the problem. In your brute, you have a script like this:

when [space v] key pressed
go to [brute v]
show
repeat until <not <(Master Chief Life) = (0)>>
 wait (1) secs
 point towards [master chief v]
 wait (0.000001) secs
 forever if <not <(touching [master chief v]?) or (touching color [#fcff00]?)>>
  move (10) steps

First of all, you'll need to remove the first repeat until loop. Then, you might want to remove the not in the forever if and replace the forever if with a repeat until loop. Make sure it looks like this:

when [space v] key pressed
go to [brute v]
show
wait (1) secs
point towards [master chief v]
wait (0.000001) secs
repeat until <(touching [master chief v]?) or (touching color [#fcff00]?)>
 move (10) steps
end

And once you've done that, you're game should be up and running.

I hope that this helps!

Thanks, Ernie. Now it works, i will put credit in my project notes.

Your welcome! And also, great job on your game!


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer