LaserTile

1 view
Skip to first unread message

Aaron Caldwell

unread,
Apr 26, 2011, 8:04:04 PM4/26/11
to CS251-spr2011
I am not quite sure of the LaserTile and RobotLaser events. I do know
that I want the laser to traverse the board as long as it does not
come into contact with an object tile or a occupied tile. I was
thinking of keeping the laser's current location and moving it in the
direction that the robot is facing till the laser does come into
contact with an object or other robot.

Any help would be greatly appreciated.

Joseph Collard

unread,
Apr 26, 2011, 9:20:59 PM4/26/11
to cs251-...@googlegroups.com
You are correct to abstract these into a single class rather than
program it twice. You are also correct as to what you want to do. Now...
how do you do it?

We have provided many classes to help you with this. Take a look at what
we've provided. Some methods that will help:

AbstractTile.getBoard();
Board.getWidth();
Board.getHeight();
AbstractTile.isOccupied();
AbstractTile.getRobot();
AbstractTile.getLocation();
BasicRobot.takeDamage();
BasicRobot.destroy();

I hope this helps!

Joe

Reply all
Reply to author
Forward
0 new messages