Discuss Scratch

jh_2003
New to Scratch
10 posts

how to let my shark to stop eating after eating exactly one fish?

rules:
1)when green flag is pressed, type how many balls you want to be in the game and target you want to eat,then fish starts swimming without other action(swim=0)
2)when space is pressed, the fish starts moving following mouse cursor and eating balls. (i know that sounds weird) (swim=0,touch=1)
3)when score=target , stop eating and go back swimming as (1) without other action
4)when space is pressed agn, start what is done in 2 until no. of ball=0.

my question is : how to let my shark to stop eating after eating exactly one fish?i set a variable “touch” to make sure fish stop eating after eating one ball (when touches fish, touch=0, wait until sprite not touching the ball,set touch to 1)but it doesn't work if it touches a bunch of balls together when the no of ball i set at the beginning is large(let's say 100).

here's the link to my project: Your text to link here…
griefercube
Scratcher
500+ posts

how to let my shark to stop eating after eating exactly one fish?

Dupe of this


sometimes, you just have to change a way of thinking to solve a problem. -griefercube
|other projectshow I made the banneranimated thumbnails?i’m on wiki!Cubey Mines|

Last edited by griefercube (32th Undecimber, XXXX)


https://turbowarp.org/563693837/editor (something i did a while back don’t worry it’s for the banner)

list of working bbcodes:

[color=]
[scratchblocks]
[url=]
[img]
[center]
[code]
[code=]
[list]
[quote]
[b]
[i]
[u]
[s]
[big]
[small]
[p]
[wiki]
[google]

Powered by DjangoBB