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

#1 2013-04-13 18:24:54

Suparing01
New Scratcher
Registered: 2013-03-31
Posts: 49

Why does the boss automatically kill me?

http://scratch.mit.edu/projects/Suparing01/3226908

Firstly, please go to options> scene selections > scene on the right, and enter the boss battle. Whenever I'm close to dying, but I kill the boss, a few seconds later he kills ME.

Example:

Tim(8)
Tom(14)
Boss(2)

If I were to kill the boss, he would die, and a few seconds later, the game over screen will come up.

How can I prevent this?

Offline

 

#2 2013-04-14 13:01:22

joshuaho
Scratcher
Registered: 2012-08-20
Posts: 100+

Re: Why does the boss automatically kill me?

Suparing01 wrote:

http://scratch.mit.edu/projects/Suparing01/3226908

Firstly, please go to options> scene selections > scene on the right, and enter the boss battle. Whenever I'm close to dying, but I kill the boss, a few seconds later he kills ME.

Example:

Tim(8)
Tom(14)
Boss(2)

If I were to kill the boss, he would die, and a few seconds later, the game over screen will come up.

How can I prevent this?

Did you put this?

when I receive[boss battle]
set life to [0]
If you did, then that is the source of the problem.


Did you know that you can go to space and see Mars by clicking here?

Offline

 

#3 2013-04-14 14:37:09

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Why does the boss automatically kill me?

joshuaho wrote:

Suparing01 wrote:

http://scratch.mit.edu/projects/Suparing01/3226908

Firstly, please go to options> scene selections > scene on the right, and enter the boss battle. Whenever I'm close to dying, but I kill the boss, a few seconds later he kills ME.

Example:

Tim(8)
Tom(14)
Boss(2)

If I were to kill the boss, he would die, and a few seconds later, the game over screen will come up.

How can I prevent this?

Did you put this?

when I receive[boss battle]
set life to [0]
If you did, then that is the source of the problem.

I'm pretty sure he knows better than to kill the player automatically when the battle starts.

What I think is happening is that even though you killed the boss, the boss still has a turn and it kills you. You should have the boss check whether it still has health remaning before attacking I guess.

Offline

 

#4 2013-04-14 19:37:04

joshuaho
Scratcher
Registered: 2012-08-20
Posts: 100+

Re: Why does the boss automatically kill me?

Suparing01 wrote:

http://scratch.mit.edu/projects/Suparing01/3226908

Firstly, please go to options> scene selections > scene on the right, and enter the boss battle. Whenever I'm close to dying, but I kill the boss, a few seconds later he kills ME.

Example:

Tim(8)
Tom(14)
Boss(2)

If I were to kill the boss, he would die, and a few seconds later, the game over screen will come up.

How can I prevent this?

There might be another problem. For example, if you have a broadcast message that says boss battle and then you put this:

when I receive[boss battle]
broadcast[game over]
The broadcast message said game over after boss battle was received. In that case, game over messages will tell the other sprites to hide and the stage switch to game over.


Did you know that you can go to space and see Mars by clicking here?

Offline

 

#5 2013-04-15 15:07:32

Suparing01
New Scratcher
Registered: 2013-03-31
Posts: 49

Re: Why does the boss automatically kill me?

kayybee wrote:

joshuaho wrote:

Suparing01 wrote:

http://scratch.mit.edu/projects/Suparing01/3226908

Firstly, please go to options> scene selections > scene on the right, and enter the boss battle. Whenever I'm close to dying, but I kill the boss, a few seconds later he kills ME.

Example:

Tim(8)
Tom(14)
Boss(2)

If I were to kill the boss, he would die, and a few seconds later, the game over screen will come up.

How can I prevent this?

Did you put this?

when I receive[boss battle]
set life to [0]
If you did, then that is the source of the problem.

I'm pretty sure he knows better than to kill the player automatically when the battle starts.

What I think is happening is that even though you killed the boss, the boss still has a turn and it kills you. You should have the boss check whether it still has health remaning before attacking I guess.

No, I didn't make it so I die automatically, and the part above in bold is the problem, it's just, I'm puzzled on how to fix it. How can I make it so the boss checks if he has health before broadcasting his turn?

Offline

 

#6 2013-04-15 16:02:21

topazdragonlord
Scratcher
Registered: 2013-02-22
Posts: 500+

Re: Why does the boss automatically kill me?

Suparing01 wrote:

kayybee wrote:

joshuaho wrote:

Did you put this?

when I receive[boss battle]
set life to [0]
If you did, then that is the source of the problem.

I'm pretty sure he knows better than to kill the player automatically when the battle starts.

What I think is happening is that even though you killed the boss, the boss still has a turn and it kills you. You should have the boss check whether it still has health remaning before attacking I guess.

No, I didn't make it so I die automatically, and the part above in bold is the problem, it's just, I'm puzzled on how to fix it. How can I make it so the boss checks if he has health before broadcasting his turn?

Try this  smile  :

when gf clicked
forever
  if <(Boss Health) > [0]>
  say[ replace this block with the scripts you want to use for the boss attacking]
  end
  if <(Boss Health) < [1]>
  say[ replace this block with the scripts you want to use for the boss being defeated]
  end
hope this helps,
topazdragonlord

Last edited by topazdragonlord (2013-04-15 16:03:08)


http://i45.tinypic.com/idumbk.png

Offline

 

#7 2013-04-15 16:34:12

joshuaho
Scratcher
Registered: 2012-08-20
Posts: 100+

Re: Why does the boss automatically kill me?

Suparing01 wrote:

No, I didn't make it so I die automatically, and the part above in bold is the problem, it's just, I'm puzzled on how to fix it. How can I make it so the boss checks if he has health before broadcasting his turn?

Did you put a forever block?


Did you know that you can go to space and see Mars by clicking here?

Offline

 

#8 2013-04-15 19:32:30

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Why does the boss automatically kill me?

topazdragonlord wrote:

Suparing01 wrote:

kayybee wrote:


I'm pretty sure he knows better than to kill the player automatically when the battle starts.

What I think is happening is that even though you killed the boss, the boss still has a turn and it kills you. You should have the boss check whether it still has health remaning before attacking I guess.

No, I didn't make it so I die automatically, and the part above in bold is the problem, it's just, I'm puzzled on how to fix it. How can I make it so the boss checks if he has health before broadcasting his turn?

Try this  smile  :

when gf clicked
forever
  if <(Boss Health) > [0]>
  say[ replace this block with the scripts you want to use for the boss attacking]
  end
  if <(Boss Health) < [1]>
  say[ replace this block with the scripts you want to use for the boss being defeated]
  end
hope this helps,
topazdragonlord

or you can do:
if boss > 0
he's alive
else
he's dead
end
as you missed the range from 0 to 1, including 0 and 1.

Offline

 

Board footer