Subversion Repositories AndroidProjects

Rev

Rev 852 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.gebauz.burutaru.gamestates;

import com.gebauz.bauzoid.game.Game;
import com.gebauz.bauzoid.gamestates.BaseGameState;
import com.gebauz.burutaru.GameConsts;
import com.gebauz.burutaru.game.GameLogic;

public class ControlTestState extends BaseGameState
{
       
        private GameLogic mGameLogic = null;   
       
        public ControlTestState(Game game)
        {
                super(game);
                setFading(true, true);
               
                mGameLogic = new GameLogic(game);
        }
       
        @Override
        public void initAsync(String param)
        {
                mGameLogic.initAsync();
        }

        @Override
        public void init(String param)
        {
                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()
        {
                getGraphics().clear(0, 0, 0, 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();
        }
}