Okay, basically i'm using an object to get some ints to print out but it won't update...
GameLoader Class (extends jframe)
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; Image img1 = Toolkit.getDefaultToolkit().getImage("sprites/background.gif"); g2.drawImage(img1, 0, 0, this); g2.finalize(); // Start Text PlayerAssistant getPA = new PlayerAssistant(); g.setColor(Color.green); g.drawString("Village Health: "+getPA.vHealth, 30, 65); g.drawString("Resource - Wood: "+getPA.rWood, 30, 90); g.drawString("Resource - Plants: "+getPA.rPlants, 30, 115); g.drawString("Resource - Stone: "+getPA.rStone, 30, 140); g.drawString("Village Value: "+getPA.vValue, 30, 165); g.drawString("Village Strength: "+getPA.vStrength+"%", 30, 190); g.drawString("Population: "+getPA.Population, 30, 215); } public static void main(String[] args) { PlayerAssistant getPA = new PlayerAssistant(); getPA.loadPlayer(); new GameLoader(); }
PlayerAssistant
public void loadPlayer() { vHealth = 100; rWood = 0; rPlants = 0; rStone = 0; vValue = 1000; vStrength = 1; Population = 20; }
Sorry i'm pretty new to this...