mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Fixed Boats powering up and down correctly. Icons respond correctly
#story[1293]
This commit is contained in:
@@ -78,8 +78,8 @@ public class GameState implements Runnable {
|
|||||||
private static final Double COLLISION_VELOCITY_PENALTY = 0.3;
|
private static final Double COLLISION_VELOCITY_PENALTY = 0.3;
|
||||||
|
|
||||||
//Powerup Constants
|
//Powerup Constants
|
||||||
private static final Integer VELOCITY_BOOST_MULTIPLIER = 2;
|
public static final Integer VELOCITY_BOOST_MULTIPLIER = 2;
|
||||||
private static final Integer HANDLING_BOOST_MULTIPLIER = 2;
|
public static final Integer HANDLING_BOOST_MULTIPLIER = 2;
|
||||||
public static final Long BUMPER_DISABLE_TIME = 5_000L;
|
public static final Long BUMPER_DISABLE_TIME = 5_000L;
|
||||||
private static final Long TOKEN_SPAWN_TIME = 15_000L;
|
private static final Long TOKEN_SPAWN_TIME = 15_000L;
|
||||||
|
|
||||||
@@ -550,20 +550,6 @@ public class GameState implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TokenType tokenType = collidedToken.getTokenType();
|
TokenType tokenType = collidedToken.getTokenType();
|
||||||
switch (tokenType) {
|
|
||||||
case BOOST:
|
|
||||||
yacht.setPowerUpSpeedMultiplier(VELOCITY_BOOST_MULTIPLIER);
|
|
||||||
break;
|
|
||||||
case BUMPER:
|
|
||||||
// TODO: 22/09/17 wmu16
|
|
||||||
break;
|
|
||||||
case HANDLING:
|
|
||||||
yacht.setPowerUpHandlingMultiplier(HANDLING_BOOST_MULTIPLIER);
|
|
||||||
break;
|
|
||||||
case WIND_WALKER:
|
|
||||||
// TODO: 22/09/17 wmu16
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
yacht.powerUp(tokenType);
|
yacht.powerUp(tokenType);
|
||||||
|
|
||||||
String logMessage =
|
String logMessage =
|
||||||
|
|||||||
@@ -112,11 +112,29 @@ public class ServerYacht {
|
|||||||
location = geoPoint;
|
location = geoPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Powers up a yacht with a given yacht, only after powering it down first to avoid double power
|
||||||
|
* ups
|
||||||
|
*
|
||||||
|
* @param powerUp The given power up
|
||||||
|
*/
|
||||||
public void powerUp(TokenType powerUp) {
|
public void powerUp(TokenType powerUp) {
|
||||||
|
powerDown();
|
||||||
|
switch (powerUp) {
|
||||||
|
case BOOST:
|
||||||
|
powerUpSpeedMultiplier = GameState.VELOCITY_BOOST_MULTIPLIER;
|
||||||
|
break;
|
||||||
|
case HANDLING:
|
||||||
|
powerUpHandlingMultiplier = GameState.HANDLING_BOOST_MULTIPLIER;
|
||||||
|
break;
|
||||||
|
}
|
||||||
this.powerUp = powerUp;
|
this.powerUp = powerUp;
|
||||||
powerUpStartTime = System.currentTimeMillis();
|
powerUpStartTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Powers down a yacht, returning its power multipliers back to 1
|
||||||
|
*/
|
||||||
public void powerDown() {
|
public void powerDown() {
|
||||||
this.powerUp = null;
|
this.powerUp = null;
|
||||||
this.powerUpSpeedMultiplier = 1;
|
this.powerUpSpeedMultiplier = 1;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ import seng302.model.RaceState;
|
|||||||
import seng302.model.mark.CompoundMark;
|
import seng302.model.mark.CompoundMark;
|
||||||
import seng302.model.mark.Mark;
|
import seng302.model.mark.Mark;
|
||||||
import seng302.model.stream.xml.parser.RaceXMLData;
|
import seng302.model.stream.xml.parser.RaceXMLData;
|
||||||
|
import seng302.model.token.Token;
|
||||||
import seng302.model.token.TokenType;
|
import seng302.model.token.TokenType;
|
||||||
import seng302.utilities.Sounds;
|
import seng302.utilities.Sounds;
|
||||||
import seng302.visualiser.GameView3D;
|
import seng302.visualiser.GameView3D;
|
||||||
@@ -307,6 +308,9 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
*/
|
*/
|
||||||
private void displayPowerUpIcon(ClientYacht yacht, TokenType tokenType) {
|
private void displayPowerUpIcon(ClientYacht yacht, TokenType tokenType) {
|
||||||
if (yacht == player) {
|
if (yacht == player) {
|
||||||
|
if (iconToDisplay != null) {
|
||||||
|
iconToDisplay.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
switch (tokenType) {
|
switch (tokenType) {
|
||||||
case BOOST:
|
case BOOST:
|
||||||
@@ -349,6 +353,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
if (yacht == player) {
|
if (yacht == player) {
|
||||||
blinkingTimer.cancel();
|
blinkingTimer.cancel();
|
||||||
iconToDisplay.setVisible(false);
|
iconToDisplay.setVisible(false);
|
||||||
|
iconToDisplay = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
<author>Blender User</author>
|
<author>Blender User</author>
|
||||||
<authoring_tool>Blender 2.78.0 commit date:2016-09-26, commit time:12:42, hash:4bb1e22</authoring_tool>
|
<authoring_tool>Blender 2.78.0 commit date:2016-09-26, commit time:12:42, hash:4bb1e22</authoring_tool>
|
||||||
</contributor>
|
</contributor>
|
||||||
<created>2017-09-19T15:45:46</created>
|
<created>2017-09-26T19:13:35</created>
|
||||||
<modified>2017-09-19T15:45:46</modified>
|
<modified>2017-09-26T19:13:35</modified>
|
||||||
<unit name="meter" meter="1"/>
|
<unit name="meter" meter="1"/>
|
||||||
<up_axis>Z_UP</up_axis>
|
<up_axis>Z_UP</up_axis>
|
||||||
</asset>
|
</asset>
|
||||||
@@ -23,10 +23,10 @@
|
|||||||
<color sid="ambient">0 0 0 1</color>
|
<color sid="ambient">0 0 0 1</color>
|
||||||
</ambient>
|
</ambient>
|
||||||
<diffuse>
|
<diffuse>
|
||||||
<color sid="diffuse">0.004555753 0.0885511 0.003947978 1</color>
|
<color sid="diffuse">0.01630632 0.52949 0.0134405 1</color>
|
||||||
</diffuse>
|
</diffuse>
|
||||||
<specular>
|
<specular>
|
||||||
<color sid="specular">0.25 0.25 0.25 1</color>
|
<color sid="specular">0.125 0.125 0.125 1</color>
|
||||||
</specular>
|
</specular>
|
||||||
<shininess>
|
<shininess>
|
||||||
<float sid="shininess">50</float>
|
<float sid="shininess">50</float>
|
||||||
@@ -49,10 +49,10 @@
|
|||||||
<color sid="ambient">0 0 0 1</color>
|
<color sid="ambient">0 0 0 1</color>
|
||||||
</ambient>
|
</ambient>
|
||||||
<diffuse>
|
<diffuse>
|
||||||
<color sid="diffuse">0.64 0.1458963 0.001825521 1</color>
|
<color sid="diffuse">0.64 0.5334254 0 1</color>
|
||||||
</diffuse>
|
</diffuse>
|
||||||
<specular>
|
<specular>
|
||||||
<color sid="specular">0.25 0.25 0.25 1</color>
|
<color sid="specular">0.125 0.125 0.125 1</color>
|
||||||
</specular>
|
</specular>
|
||||||
<shininess>
|
<shininess>
|
||||||
<float sid="shininess">50</float>
|
<float sid="shininess">50</float>
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
</technique_common>
|
</technique_common>
|
||||||
</source>
|
</source>
|
||||||
<source id="Icosphere_001-mesh-normals">
|
<source id="Icosphere_001-mesh-normals">
|
||||||
<float_array id="Icosphere_001-mesh-normals-array" count="240">0.7002241 -0.2680317 -0.6616988 0.9049891 -0.2680316 -0.3303847 0.02474653 -0.9435215 -0.330386 -0.8896973 -0.3150947 -0.3303849 -0.5746018 0.7487837 -0.3303875 0.5345759 0.7778646 -0.3303867 0.4089462 -0.6284253 0.6616985 -0.4712997 -0.5831224 0.6616985 -0.7002241 0.2680317 0.6616988 0.03853034 0.7487788 0.6616991 0.7240421 0.1947362 0.6616954 0.4911195 0.356821 0.7946575 0.4089463 0.6284252 0.6616985 -0.1875942 0.5773453 0.7946577 -0.4712997 0.5831224 0.6616985 -0.6070605 0 0.7946557 -0.7002241 -0.2680318 0.6616988 -0.1875942 -0.5773453 0.7946577 0.03853034 -0.7487788 0.6616991 0.4911194 -0.356821 0.7946576 0.7240421 -0.1947363 0.6616954 0.8896973 0.3150946 0.3303849 0.7946556 0.5773479 0.1875951 0.5746018 0.7487836 0.3303875 -0.02474653 0.9435214 0.3303861 -0.3035309 0.9341714 0.1875976 -0.5345759 0.7778646 0.3303867 -0.9049891 0.2680316 0.3303846 -0.9822458 0 0.1875985 -0.9049891 -0.2680316 0.3303846 -0.5345759 -0.7778646 0.3303867 -0.3035309 -0.9341714 0.1875975 -0.02474653 -0.9435214 0.3303861 0.5746018 -0.7487836 0.3303875 0.7946556 -0.5773479 0.1875951 0.8896973 -0.3150946 0.3303849 0.3035309 0.9341714 -0.1875975 0.02474653 0.9435215 -0.330386 -0.7946556 0.5773479 -0.1875951 -0.8896973 0.3150945 -0.3303849 -0.7946556 -0.5773479 -0.1875951 -0.5746018 -0.7487836 -0.3303875 0.3035309 -0.9341714 -0.1875976 0.5345759 -0.7778645 -0.3303867 0.9822458 0 -0.1875985 0.9049891 0.2680316 -0.3303847 0.4712997 0.5831224 -0.6616986 0.1875942 0.5773453 -0.7946577 -0.0385304 0.7487788 -0.6616991 -0.4089462 0.6284252 -0.6616984 -0.4911194 0.356821 -0.7946576 -0.7240421 0.1947362 -0.6616954 -0.7240421 -0.1947362 -0.6616954 -0.4911195 -0.356821 -0.7946575 -0.4089462 -0.6284252 -0.6616984 0.7002241 0.2680318 -0.6616988 0.6070605 0 -0.7946556 -0.0385304 -0.7487788 -0.6616991 0.1875942 -0.5773453 -0.7946577 0.4712997 -0.5831224 -0.6616986 0.1023808 -0.3150898 -0.9435235 -0.2680341 -0.1947365 -0.9435229 -0.2680341 0.1947365 -0.9435229 0.1023808 0.3150898 -0.9435235 0.802609 -0.5831265 -0.1256273 -0.306569 -0.9435216 -0.1256289 -0.9920774 0 -0.1256284 -0.306569 0.9435216 -0.1256289 0.802609 0.5831265 -0.1256273 0.2680341 0.1947365 0.9435229 -0.1023808 0.3150899 0.9435235 -0.3313045 0 0.943524 -0.1023808 -0.3150898 0.9435235 0.2680341 -0.1947365 0.9435229 0.306569 0.9435216 0.1256289 -0.802609 0.5831265 0.1256274 -0.802609 -0.5831265 0.1256274 0.306569 -0.9435216 0.1256289 0.9920774 0 0.1256284 0.3313045 0 -0.943524</float_array>
|
<float_array id="Icosphere_001-mesh-normals-array" count="240">0.7002241 -0.2680317 -0.6616988 0.9049891 -0.2680316 -0.3303847 0.02474653 -0.9435215 -0.330386 -0.8896973 -0.3150947 -0.3303849 -0.5746018 0.7487837 -0.3303875 0.5345759 0.7778646 -0.3303867 0.4089462 -0.6284252 0.6616985 -0.4712997 -0.5831224 0.6616985 -0.7002241 0.2680317 0.6616988 0.03853034 0.7487788 0.6616992 0.7240421 0.1947362 0.6616954 0.4911194 0.356821 0.7946576 0.4089462 0.6284253 0.6616984 -0.1875943 0.5773454 0.7946577 -0.4712997 0.5831224 0.6616985 -0.6070605 0 0.7946557 -0.7002241 -0.2680318 0.6616988 -0.1875943 -0.5773454 0.7946577 0.03853034 -0.7487788 0.6616992 0.4911193 -0.356821 0.7946577 0.7240421 -0.1947363 0.6616954 0.8896973 0.3150946 0.3303849 0.7946556 0.5773479 0.1875951 0.5746018 0.7487836 0.3303875 -0.02474653 0.9435214 0.3303861 -0.3035309 0.9341714 0.1875976 -0.5345759 0.7778646 0.3303867 -0.9049891 0.2680316 0.3303846 -0.9822458 0 0.1875985 -0.9049891 -0.2680316 0.3303846 -0.5345759 -0.7778646 0.3303867 -0.3035309 -0.9341714 0.1875975 -0.02474653 -0.9435214 0.3303861 0.5746018 -0.7487836 0.3303875 0.7946556 -0.5773479 0.1875951 0.8896973 -0.3150946 0.3303849 0.3035309 0.9341714 -0.1875975 0.02474653 0.9435215 -0.330386 -0.7946556 0.5773479 -0.1875951 -0.8896973 0.3150945 -0.3303849 -0.7946556 -0.5773479 -0.1875951 -0.5746018 -0.7487836 -0.3303875 0.3035309 -0.9341714 -0.1875976 0.5345759 -0.7778645 -0.3303867 0.9822458 0 -0.1875985 0.9049891 0.2680316 -0.3303847 0.4712997 0.5831224 -0.6616986 0.1875943 0.5773454 -0.7946577 -0.0385304 0.7487789 -0.6616991 -0.4089462 0.6284252 -0.6616984 -0.4911193 0.356821 -0.7946577 -0.7240421 0.1947362 -0.6616954 -0.7240421 -0.1947362 -0.6616954 -0.4911194 -0.356821 -0.7946576 -0.4089462 -0.6284252 -0.6616984 0.7002241 0.2680318 -0.6616988 0.6070605 0 -0.7946556 -0.0385304 -0.7487789 -0.6616991 0.1875943 -0.5773454 -0.7946577 0.4712997 -0.5831224 -0.6616986 0.1023808 -0.3150898 -0.9435235 -0.2680341 -0.1947365 -0.9435229 -0.2680341 0.1947365 -0.9435229 0.1023808 0.3150898 -0.9435235 0.802609 -0.5831265 -0.1256273 -0.306569 -0.9435216 -0.1256289 -0.9920774 0 -0.1256284 -0.306569 0.9435216 -0.1256289 0.802609 0.5831265 -0.1256273 0.2680341 0.1947365 0.9435229 -0.1023808 0.3150898 0.9435235 -0.3313045 0 0.943524 -0.1023808 -0.3150899 0.9435235 0.2680341 -0.1947365 0.9435229 0.306569 0.9435216 0.1256289 -0.802609 0.5831265 0.1256274 -0.802609 -0.5831265 0.1256274 0.306569 -0.9435216 0.1256289 0.9920774 0 0.1256284 0.3313045 0 -0.943524</float_array>
|
||||||
<technique_common>
|
<technique_common>
|
||||||
<accessor source="#Icosphere_001-mesh-normals-array" count="80" stride="3">
|
<accessor source="#Icosphere_001-mesh-normals-array" count="80" stride="3">
|
||||||
<param name="X" type="float"/>
|
<param name="X" type="float"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user