Android Open Source - YOGOSec Game






From Project

Back to project page YOGOSec.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project YOGOSec listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package YOGOSec.core;
/*from  ww  w.j a v  a  2 s . co m*/
import YOGOSec.core.gui.ProgressBar;
import YOGOSec.core.input.Input;
import YOGOSec.core.render.Render;
import YOGOSec.core.screens.MainMenuScreen;
import YOGOSec.core.screens.MyScreen;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;

public class Game implements ApplicationListener {
    public static final Game INSTANCE;

    static {
        INSTANCE = new Game();
    }

    // public TextureAtlas atlas; TODO Uncomment when sheet is used
    private MyScreen screen;
    private Render render;
    private ProgressBar progressBar;

    private Game() {

    }

    public Render getRender() {
        return render;
    }

    @Override
    public void create() {
        this.render = new Render();
        this.setScreen(new MainMenuScreen(this));

        // this.atlas = new TextureAtlas("sheet.txt"); TODO Uncomment when sheet is used

        Input input = new Input(this);
        Gdx.input.setInputProcessor(input);
    }

    @Override
    public void resize(int width, int height) {
        this.render.resized(width, height);
        if (this.screen != null) this.screen.resize(width, height);
        Gdx.app.log("YOGOSec", "Camera size set to: " + width + "x" + height);
    }

    @Override
    public void render() {
        this.render.start();

        if (this.screen != null) this.screen.render(this.render);

        this.render.end();
    }

    @Override
    public void pause() {
        if (this.screen != null) this.screen.pause();
    }

    @Override
    public void resume() {
        if (this.screen != null) this.screen.resume();
    }

    @Override
    public void dispose() {
        if (this.screen != null) this.screen.dispose();
        // atlas.dispose(); TODO Uncomment when sheet is used
    }

    public MyScreen getScreen() {
        return screen;
    }

    public void setScreen(MyScreen screen) {
        this.screen = screen;
    }

    public int getWidth() {
        return this.render.getWidth();
    }

    public int getHeight() {
        return this.render.getHeight();
    }
}




Java Source Code List

YOGOSec.android.GameActivity.java
YOGOSec.core.Game.java
YOGOSec.core.gui.Button.java
YOGOSec.core.gui.GUIComponent.java
YOGOSec.core.gui.GUI.java
YOGOSec.core.gui.IActionListener.java
YOGOSec.core.gui.InputListener.java
YOGOSec.core.gui.ProgressBar.java
YOGOSec.core.input.Input.java
YOGOSec.core.render.Render.java
YOGOSec.core.render.YUpPixmap.java
YOGOSec.core.screens.MainMenuScreen.java
YOGOSec.core.screens.MyScreen.java
YOGOSec.core.util.Point2f.java
YOGOSec.core.util.Point2i.java
YOGOSec.core.util.Point.java
YOGOSec.core.util.Rectangle.java
YOGOSec.core.util.Rectanglef.java
YOGOSec.core.util.Rectanglei.java
YOGOSec.java.GameDesktop.java