First Commit
This commit is contained in:
41
com/jalenwinslow/game/states/GameState.java
Normal file
41
com/jalenwinslow/game/states/GameState.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.jalenwinslow.game.states;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.jalenwinslow.game.Handler;
|
||||
import com.jalenwinslow.game.gameobjects.MazeGenerator;
|
||||
import com.jalenwinslow.game.gameobjects.Player;
|
||||
import com.jalenwinslow.game.gameobjects.Tile;
|
||||
import com.jalenwinslow.game.utils.Assets;
|
||||
|
||||
/**
|
||||
* Created by jalen on --/--/----.
|
||||
*/
|
||||
|
||||
public class GameState extends State {
|
||||
|
||||
|
||||
public GameState(Handler handler) {
|
||||
super(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(int initState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(float dt) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(SpriteBatch batch) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
|
||||
}
|
||||
}
|
||||
36
com/jalenwinslow/game/states/MenuState.java
Normal file
36
com/jalenwinslow/game/states/MenuState.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.jalenwinslow.game.states;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.jalenwinslow.game.Handler;
|
||||
|
||||
/**
|
||||
* Created by jalen on --/--/----.
|
||||
*/
|
||||
|
||||
public class MenuState extends State {
|
||||
|
||||
|
||||
public MenuState(Handler handler) {
|
||||
super(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(int initState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(float dt) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(SpriteBatch batch) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
|
||||
}
|
||||
}
|
||||
32
com/jalenwinslow/game/states/State.java
Normal file
32
com/jalenwinslow/game/states/State.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.jalenwinslow.game.states;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.jalenwinslow.game.Handler;
|
||||
|
||||
/**
|
||||
* Created by jalen on --/--/--.
|
||||
*/
|
||||
|
||||
public abstract class State {
|
||||
|
||||
protected Handler handler;
|
||||
private static State currentState = null, previousState = null;
|
||||
|
||||
public State(Handler handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
public abstract void init(int initState);
|
||||
public abstract void update(float dt);
|
||||
public abstract void render(SpriteBatch batch);
|
||||
public abstract void dispose();
|
||||
|
||||
//Getters and Setters
|
||||
public static State getCurrentState() {return currentState;}
|
||||
public static State getPreviousState() {return previousState;}
|
||||
|
||||
public static void setCurrentState(State state) {
|
||||
State.previousState = State.currentState;
|
||||
State.currentState = state;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user