Rev 316 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
package com.gebauz.pingk.gamestates;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.gebauz.Bauzoid.app.Game;
import com.gebauz.Bauzoid.gamestates.BaseGameState;
import com.gebauz.Bauzoid.math.Matrix4;
import com.gebauz.pingk.game.GameConsts;
import com.gebauz.pingk.game.GameLogic;
public class MainGameState
extends BaseGameState
{
private GameLogic mGameLogic =
null;
public MainGameState
(Game game
)
{
super(game
);
setFading
(true,
true);
}
@
Override
public void init
()
{
mGameLogic =
new GameLogic
(getGame
());
mGameLogic.
init();
}
@
Override
public void exit
()
{
if (mGameLogic
!=
null)
{
mGameLogic.
exit();
mGameLogic =
null;
}
}
@
Override
public void update
(float deltaTime
)
{
mGameLogic.
update(deltaTime
);
}
@
Override
public void render
()
{
//Gdx.gl.glClearColor(0.05f, 0.05f, 0.05f, 0.0f);
//Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
getGraphics
().
clear(0.05f, 0.05f, 0.05f, 0.0f
);
getRenderStates
().
projection = Matrix4.
createOrtho(
0.0f,
GameConsts.
VIRTUAL_SCREEN_WIDTH-
1,
GameConsts.
VIRTUAL_SCREEN_HEIGHT-
1,
0.0f,
0.0f,
1.0f
);
mGameLogic.
render();
}
}