Do the flashy thing
This commit is contained in:
parent
cd2b968631
commit
5eef40f767
@ -54,7 +54,13 @@ public class Ghost extends MovableEntity {
|
|||||||
if (caught && !returned) {
|
if (caught && !returned) {
|
||||||
return null;
|
return null;
|
||||||
} else if (state.frightTimer > 0 && !returned) {
|
} else if (state.frightTimer > 0 && !returned) {
|
||||||
|
if (state.frightTimer > 2) {
|
||||||
|
// Render the blue scared ghost
|
||||||
return sprite[0][counter % 2];
|
return sprite[0][counter % 2];
|
||||||
|
} else {
|
||||||
|
// Render the flashing white ghost
|
||||||
|
return sprite[0][(int) (state.frightTimer * 5) % 2 == 0? 2 : 0 + counter % 2];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return sprite[2 + (counter % 2)][spriteIndex];
|
return sprite[2 + (counter % 2)][spriteIndex];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user