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

#1 2010-09-20 20:59:19

tchan5158
New Scratcher
Registered: 2010-09-19
Posts: 25

Bullets Hitting Enemy Weird...

Hi  big_smile

I'm super new to Scratch, and after a couple of days, I made this so far.  However, I notice that most of my bullets tend to pass harmlessly through the enemy ship.  The bullets that DO hit work correctly, as the ship's HP goes down accordingly. 

I registered all 6 of my bullets to subtract 1 HP from enemy's hp variable, but it isn't working as I want it.  I want all my bullets to hit the enemy, as each bullet as make the ship change to the Damaged costume.

I added lots of comments on the coding, so I hope someone can offer a solution or spot my problem  big_smile

http://scratch.mit.edu/projects/tchan5158/1309630

(and for some reason my ship is a bit crooked if u run it online.  O_o;)

Offline

 

#2 2010-09-21 01:25:01

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Bullets Hitting Enemy Weird...

Ah, I see your problem. This is the script that checks if the enemy ship should be hurt:

http://img15.imageshack.us/img15/3141/318bulletscript1.png

The Forever if block is restricted to one condition - for more, you should take a Forever block and stack If blocks in it. Here's the fixed script:

http://img85.imageshack.us/img85/1601/319bulletscript2.png

Any questions?


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#3 2010-09-21 03:48:55

tchan5158
New Scratcher
Registered: 2010-09-19
Posts: 25

Re: Bullets Hitting Enemy Weird...

OOOOhhh thank you thank you thank you!  big_smile   big_smile   big_smile

Yesh it working now!  I must add your name to my Credits and Special Thanks list   smile


Jonathanpb wrote:

Ah, I see your problem. This is the script that checks if the enemy ship should be hurt:

The Forever if block is restricted to one condition - for more, you should take a Forever block and stack If blocks in it. Here's the fixed script:

Any questions?

Offline

 

Board footer