This project is to help people program a tank for my project A.I. Tank Battle https://scratch.mit.edu/projects/66346102/ The idea is to program a tank using the custom blocks that are already in the game to produce a tank that will destroy the other tanks before they destroy you! Inside the game is a sprite called “Remix This” which contains all the scripts that make the tank work (which should not be modified) as well as instructions on which Scratch blocks can be used and how the custom blocks work. You’ll find a Custom hat block called “Your Program Here”, this is where your program will go. Your AI should ideally allow your tank to find another tank and destroy it whilst at the same time avoid being destroyed by the other tanks. To locate other tanks you can use radar or just shoot until you hit something. Lots of tanks shoot and then turn a few degrees if they miss, in order to cover the entire playing area but there are other ways. To avoid being destroyed you can monitor your health and move if it’s going down. Most programs begin with some sort of start sequence followed by a script in a forever loop. Start Sequence: at the start the tanks are put in their start positions according to the number they have been given (variable NUMBER) 1 at the top, 2 is right, 3 bottom and 4 is left. All facing outward. You can tell where you are (by looking at your NUMBER) and, as the start positions are always the same, you know where the other tanks are. Some tanks take advantage of this by quickly targeting these positions in the hope the other tanks haven’t moved, therefore it can be a good idea to move away from your start position. Main Loop: after the start sequence you need a main loop that will keep your tank searching for other tanks, firing at them once they have been found and avoiding being destroyed! see inside Tank 1 - 4 for handy hints on programming your own Tank.
help for @npere and anyone else who needs it. :)