Commit 354d0049 authored by Gwendoline's avatar Gwendoline

now it should colour in red when a character is hit

parent 7fd4ca9c
......@@ -48,20 +48,26 @@ public class EntityDisplayer implements Serializable {
Animation animation;
if (associatedEntity.hasAction(Action.ATTACK)) {
animation = animationMapTab[dir].get(Action.ATTACK);
if (associatedEntity.hasAction(Action.HIT))
if (associatedEntity.hasAction(Action.HIT)) {
animation.setHIT(true);
associatedEntity.removeAction(Action.HIT);
}
associatedEntity.removeAction(Action.ATTACK);
}
else if (associatedEntity.hasAction(Action.WALK)) {
animation = animationMapTab[dir].get(Action.WALK);
if (associatedEntity.hasAction(Action.HIT))
if (associatedEntity.hasAction(Action.HIT)) {
animation.setHIT(true);
associatedEntity.removeAction(Action.HIT);
}
associatedEntity.removeAction(Action.WALK);
}
else {
animation = animationMapTab[dir].get(Action.NONE);
if (associatedEntity.hasAction(Action.HIT))
if (associatedEntity.hasAction(Action.HIT)) {
animation.setHIT(true);
associatedEntity.removeAction(Action.HIT);
}
}
Sprite sprite = new Sprite(animation.getSpriteImage());
GraphicsMapPoint entityPositionGraphicsMapPoint = GraphicalBridgeConfiguration.makeMapPointFromCoreCoordinates(associatedEntity.getX(), associatedEntity.getY());
......
......@@ -93,9 +93,9 @@ public class Animation implements Serializable, Displayable
for (int xx = 0; xx < width; xx++) {
for (int yy = 0; yy < height; yy++) {
int[] pixels = raster.getPixel(xx, yy, (int[]) null);
pixels[0] = 0;
pixels[0] = 255;
pixels[1] = 0;
pixels[2] = 255;
pixels[2] = 0;
raster.setPixel(xx, yy, pixels);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment