public Player(double x, double y, double w, double h, SimpleGUI sg) { super(x, y, w, h); // playerSize = (w+h)/2; globe = sg; globe.registerToKeyboard(controls); globe.registerToTimer(this); }
public World(Player p, SimpleGUI sg) { globe = sg; globe.registerToKeyboard(event); globe.registerToTimer(this); globe.setBackgroundColor(new Color(104, 136, 255)); globe.drawFilledBox( 0, globe.getHeight() - 50, globe.getWidth(), 50, Color.GREEN, 1.0, "Ground"); p1 = p; player_X = p1.xTopLeft; player_Y = p1.yTopLeft; player_size = (int) p1.width; visualize(); }