Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » AHHHHHH
- anunkownscratcher_
-
Scratcher
8 posts
AHHHHHH
Im trying to make a t.d. game I need code to place them down with clones from the shop sprite to clone a turret sprite clone on it
- ThreeLived
-
Scratcher
100+ posts
AHHHHHH
Your wording is a little confusing, but im going to assume you want to be able to click a shop button to create a turret clone.
You could set a variable called ‘CREATE’ and have it set to nothing while nothings being created, and have it be set to ‘{turret type name}’ when placing down a turret. When the turret sprite sees that CREATE isnt set to nothing,
it will create a transparent overlay above the mouse's position of that turret type, and when the mouse is down (make sure to give it a delay that way it doesnt immediately place it when you click it in the shop) it will actually place it at the mouse's position (unless its in a spot where it cannot be placed)
by the way, dont forget to use a join block when setting the costume to CREATE. You also need it to be named exactly right.
You could set a variable called ‘CREATE’ and have it set to nothing while nothings being created, and have it be set to ‘{turret type name}’ when placing down a turret. When the turret sprite sees that CREATE isnt set to nothing,
<not <(CREATE) = []>>
it will create a transparent overlay above the mouse's position of that turret type, and when the mouse is down (make sure to give it a delay that way it doesnt immediately place it when you click it in the shop) it will actually place it at the mouse's position (unless its in a spot where it cannot be placed)
by the way, dont forget to use a join block when setting the costume to CREATE. You also need it to be named exactly right.
switch costume to (join (CREATE) [])
- Discussion Forums
- » Help with Scripts
-
» AHHHHHH