Sit back and watch as two armies of brave (if unintelligent) warrior-bots engage in a cutthroat game of laser tag! Who will win—Team Red or Team Blue? Here are the basic rules our competitors must follow: - The object is to eliminate all players of the opposing team. - To eliminate a player, the players must fire their laser toward it. - A player can only fire its laser when it is less than 100 pixels away from an opponent - If a player touches an eliminated teammate, the latter will be able to move around again. - The last team standing wins!
ABOUT Just a quick project I made for myself—mostly the fruits of boredom. I mostly use Python now since it’s more efficient and versatile than Scratch, but sometimes I still fire up the Scratch editor if I feel like whipping up a quick something. This one actually turned out pretty well and is pretty interesting to watch, so I thought I would share it. Don’t expect to see many more projects from me, though. :) =============== HOW DOES IT WORK? The characters were rendered using the “stamp” block since I was afraid clones would be too laggy. See my “1000 Clones” project for more on this. Basically, all of the attributes of the character, such as their position, direction, and current state are stored in lists. The program is continuously erasing the canvas and redrawing all of the characters, updating the lists each time. The characters’ actions are completely random. The list called “status” stores each character’s current task. They can either move forward, turn left, turn right, attack an enemy (if they are close enough), or revive a comrade (if they are close enough). The players carry out their action over 10 frames. After 10 frames, they randomly select a new action. If they are able, a character is significantly more likely to attack than to perform any other action. ======================================== KNOWN BUGS: So far, the only bug I’ve encountered is that sometimes, the laser won’t show up. These occurrences are fairly rare and don’t really affect the enjoyability of the project, I think. ===== Please feel free to remix and make your own changes! I didn’t really put much effort into making the code readable, but you may still have some fun tweaking things. ;)