Skip to content
Permalink
8ba4e500aa
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
30 lines (21 sloc) 502 Bytes
package main;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
public class Laser {
private double x;
private double y;
BufferedImage laser;
public Laser(double x, double y, Game game){
this.x = x;
this.y = y;
SpriteSheet ss = new SpriteSheet(game.getSpriteSheet());
laser = ss.grabimage(1, 1, 64, 64);
}
public void tick(){
x+=1;
y+=1;
}
public void render(Graphics g){
g.drawImage(laser, (int)x, (int)y, null);
}
}