Package game.scenes

Source Code of game.scenes.OptionsScene

package game.scenes;

import engine.geometry.Rectangle;
import engine.hierarchy.DefaultScene;
import engine.classes.Colour;
import engine.interfaces.Clock;
import engine.interfaces.Keyboard;
import engine.interfaces.Keyboard.Key;
import engine.interfaces.Mouse;
import engine.interfaces.RenderTarget;
import game.layers.OptionsGuiLayer;

public final class OptionsScene extends DefaultScene {
    private static final Colour BACK = new Colour(0, 128, 64);
    private static final Rectangle SCREEN = new Rectangle(0, 0, 640, 480);

    @Override
    public void onBeforeMove(final Keyboard keyboard, final Mouse mouse, final Clock clock) {
        if (keyboard.wasReleased(Key.VK_ESCAPE)) {
            getStage().insertSceneAbove(new FadeThroughBlackScene(new MainMenuScene()), this);
        }
    }

    @Override
    public void onAdd() {
        addLayer(new OptionsGuiLayer());
    }

    @Override
    public void onDraw(final RenderTarget target) {
        target.fillRectangle(SCREEN, BACK);
    }
}
TOP

Related Classes of game.scenes.OptionsScene

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.