import java.awt.Graphics;
import java.awt.Image;
import javax.swing.ImageIcon;
public class GamePlayer {
Image im;//Picture;
int x,y;//Coordinates;
//Constructor, assign values to properties/ Initial value property;
public GamePlayer(int x,int y){
ImageIcon icon=new ImageIcon("player.png");
im=icon.getImage();
this.x=x;
this.y=y;
}
// The method to draw the player;
public void render(Graphics g){
g.drawImage(im,x,y,null);
}
}
import java.awt.Image;
import javax.swing.ImageIcon;
public class GamePlayer {
Image im;//Picture;
int x,y;//Coordinates;
//Constructor, assign values to properties/ Initial value property;
public GamePlayer(int x,int y){
ImageIcon icon=new ImageIcon("player.png");
im=icon.getImage();
this.x=x;
this.y=y;
}
// The method to draw the player;
public void render(Graphics g){
g.drawImage(im,x,y,null);
}
}