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

#1 2010-06-20 15:36:20

YellowstoneWolf
Scratcher
Registered: 2010-06-19
Posts: 8

More simple varaible problem

i need help to fix a script that if the sprite's varaible (health) falls below zero it ends game

it is this but as soon as it falls below 0 it doesn't stop

if 1>Player health
switch costume boom
say: game over
stop all


plz correct me

Offline

 

#2 2010-06-20 15:38:29

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: More simple varaible problem

forever if 0.001 > Health
| switch to costume |boom|
| say: |game over|
|Stop All
__________________________


You can now reach me on Twitter @johnnydean1_

Offline

 

#3 2010-06-20 16:09:08

YellowstoneWolf
Scratcher
Registered: 2010-06-19
Posts: 8

Re: More simple varaible problem

Wow thanks

Offline

 

#4 2010-06-21 15:31:10

Buggy132KX
New Scratcher
Registered: 2010-06-21
Posts: 29

Re: More simple varaible problem

I would have thought

|Forever If {Health > 0}
|| Broadcast End Game
||Switch to costume Boom


This way you can make it so when you die you can put 'When End Game Recieved' Instead of When flag clicked on the first script line. Then put whatever you want to happen under that tag. This'll make it so you can edit more than just your character and it's quite simple.

Offline

 

#5 2010-06-21 15:41:26

Buggy132KX
New Scratcher
Registered: 2010-06-21
Posts: 29

Re: More simple varaible problem

Sorry for double posting, but i don't know where the edit button is XD

Instead of Forever if Health > 0 It should be
Forever is Health < 0 Or equal to 0

Offline

 

#6 2010-06-21 15:49:32

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: More simple varaible problem

Buggy132KX wrote:

Sorry for double posting, but i don't know where the edit button is XD

[Off-topic helpfulness] It's at the bottom left of the post... There's also some other neat buttons like "Report," "Quote," "Delete," etc...

Offline

 

#7 2010-06-21 16:13:00

Buggy132KX
New Scratcher
Registered: 2010-06-21
Posts: 29

Re: More simple varaible problem

Sorry to be off topic, but i cannot see it, do i need a certain amount of posts? I only see quote and delete  sad

Offline

 

#8 2010-06-21 16:27:31

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: More simple varaible problem

Buggy132KX wrote:

Sorry to be off topic, but i cannot see it, do i need a certain amount of posts? I only see quote and delete  sad

Oh, yes, the reason you don't see it is because you're classified as a "New Scratcher" - sorry for the confusion!

Offline

 

Board footer