mirror of
https://github.com/OpenLiberty/liberty-bikes.git
synced 2025-01-18 10:23:58 +08:00
stop players killing themselves from quick direction changes
This commit is contained in:
parent
ee7499b505
commit
ec905312c2
@ -160,11 +160,12 @@ public class Player {
|
||||
trailPosX = trailP.x;
|
||||
trailPosY = trailP.y;
|
||||
s[trailPosX][trailPosY] = GameBoard.TRAIL_SPOT_TAKEN;
|
||||
s[trailPosX2][trailPosY2] = GameBoard.TRAIL_SPOT_TAKEN;
|
||||
if (lastDirection != direction) {
|
||||
TrailPosition trailP2 = trail.remove();
|
||||
trailPosX2 = trailP2.x;
|
||||
trailPosY2 = trailP2.y;
|
||||
s[trailPosX2][trailPosY2] = GameBoard.TRAIL_SPOT_TAKEN;
|
||||
s[trailPosX2][trailPosY2] = (short) (GameBoard.PLAYER_SPOT_TAKEN + playerNum);
|
||||
} else {
|
||||
trailPosX2 = trailPosX;
|
||||
trailPosY2 = trailPosY;
|
||||
|
Loading…
Reference in New Issue
Block a user