02.15.09
More Programming
Julian is going to fire me from the Ramparts game we are working on, but I did a side project this weekend as well as our game.
I made a Robot fighting game. How it works – you make a file that has your robot’s commands and then it will fight other programmed robots until you lose 10 health. I made it in C# using the microsoft XNA framework, so in order to play it you would need to have XNA installed on your computer. If you would like the source code or the compiled game let me know and I’ll send it to you. If you want your robots to fight against mine send me your instructions text file.
Your file has to be in this format each command has it’s own line and after your main commands you need an IF_HIT line followed by the commands if your robot gets shot, followed by IF_COLLIDE for what it should do if it collides with another robot.
all of the commands available are
MOVE # ( if number is 0 it will move to the opposite wall, else it will move that amount)
ROTATE # ( will rotate the robot that # of degrees)
ROTATE RANDOM (will rotate to a random degree)
SCAN (will scan for a robot)
FIRE (Fires your cannon in the current direction of the gun)
SET_ROBOT_TO_GUN (will turn your robot to match the current gun angle)
SET_GUN_TO_ROBOT (will turn your gun to match the current direction of your robot)
here is an example
ROTATE -90
MOVE 100
SCAN
FIRE
IF_HIT
MOVE 0
IF_COLLIDE
ROTATE 90
MOVE 100
