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

#1 2012-07-09 08:51:49

i_wills_blabla
New Scratcher
Registered: 2012-07-05
Posts: 11

game over

hey when my game reaches a certain score you win should come up on the screen, that is working, but when your score goes below 0, game over should appear, the problem is it doesnt, what scripts do i need to make it show up. Thanks very much this is for school.

Offline

 

#2 2012-07-09 09:03:41

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: game over

instead of is score = 0, use if score < 1


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-07-09 09:10:33

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: game over

^^ Or, you can use

<not<(score) > (0)>>
That's equivalent to checking if the score is less than or equal to 0.

Offline

 

#4 2012-07-09 09:29:42

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: game over

amcerbu wrote:

^^ Or, you can use

<not<(score) > (0)>>
That's equivalent to checking if the score is less than or equal to 0.

If we're going hypothetical  then it could be

<not<(score) > (([tan v] of (0)) * ([sin v] of (90)))>>
OR

<not <(score) > (([log v] of (10))-(1))>>
Overcomplicating is fun.  big_smile

Last edited by zammer990 (2012-07-09 09:29:48)


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#5 2012-07-09 11:23:57

topso
New Scratcher
Registered: 2012-07-09
Posts: 2

Re: game over

graciassss

Offline

 

#6 2012-07-09 11:27:37

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: game over

zammer990 wrote:

amcerbu wrote:

^^ Or, you can use

<not<(score) > (0)>>
That's equivalent to checking if the score is less than or equal to 0.

If we're going hypothetical  then it could be

<not<(score) > (([tan v] of (0)) * ([sin v] of (90)))>>
OR

<not <(score) > (([log v] of (10))-(1))>>
Overcomplicating is fun.  big_smile

Or we could do not(score+e^(pi*i)+1>0).


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#7 2012-07-09 11:43:18

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: game over

The Bessel function is always fun
X^2*(d^2*y/d*x^2) + (x*(dy/dx))+ (x^2 - a^2) * y
AKA 0

Last edited by zammer990 (2012-07-09 11:45:13)


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#8 2012-07-09 11:49:53

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: game over

<not <(([e ^ v] of (((score) + (e)) * ([ln v] of ((pi) * (i))))) + (1)) > (0)>>
Overcomplicated.  big_smile

Last edited by SciTecCf (2012-07-09 11:51:21)


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&amp;display=small

Offline

 

#9 2012-07-09 14:58:13

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: game over

^^ Too bad that Scratch can't represent complex numbers, so your i variable wouldn't work...

My post was actually sort of serious, since !(a < b) is equivalent to a >= b.

Offline

 

#10 2012-07-09 15:20:39

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: game over

amcerbu wrote:

^^ Too bad that Scratch can't represent complex numbers, so your i variable wouldn't work...

My post was actually sort of serious, since !(a < b) is equivalent to a >= b.

Yea, but check with flash blocks, the fewer operator it has to check, the faster it runs, but in this case there wouldn't be much difference


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#11 2012-07-09 15:29:58

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: game over

Yeah.  Usually, I would just use if < 0. 

@i_wills_blabla- Has this topic answered your question?  Does it make sense?

Offline

 

#12 2012-07-09 15:30:25

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: game over

Make a sprite and name it "Game over"
Make it as large as the game area is.

Use this script.

when gf clicked
hide
wait until <(score) < (0)>
show
stop all

Last edited by henley (2012-07-09 15:30:42)


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#13 2012-07-09 18:00:10

Randomness_Player
Scratcher
Registered: 2012-06-06
Posts: 20

Re: game over

henley wrote:

Make a sprite and name it "Game over"
Make it as large as the game area is.

Use this script.

when gf clicked
hide
wait until <(score) < (0)>
show
stop all

A advanced way of doing it is....

when gf clicked
forever // it keeps checking if the score is below 0
if <(score) < (0)>
show
stop all
else
hide
end

Last edited by Randomness_Player (2012-07-09 18:02:05)

Offline

 

#14 2012-07-10 08:38:24

i_wills_blabla
New Scratcher
Registered: 2012-07-05
Posts: 11

Re: game over

thanks it works nowxxx

Offline

 

#15 2012-07-10 13:00:31

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: game over

If you want this topic to be closed (because I assume you've found a solution to your problem), press the "Report" button at the bottom of one of the posts and write in the box that you'd like it to be.

Offline

 

Board footer