Skip to content
Snippets Groups Projects
Commit e95b7386 authored by tjsus's avatar tjsus
Browse files

Assignment 3 code modified to add comment PDU to update player 1 and player 2 grids.

parent 82dab9f7
No related branches found
No related tags found
No related merge requests found
......@@ -213,10 +213,10 @@ public class ExampleSimulationProgram {
fireLoc.setY(y);
fireLoc.setZ(0.0);
firePdu.setLocationInWorldCoordinates(fireLoc);
firePdu.setDescriptor(munitionDescriptor1);
firePdu.setRange(100.0f);
firePdu.setDescriptor(munitionDescriptor1); // Not needed I guess
firePdu.setRange(100.0f);// Not needed I gueess
// Log the firing action
// Print the firing action
System.out.println(player + " fires at (" + x + ", " + y + ").");
// Determine hit or miss and update the game grid
......@@ -232,7 +232,7 @@ public class ExampleSimulationProgram {
System.out.println(player + " fires at (" + x + ", " + y + ") but it's already hit/missed.");
}
// Send the enriched FirePdu to reflect the shot
// Send the FirePdu to represent the shot
disChannel.sendSinglePdu(simulationTimeSeconds, firePdu);
// Send the updated grid status of both players
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment