AllBinary Open License Version 1.0
Copyright (c) 2011 AllBinary.
By agreeing to this license you and any business entity you represent are
legally bound to this legal agreement.
You may transmit, m...
If you think the Android project AllBinary-Platform-Game listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* AllBinary Open License Version 1/*www.java2s.com*/
* Copyright (c) 2011 AllBinary
*
* By agreeing to this license you and any business entity you represent are
* legally bound to the AllBinary Open License Version 1 legal agreement.
*
* You may obtain the AllBinary Open License Version 1 legal agreement from
* AllBinary or the root directory of AllBinary's AllBinary Platform repository.
*
* Created By: Travis Berthelot
*
*/package org.allbinary.game.testgamedemo;
import org.allbinary.game.testgamedemo.canvas.TestGameDemoGameCanvas;
import org.allbinary.game.testgamedemo.canvas.TestGameDemoInputMappingHelpPaintable;
import org.allbinary.game.testgamedemo.canvas.TestGameDemoSoftwareInfo;
import org.allbinary.game.testgamedemo.canvas.TestGameDemoStartCanvas;
import org.allbinary.game.testgamedemo.layer.TestGameDemoLayerManager;
import org.allbinary.media.audio.TestGameDemoSoundsFactoryFactory;
import org.allbinary.logic.basic.string.CommonStrings;
import org.allbinary.logic.communication.log.LogFactory;
import org.allbinary.logic.communication.log.LogUtil;
import org.allbinary.logic.communication.log.PreLogUtil;
import org.allbinary.game.GameInfo;
import org.allbinary.game.GameMode;
import org.allbinary.game.GameTypeFactory;
import org.allbinary.game.PlayerTypesFactory;
import org.allbinary.game.displayable.canvas.GameCanvasRunnableInterface;
import org.allbinary.game.layer.AllBinaryGameLayerManager;
import org.allbinary.game.midlet.LicenseLevelUtil;
import org.allbinary.game.midlet.LicenseLoadingTypeFactory;
import org.allbinary.game.midlet.SpecialDemoGameMidlet;
import org.allbinary.game.paint.help.HelpPaintable;
import org.allbinary.game.score.BasicHighScoresFactory;
import org.allbinary.game.score.HighScoresPaintable;
import org.allbinary.game.score.displayable.HighScoresCanvas;
import org.allbinary.media.audio.AllBinaryMediaManagerShutdown;
import org.allbinary.media.audio.EarlySoundsFactoryFactory;
/**
* @author user
*/publicclass TestGameDemoMIDlet extends
SpecialDemoGameMidlet
//DemoGameMidlet
{
public TestGameDemoMIDlet()
{
super(LicenseLoadingTypeFactory.getIntance().OTHER);
//this.setSaveGameForm(SaveGameForm.getInstance(this, "Save Game"));
}
protected HelpPaintable getHelpPaintable()
throws Exception
{
//return TestGameDemoHelpPaintable.getInstance();
return TestGameDemoInputMappingHelpPaintable.getInstance();
}
protected GameCanvasRunnableInterface createDemoGameCanvasRunnableInterface() throws Exception
{
returnnew TestGameDemoStartCanvas(this);
}
protected GameCanvasRunnableInterface createGameCanvasRunnableInterface(
AllBinaryGameLayerManager allBinaryGameLayerManager) throws Exception
{
returnnew TestGameDemoGameCanvas(this, allBinaryGameLayerManager);
}
protected HighScoresCanvas createHighScoresCanvas() throws Exception
{
returnnew HighScoresCanvas(this,
this.createGameLayerManager(),
new HighScoresPaintable(),
new BasicHighScoresFactory(TestGameDemoSoftwareInfo.getInstance()));
}
publicint getHighestLevel()
{
PreLogUtil.put("******************Demo Level Limited To: 6", this, "getMaxLevel");
return LicenseLevelUtil.getInstance().getMaxLevel(TestGameDemoLayerManager.MAX_LEVEL, 6);
}
protected AllBinaryGameLayerManager createGameLayerManager()
{
GameInfo gameInfo = new GameInfo(
GameTypeFactory.getInstance().SINGLE_PLAYER, GameMode.SERVER,
PlayerTypesFactory.getInstance().PLAYER_TYPE_ONE,
this.getHighestLevel(), 1);
returnnew TestGameDemoLayerManager(gameInfo);
}
/*
protected void mediaInit() throws Exception
{
}
*/protectedvoid mediaShutdown() throws Exception
{
//PreLogUtil.put(CommonStrings.getInstance().START, this, "mediaShutdown - postStopGameCanvasRunnableInterface");
LogUtil.put(LogFactory.getInstance(CommonStrings.getInstance().START, this,
"mediaShutdown - postStopGameCanvasRunnableInterface"));
AllBinaryMediaManagerShutdown.shutdown(
EarlySoundsFactoryFactory.getInstance());
AllBinaryMediaManagerShutdown.shutdown(
TestGameDemoSoundsFactoryFactory.getInstance());
LogUtil.put(LogFactory.getInstance(CommonStrings.getInstance().END, this,
"mediaShutdown - postStopGameCanvasRunnableInterface"));
}
}