I am making a fighting game where one of the attacks is a spread of snowflakes fired from the character. The code is as follows (this is the snowflakes code):
when snowflake is tapped: {
repeat 3 times: (
create a clone
)
}
when object is cloned:{
set position x: (enemy’s x - 75) y: (enemy’s y)
set angle: (random from 150 to 210)
move forward: (1000)
set invisibility: (100)
This works fine the first time, but when I do it again, it makes a lot more clones than the first time. Then, the next and next time, it makes EVEN MORE clones, and makes my iPad really slow. Is there a way for me to streamline or modify my code to fix this? Please reply!
Here is a photo of the code: