Skip to content
Permalink
7dcd10686a
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
29 lines (20 sloc) 505 Bytes
package main;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
public class Player {
private double x;
private double y;
private BufferedImage player;
public Player(double x, double y, Game game){
this.x = x;
this.y = y;
SpriteSheet ss = new SpriteSheet(game.getSpriteSheet());
player = ss.grabimage(1 ,1, 32, 32);
}
public void tick(){
x++;
}
public void render(Graphics g){
g.drawImage(player, (int)x, (int)y, null);
}
}