Objective: Understand how the flow of control allows for the interaction between different sprites. Furthermore, this will strengthen student's understanding of both direction and cloning.
Screenshots from various tower defense games. |
This tutorial modifies this structure by creating a target that neither moves nor interacts with the user. Rather, this game simply tests "aim" towards a static structure. You can see more of the logistics within the video sample of the completed project below.
Final Product:
Graphic Template: Please find the necessary costumes/backgrounds in this project. Hit the "remix" button to move this to your personal account (the projects are named "precision shot").
Scripts:
Place these sequences within the "Turrent" sprite
Script to connect the "turrent" the mouse and provide "turrent" functionality to the user. |
Place these sequences within the "shot" sprite
Sprite script to execute "turrent" functionality utilizing cloning (primarily). |
Place these sequences within the "target" sprite
Sprite to execute "target" random movement and functionality. |
Consider: At the end of my video, the "target" sprite become to small to hit. How would I change the movement of the sprite towards my target (i.e. the "shot") in order to avoid this from happening in the future? During the second half of my video, I just started moving the cursor onto the target (kind of removing the necessity of having any skill). What code would you add in order to make sure that the person could only change the direction of the turrent within a limited (circular) radius around the turrent?
Wrap Up: This lesson focused on the interaction between sprites and clones to create a simpler version of more famous tower defense games. If you wish to continue with this concept, see what other game elements you can build into the project.
Completed Project: Attached is the final version of the project.
https://musiclab.chromeexperiments.com/Song-Maker/song/5822647826907136
ReplyDeleteThanks Can I export the shot sprite to my project
ReplyDeleteI cannot make it i only need it
MY scratch Id AssassinMeghansh
ReplyDeleteI do not how to make it
ReplyDeleteI will take it only
how can i make this game in scrath 1.4
ReplyDeleteu can :.:
Deletevv
ReplyDelete