Subversion Repositories AndroidProjects

Rev

Rev 616 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.gebauz.PonPonChun.gamestates;

import com.gebauz.Bauzoid.game.Game;
import com.gebauz.Bauzoid.gamestates.BaseGameState;
import com.gebauz.PonPonChun.game.GameConsts;
import com.gebauz.PonPonChun.game.GameLogic;

public class PuzzleState extends BaseGameState
{
        // Constants========================================================================================

        // Embedded Types===================================================================================

        // Members==========================================================================================

        private GameLogic mGameLogic = null;
       
        // Methods==========================================================================================

        public PuzzleState(Game game)
        {
                super(game);
                setFading(true, true);
                enableLoadingScreen(true);
        }

        @Override
        public void init(String param)
        {
                mGameLogic = new GameLogic(getGame());
                mGameLogic.init(GameLogic.GameMode.PUZZLE, param);
        }

        @Override
        public void exit()
        {
                if (mGameLogic != null)
                {
                        mGameLogic.exit();
                        mGameLogic = null;
                }
        }

        @Override
        public void update(float deltaTime)
        {
                mGameLogic.update(deltaTime);
        }
       
        @Override
        public void onPause()
        {
                mGameLogic.setPaused(true);
        }

        @Override
        public void render()
        {
                getGraphics().clear(0.35f, 0.25f, 0.35f, 0.0f);
               
                getRenderStates().projection.setOrtho(
                                0.0f,
                                GameConsts.VIRTUAL_SCREEN_WIDTH-1,
                                GameConsts.VIRTUAL_SCREEN_HEIGHT-1,
                                0.0f,
                                0.0f,
                                1.0f
                        );
               
                mGameLogic.render();
               
                //PonPonChunCustomServices.getInstance().getInGameFont().drawText("PROTOTYPE", 10, GameConsts.VIRTUAL_SCREEN_HEIGHT-50, new Vector4(1, 1, 1, 1), 2.0f);
        }


        // Getters/Setters==================================================================================

}