All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mathiewz.slick.Game Maven / Gradle / Ivy

Go to download

The main purpose of this libraryis to modernize and maintain the slick2D library.

The newest version!
package com.github.mathiewz.slick;

/**
 * The main game interface that should be implemented by any game being developed
 * using the container system. There will be some utility type sub-classes as development
 * continues.
 *
 * @see com.github.mathiewz.slick.BasicGame
 *
 * @author kevin
 */
public interface Game {
    /**
     * Initialise the game. This can be used to load static resources. It's called
     * before the game loop starts
     *
     * @param container
     *            The container holding the game
     */
    public void init(GameContainer container);
    
    /**
     * Update the game logic here. No rendering should take place in this method
     * though it won't do any harm.
     *
     * @param container
     *            The container holing this game
     * @param delta
     *            The amount of time thats passed since last update in milliseconds
     */
    public void update(GameContainer container, int delta);
    
    /**
     * Render the game's screen here.
     *
     * @param container
     *            The container holing this game
     * @param g
     *            The graphics context that can be used to render. However, normal rendering
     *            routines can also be used.
     */
    public void render(GameContainer container, Graphics g);
    
    /**
     * Notification that a game close has been requested
     *
     * @return True if the game should close
     */
    public boolean closeRequested();
    
    /**
     * Get the title of this game
     *
     * @return The title of the game
     */
    public String getTitle();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy