ScratchData LogoScratchData
Back to PaulSinnett's profile

Robot Rumble (Student AI)

PAPaulSinnett•Created December 10, 2013
Robot Rumble (Student AI)
1
0
124 views
View on Scratch

Instructions

An A.I. robot fighting game. Remix and add your own A.I. robot controllers to win the battle! Adding in student created A.I.

Description

To create an A.I. start by duplicating the Null A.I. You must give your A.I. a unique name, by setting its "name" variable, or the game will break. To program your A.I. you need to set three variables: D1, D2, and M. You need to do this in response to the "take turn" message. The Null A.I. script has all three set to blank. D1 and D2 are direction registers for your robot. Set them to: N, NE, E, SE, S, SW, W, or NW. M is the move register: M move in direction D1 MM move in direction D1 then D2 MA move in direction D1 then attack in direction D2 AM attack in direction D1 then move in direction D2 A attack in direction D1 Look at the other A.I. provided to see how to program different behaviours. In figuring out the moves to make, you can use the following lists and variables: roster: list of all the A.I. in the game x positions: list of the x positions (1 to grid width) of each A.I. y positions: list of the y positions (1 to grid height) of each A.I. hit points: list of the hit points of each A.I. turn: number of the A.I. whose turn it is You can use as many "for this sprite only" variables and lists as you like in choosing your moves. But don't set D1, D2, or M when it's not your turn or the game will break.

Project Details

Project ID15276172
CreatedDecember 10, 2013
Last ModifiedDecember 10, 2013
SharedDecember 10, 2013
Visibilityvisible
CommentsAllowed