Commit f211d8fa authored by Mathieu Hilaire's avatar Mathieu Hilaire

gold.jpg linked to the species gold as its sprite

parent 8ec70a0b
......@@ -327,7 +327,7 @@ R
200
200
#entityDisplayerType
FIREBOLT
GOLD
#triggers
1
#trigger function
......
......@@ -316,6 +316,40 @@ public class EntityDisplayerProvider {
}
return new EntityDisplayer(associatedEntity, animationMapTab, 'C');
}
case GOLD : {
Map<Action, Animation>[] animationMapTab= new Map[Direction.values().length] ;
animationMapTab[Direction.RIGHT.ordinal()] = new HashMap<Action, Animation>();
animationMapTab[Direction.RIGHTUP.ordinal()] = new HashMap<Action, Animation>();
animationMapTab[Direction.UP.ordinal()] = new HashMap<Action, Animation>();
animationMapTab[Direction.LEFTUP.ordinal()] = new HashMap<Action, Animation>();;
animationMapTab[Direction.LEFT.ordinal()] = new HashMap<Action, Animation>();
animationMapTab[Direction.LEFTDOWN.ordinal()] = new HashMap<Action, Animation>();;
animationMapTab[Direction.DOWN.ordinal()] = new HashMap<Action, Animation>();
animationMapTab[Direction.RIGHTDOWN.ordinal()] = new HashMap<Action, Animation>();
Sprite gold = SpriteStorage.getInstance().getGold();
for (Action action : Action.values()) {
Sprite persoR = new Sprite (gold.getSpriteImage(), 0, 0, 64, 32);
Animation persoAnimationRIGHT = new Animation(persoR, 2, frameDelay);
animationMapTab[Direction.RIGHT.ordinal()].put(action, persoAnimationRIGHT);
animationMapTab[Direction.RIGHTUP.ordinal()].put(action, persoAnimationRIGHT);
Sprite persoU = new Sprite (gold.getSpriteImage(), 0, 32, 64, 32);
Animation persoAnimationUP = new Animation(persoU, 2, frameDelay);
animationMapTab[Direction.UP.ordinal()].put(action, persoAnimationUP);
animationMapTab[Direction.LEFTUP.ordinal()].put(action, persoAnimationUP);
Sprite persoL = new Sprite (gold.getSpriteImage(), 0, 64, 64, 32);
Animation persoAnimationLEFT = new Animation(persoL, 2, frameDelay);
animationMapTab[Direction.LEFT.ordinal()].put(action, persoAnimationLEFT);
animationMapTab[Direction.LEFTDOWN.ordinal()].put(action, persoAnimationLEFT);
Sprite persoroseD = new Sprite (gold.getSpriteImage(), 0, 96, 64, 32);
Animation persoAnimationDOWN = new Animation(persoroseD, 2, frameDelay);
animationMapTab[Direction.DOWN.ordinal()].put(action, persoAnimationDOWN);
animationMapTab[Direction.RIGHTDOWN.ordinal()].put(action, persoAnimationDOWN);
}
return new EntityDisplayer(associatedEntity, animationMapTab, 'C');
}
default: {
Map<Action, Animation>[] animationMapTab= new Map[Direction.values().length] ;
animationMapTab[Direction.RIGHT.ordinal()] = new HashMap<Action, Animation>();
......
......@@ -13,5 +13,6 @@ public enum EntityDisplayerType {
PONYTA,
DIAGLA,
FIREBOLT,
FROSTBOLT
FROSTBOLT,
GOLD
}
......@@ -28,6 +28,7 @@ public class SpriteStorage {
diagla = new Sprite(ImageIO.read(UsedForLoadingSprites.getInstance().getClass().getResource("diagla.png")));
firebolt = new Sprite(ImageIO.read(UsedForLoadingSprites.getInstance().getClass().getResource("firebolt.png")));
frostbolt = new Sprite(ImageIO.read(UsedForLoadingSprites.getInstance().getClass().getResource("frostbolt.png")));
gold = new Sprite(ImageIO.read(UsedForLoadingSprites.getInstance().getClass().getResource("gold.png")));
} catch (IOException e) {
......@@ -44,6 +45,7 @@ public class SpriteStorage {
private Sprite diagla;
private Sprite firebolt;
private Sprite frostbolt;
private Sprite gold;
public Sprite getHealthBar1Container() {
return healthBar1Container;
......@@ -77,5 +79,7 @@ public class SpriteStorage {
}
public Sprite getFrostbolt(){
return frostbolt;
}
}
public Sprite getGold(){return gold; }
}
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