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

com.codingame.gameengine.module.entities.World Maven / Gradle / Ivy

Go to download

Entity Manager module for the CodinGame engine toolkit. Simplify the management of shapes and drawings.

There is a newer version: 4.5.0
Show newest version
package com.codingame.gameengine.module.entities;

/**
 * The World represents a coordinate mapping from the positions of entities to the pixels on screen. The viewer's canvas has 1920x1080 pixels and so
 * the default World's width and height are also 1920 and 1080.
 *
 */
public class World {
    private int width, height;

    /**
     * The default World's width.
     */
    public static final int DEFAULT_WIDTH = 1920;

    /**
     * The default World's height.
     */
    public static final int DEFAULT_HEIGHT = 1080;

    /**
     * Returns the width of this world.
     * 
     * @return the width of this world.
     */
    public int getWidth() {
        return width;
    }

    /**
     * Returns the height of this world.
     * 
     * @return the height of this world.
     */
    public int getHeight() {
        return height;
    }

    World(int width, int height) {
        this.width = width;
        this.height = height;
    }

    World() {
        this(DEFAULT_WIDTH, DEFAULT_HEIGHT);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy