/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package slickfred;

import items.Star;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;

/**
 *
 * @author jakub
 */
public class Game extends BasicGame{
    private Fred fred;
    private Star star;

    public Game(){
        super("super fred");
    }
    
    @Override
    public void init(GameContainer container) throws SlickException {
        this.fred = new Fred();
        this.star = new Star();
    }

    @Override
    public void update(GameContainer container, int delta) throws SlickException {
        Input input = container.getInput();
        if( input.isKeyDown(Input.KEY_ESCAPE))
            container.exit();
        
        fred.update(container,delta,null);
    }

    @Override
    public void render(GameContainer container, Graphics g) throws SlickException {
        star.render(container,g,null);
        fred.render(container,g,null);
    }
    
}
