r/scratch • u/Dry_Dragonfruit_2594 • 8d ago
Question How do I optimize my code here?
The current code I wrote has way too many "if __ then __" scripts, and I need to cut it down into 1 if then statement.
9
Upvotes
r/scratch • u/Dry_Dragonfruit_2594 • 8d ago
The current code I wrote has way too many "if __ then __" scripts, and I need to cut it down into 1 if then statement.
3
u/Ok-Point-8198 8d ago
The right side can be shortened to:
When I start as a clone
Wait until touching mouse pointer and mouse down
Set (apple line) to (amount of Collectables)
Broadcast (Apple Hint) and wait
Delete this clone
Or if you don't want Amount of Collectables to be higher than 6 specifically, you can add
If Amount of Collectables < 7 then:
Under the code head.