GameGrid: Game programming with Java

Research project PHBern  
HomePrintJava-Online

Exercise 12: Remote control (NXT Robot Simulation)

A NXT-Robot with a light sensor (Slave) is moving under remote control. The master uses the cursor keys(Forward, Backward, Left, Right) to control the slave. These commands are transmitted via tcp to the slave.

 



 
Start

 

Goal


Download RoadFollower_0.zip

Control:
  • Master.java
  • NxtActor.java
Robot:
  • Slave.java
  • Rover.java
  • SimRover.java

As a template you can use the file TcpMaster.java

Edit TcpMaster.java in the Online-Editor

This should compile. During execution, however, it is missing the real NXT Robot. Replace this with a simulated NXT by changing the the package to ch.aplu.nxtsim in the files Rover.java by SimRover.java. Everything else should stay the same.

Use SimRover.java as template.

Tutorials and examples of TCPGame programming can be found at www.aplu.ch/jgamegrid.