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
38 lines (30 sloc) 685 Bytes
package main;
import java.awt.Graphics;
import java.util.LinkedList;
public class Controller {
private LinkedList<Laser> l = new LinkedList<Laser>();
Laser tempLaser;
Game game;
public Controller(Game game){
this.game = game;
addLaser(new Laser(100, 300, game));
}
public void tick(){
for(int i = 0; i < l.size(); i++){
tempLaser = l.get(i);
tempLaser.tick();
}
}
public void render(Graphics g){
for(int i = 0; i < l.size(); i++){
tempLaser = l.get(i);
tempLaser.render(g);
}
}
public void addLaser(Laser laser){
l.add(laser);
}
public void removeLaser(Laser laser){
l.remove(laser);
}
}