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

#1 2012-01-04 14:54:13

engaines
New Scratcher
Registered: 2011-05-20
Posts: 5

help needed for a fishy game please

Hello,

I want to be able to make some games where a sprite has to collect a number of objects while avoiding being caught.

I am fairly new to scratch so it will need to be quite simple.

For example, in a game where a fish has to eat 10 pieces of seaweed while avoiding being eaten by the shark, I can make the fish follow the mouse. I can make the shark follow the fish and send it back to a starting point if it catches it. I can make the seaweed wobble around in the water.

Here's what I want to be able to do:

Make the seaweed disappear when the fish passes over it.
Make a "well done" message appear when all seaweed has been eaten.
Make the fish lose a life if the shark gets him.
Make a "game over" appear if the fish loses all his lives.

Any help you can offer a novice would be much appreciated.

Many thanks
Richard

Offline

 

#2 2012-01-04 15:55:47

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: help needed for a fishy game please

The seaweed needs this script:

When [green-flag] pressed
Forever{
If <touching fish>{
hide
}
}

I may post some more later and welcome to scratch  big_smile  I hope you enjoy it  smile


EDIT: also, if you can, please could you upload your project it makes it much easier to suggest scripts  wink

Last edited by TRocket (2012-01-04 15:58:44)


http://i.imgur.com/1QqnHxQ.png

Offline

 

#3 2012-01-04 16:01:41

engaines
New Scratcher
Registered: 2011-05-20
Posts: 5

Re: help needed for a fishy game please

thanks for that. Didn't know about hide. Please post more. I'll have a go at posting project. Not sure how but I'll try. Thanks again

Offline

 

#4 2012-01-04 16:24:09

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: help needed for a fishy game please

hide seeweed:

Code:

[When Flag Clicked]
[Wait until <touching fish>]
[hide]
[change [# of seaweed] by (-1)]

"well done" script goes in "well done" sprite (the one with the "well done" costume that will appear):

Code:

[When Flag Clicked]
[hide]
[set [# of seaweed] to (number of seaweed you want)]
[Wait until <# of seaweed == 0>]
[show]

Alternatively, instead of show/hide, you could just put this in the background and tell it to change to a "well done" costume.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2012-01-04 16:32:32

engaines
New Scratcher
Registered: 2011-05-20
Posts: 5

Re: help needed for a fishy game please

Great. Thank you. You've both given me nice simple codes to work on. Many thanks.

Offline

 

#6 2012-01-05 01:21:26

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: help needed for a fishy game please

To make the fish follow the mouse, you can follow this tutorial. I recommend using the Following the Mouse Indefinitely scripts, as this seems what you want.  smile

Offline

 

#7 2012-01-05 01:59:09

engaines
New Scratcher
Registered: 2011-05-20
Posts: 5

Re: help needed for a fishy game please

Thank you. Useful tutorial.

Offline

 

#8 2012-01-05 16:37:55

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: help needed for a fishy game please

Make the fish lose a life if the shark gets him.

Code:

[forever if <touching [shark]>]
[{]
     [change [lives] by (-1)]
     [go to x:(0) y:(0)]     // wherever you want the fish to re
[}]

Make a "game over" appear if the fish loses all his lives.

Code:

[When Green Flag pressed]
[set [lives] to (total number of lives)]
[wait until <lives == 0>]
[switch to costume [Game Over]]     // or [broadcast [Game Over]]

http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#9 2012-01-07 06:39:28

engaines
New Scratcher
Registered: 2011-05-20
Posts: 5

Re: help needed for a fishy game please

Thanks again. Game coming together nicely with your help.

Offline

 

Board footer