Package game.actors

Source Code of game.actors.StopButtonActor

package game.actors;

import engine.geometry.Vector;
import engine.hierarchy.DefaultActor;
import engine.interfaces.Image;
import game.habits.ButtonHabit;

public final class StopButtonActor extends DefaultActor implements ButtonHabit.Listener {
    @Override
    public void onAdd() {
        Image image = getStage().getLibrary().findImage("Stop Button");
        addHabit(new ButtonHabit(new Vector(64, 192), image.getFrames(image.getWidth() / 3), this));
    }

    @Override
    public void onButton(final ButtonHabit button) {
        getStage().getLibrary().findMusic("Background Music").stop();
    }
}
TOP

Related Classes of game.actors.StopButtonActor

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.