Skip to content

Commit

Permalink
draw for hit/downgrade immunity
Browse files Browse the repository at this point in the history
  • Loading branch information
Totenfluch committed May 27, 2016
1 parent eed5289 commit 891db69
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Blockinvaders/src/me/game/characters/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import javafx.scene.canvas.GraphicsContext;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import me.game.pack.Frame;
import me.game.playerWeapons.PlayerWeapon;
Expand Down Expand Up @@ -144,6 +145,14 @@ public void refresh(){

@Override
public void draw(GraphicsContext gc) {
if(alive && hitImmume > 0){
gc.setFill(Color.AQUAMARINE);
gc.fillRect(xPos-2, yPos-2, width+4, heigth+4);
}else if(alive && downgradeImmume > 0){
gc.setFill(Color.ORANGE);
gc.fillRect(xPos-2, yPos-2, width+4, heigth+4);
}

if (playerNumber == 0)
gc.setFill(Color.PURPLE);
else if (playerNumber == 1)
Expand All @@ -154,6 +163,7 @@ else if (playerNumber == 3)
gc.setFill(Color.CRIMSON);
else
gc.setFill(Color.WHITE);

if (alive)
gc.fillRect(xPos, yPos, width, heigth);

Expand Down

0 comments on commit 891db69

Please sign in to comment.