Subversion Repositories AndroidProjects

Rev

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

package com.gebauz.PonPonChun;

import com.gebauz.Bauzoid.app.BauzoidApp;
import com.gebauz.Bauzoid.file.FileUtil;
import com.gebauz.PonPonChun.PonPonChunCustomServices;
import com.gebauz.PonPonChun.game.GameConsts;

public class PonPonChunApp extends BauzoidApp
{
        public PonPonChunApp(boolean adsEnabled)
        {
                super("Pon-Pon Chun", adsEnabled);
        }

        @Override
        public void initGame()
        {
                // Global initializations
               
                String test1 = FileUtil.extractFilename("C:\\bla\\booo\\test.txt");
                String test2 = FileUtil.extractFilenameNoExt("C:\\bla\\booo\\test.txt");
                String test3 = FileUtil.extractPath("C:\\bla\\booo\\test.txt");
               
                mGame.setCustomServices(new PonPonChunCustomServices(mGame));
               
                mGame.getInput().setVirtualSize(GameConsts.VIRTUAL_SCREEN_WIDTH, GameConsts.VIRTUAL_SCREEN_HEIGHT);
               
                // TODO: read initial game state from config/XML
                mGame.getGameStateManager().setDefaultPackage(this.getClass().getPackage().getName() + ".gamestates");
                //mGame.getGameStateManager().switchTo(com.gebauz.PonPonChun.gamestates.TitleState.class, "");
                mGame.getGameStateManager().switchTo(mGame.getSettings().getSetting("initstate"), "");
                //mGame.getGameStateManager().switchTo(com.gebauz.PonPonChun.gamestates.EndlessState.class, "");
        }

        @Override
        public void exitGame()
        {
       

        }
       
        @Override
        public void render()
        {
                super.render();
               
                PonPonChunCustomServices.getInstance().getFont().drawText(String.format("%.2ffps", mGame.getFps()), GameConsts.VIRTUAL_SCREEN_WIDTH - 100, GameConsts.VIRTUAL_SCREEN_HEIGHT-50, GameConsts.WHITE_COLOR);
                PonPonChunCustomServices.getInstance().getFont().drawText(String.format("%.4fms", mGame.getFrameTime()), GameConsts.VIRTUAL_SCREEN_WIDTH - 100, GameConsts.VIRTUAL_SCREEN_HEIGHT-30, GameConsts.WHITE_COLOR);
        }
       

}