summary refs log tree commit diff stats
path: root/src/com/fourisland
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/fourisland')
-rw-r--r--src/com/fourisland/fourpuzzle/GameCharacter.java19
-rw-r--r--src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java8
2 files changed, 9 insertions, 18 deletions
diff --git a/src/com/fourisland/fourpuzzle/GameCharacter.java b/src/com/fourisland/fourpuzzle/GameCharacter.java index da0ee9e..8557fef 100644 --- a/src/com/fourisland/fourpuzzle/GameCharacter.java +++ b/src/com/fourisland/fourpuzzle/GameCharacter.java
@@ -5,6 +5,9 @@
5 5
6package com.fourisland.fourpuzzle; 6package com.fourisland.fourpuzzle;
7 7
8import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.BlankEventGraphic;
9import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.EventGraphic;
10
8/** 11/**
9 * 12 *
10 * @author hatkirby 13 * @author hatkirby
@@ -45,24 +48,14 @@ public class GameCharacter {
45 this.inParty = inParty; 48 this.inParty = inParty;
46 } 49 }
47 50
48 private String graphic = "blank"; 51 private EventGraphic graphic = new BlankEventGraphic();
49 public String getGraphic() 52 public EventGraphic getGraphic()
50 { 53 {
51 return graphic; 54 return graphic;
52 } 55 }
53 public void setGraphic(String graphic) 56 public void setGraphic(EventGraphic graphic)
54 { 57 {
55 this.graphic = graphic; 58 this.graphic = graphic;
56 } 59 }
57
58 private int graphicOffset = 0;
59 public int getGraphicOffset()
60 {
61 return graphicOffset;
62 }
63 public void setGraphicOffset(int graphicOffset)
64 {
65 this.graphicOffset = graphicOffset;
66 }
67 60
68} 61}
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java index 6e8c359..d488e7d 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java
@@ -66,14 +66,12 @@ public class HeroEvent implements Event {
66 } 66 }
67 } 67 }
68 68
69 /* TODO Change the specification of GameCharacter
70 * to require an EventGraphic instead of a graphic name
71 * and offset
72 */
73 GameCharacter toDraw = Game.getSaveFile().getParty().getLeader(); 69 GameCharacter toDraw = Game.getSaveFile().getParty().getLeader();
74 if (!toDraw.getGraphic().equals("blank")) 70 if (!toDraw.getGraphic().equals("blank"))
75 { 71 {
76 g.drawImage(CharSet.getCharSet(toDraw.getGraphic()).getImage(toDraw.getGraphicOffset(), direction, animationStep), x, y, null); 72 toDraw.getGraphic().setDirection(direction);
73 toDraw.getGraphic().setAnimationStep(animationStep);
74 g.drawImage(toDraw.getGraphic().getImage(), x, y, null);
77 } 75 }
78 } 76 }
79 77