Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to stop clone freezing?
- SuperGamerGG2
- Scratcher
69 posts
How to stop clone freezing?
Hey guys, I'm working on a project, but when the player runs into the Clone Candy, the candy freezes.
Heres the code I'm using:
Heres the code I'm using:
when I start as a clone
repeat until <touching color [#color] ?>
change y by (-5)
end
if <touching color [#color] ?> then
go to [bucket v]
repeat (10)
change size by (-10)
delete this clone
end
end
Hi! I'm SuperGamerGG2. Click on the links below!
My Profile | Define Scratch | My BFB Camp Team | Game
- SuperGamerGG2
- Scratcher
69 posts
How to stop clone freezing?
It might not be the exact same code, but I still need help!
https://scratch.mit.edu/projects/986342505/
My browser / operating system: ChromeOS 14541.0.0, Chrome 118.0.0.0, No Flash version detected
https://scratch.mit.edu/projects/986342505/
My browser / operating system: ChromeOS 14541.0.0, Chrome 118.0.0.0, No Flash version detected
Hi! I'm SuperGamerGG2. Click on the links below!
My Profile | Define Scratch | My BFB Camp Team | Game
- -effortIess-
- Scratcher
100+ posts
How to stop clone freezing?
Instead of
when I start as a cloneUse
repeat until <touching color [#color] ?>
change y by (-5)
end
if <touching color [#color] ?> then
go to [bucket v]
repeat (10)
change size by (-10)
delete this clone
end
end
when I start as a clone
repeat until <touching color [#color] ?>
change y by (-5)
end
go to [bucket v]
repeat (10)
change size by (-10)
delete this clone
end
✊ Support the suggestion HERE by adding this button to your signature ✊
BAN PI DAY!!! (joke)
100th post
- SuperGamerGG2
- Scratcher
69 posts
How to stop clone freezing?
Ok, i tried that, but now it glides to the bucket and freezes. any ideas? Instead ofwhen I start as a cloneUse
repeat until <touching color [#color] ?>
change y by (-5)
end
if <touching color [#color] ?> then
go to [bucket v]
repeat (10)
change size by (-10)
delete this clone
end
endwhen I start as a clone
repeat until <touching color [#color] ?>
change y by (-5)
end
go to [bucket v]
repeat (10)
change size by (-10)
delete this clone
end
Hi! I'm SuperGamerGG2. Click on the links below!
My Profile | Define Scratch | My BFB Camp Team | Game
- SuperGamerGG2
- Scratcher
69 posts
How to stop clone freezing?
Hey, anybody got any fixes?
Hi! I'm SuperGamerGG2. Click on the links below!
My Profile | Define Scratch | My BFB Camp Team | Game
- SuperGamerGG2
- Scratcher
69 posts
How to stop clone freezing?
it is shared If you want a proper answer then you need to share your project so that people aren't guessing at what other factors may be involved
Hi! I'm SuperGamerGG2. Click on the links below!
My Profile | Define Scratch | My BFB Camp Team | Game
- deck26
- Scratcher
1000+ posts
How to stop clone freezing?
You only delete the clone if it was touching the colour at the top of the bucket. So if the candy hits the side of the bucket it stops moving but never sees the code to delete itself.
- RokCoder
- Scratcher
1000+ posts
How to stop clone freezing?
Sorry - I missed that comment when I looked through before.it is shared If you want a proper answer then you need to share your project so that people aren't guessing at what other factors may be involved
when I start as a clone
repeat until <touching color [#2c826f] ?>
change y by (-5)
turn cw (5) degrees
end
set [_index v] to (1) // _index is a "for this sprite only" variable
repeat (5)
change x by (((([x position v] of [bucket v]) - (x position)) / (5)) * (_index))
change y by (-5)
turn cw (5) degrees
change size by (-10)
change [index v] by (1)
end
hide
change [Candy: v] by (1)
change [clones v] by (-1)
delete this clone
- SpyCoderX
- Scratcher
100+ posts
How to stop clone freezing?
In other words, the “if touching color <brown>” shouldn't be there. You only delete the clone if it was touching the colour at the top of the bucket. So if the candy hits the side of the bucket it stops moving but never sees the code to delete itself.
I rewrote a few things to make it better:
when I start as a clone
repeat until <<touching [Bukkit v]?>or<(y position) < (-170)>> //Move down until you hit the bukkit or the ground
change y by (-5)
turn cw (5) degrees
end
if <touching [Bukkit v]> then //If you hit the bukkit then do the bukkit stuff
glide (0.2) secs to [Bukkit v] ::motion
repeat (5)
change size by (-10)
end
change [Candy: v] by (1)
end
change [clones v] by (-1) //In any case, you hit something so you should delete this clone.
delete this clone
New game! (link)
Have a good day/night!
\(-_-) ::#00AAAA //This is crypto. He protects my signature from the evil kumquats!Programming is a very powerful skill. As are critical thinking and hard work.
- SpyCoderX
- SuperGamerGG2
- Scratcher
69 posts
How to stop clone freezing?
ok. but i dont want the candy going in when it touches the sides.In other words, the “if touching color <brown>” shouldn't be there. You only delete the clone if it was touching the colour at the top of the bucket. So if the candy hits the side of the bucket it stops moving but never sees the code to delete itself.
I rewrote a few things to make it better:when I start as a clone
repeat until <<touching [Bukkit v]?>or<(y position) < (-170)>> //Move down until you hit the bukkit or the ground
change y by (-5)
turn cw (5) degrees
end
if <touching [Bukkit v]> then //If you hit the bukkit then do the bukkit stuff
glide (0.2) secs to [Bukkit v] ::motion
repeat (5)
change size by (-10)
end
change [Candy: v] by (1)
end
change [clones v] by (-1) //In any case, you hit something so you should delete this clone.
delete this clone
Hi! I'm SuperGamerGG2. Click on the links below!
My Profile | Define Scratch | My BFB Camp Team | Game
- SuperGamerGG2
- Scratcher
69 posts
How to stop clone freezing?
ok i fixed it ! i just needed to delete the clone for both if's
Hi! I'm SuperGamerGG2. Click on the links below!
My Profile | Define Scratch | My BFB Camp Team | Game
- SuperGamerGG2
- Scratcher
69 posts
How to stop clone freezing?
when [ code fixed v]
say [Topic] for (2) secs
say [Closed!] for (2) secs
close topic with smile
Hi! I'm SuperGamerGG2. Click on the links below!
My Profile | Define Scratch | My BFB Camp Team | Game
- SuperGamerGG2
- Scratcher
69 posts
How to stop clone freezing?
yes So is it fixed now?
Hi! I'm SuperGamerGG2. Click on the links below!
My Profile | Define Scratch | My BFB Camp Team | Game
- Discussion Forums
- » Help with Scripts
- » How to stop clone freezing?