Android Open Source - AllBinary-Platform-Game Test Game Demo With Sensor Touch Buttons Builder






From Project

Back to project page AllBinary-Platform-Game.

License

The source code is released under:

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/*from   w w w. j a  v a  2  s.  c o  m*/
* 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.input.motion.button;

import org.allbinary.input.motion.button.TouchButtonGenericActionResource;
import org.allbinary.input.motion.button.TouchButtonTurnRightResource;
import org.allbinary.input.motion.button.TouchButtonTurnLeftResource;
import org.allbinary.input.motion.button.BaseTouchInput;
import org.allbinary.input.motion.button.BasicTouchButtonCellPositionFactory;
import org.allbinary.input.motion.button.TouchButtonLocationHelper;
import org.allbinary.input.motion.button.BasicTouchInputFactory;
import org.allbinary.input.motion.button.FullTouchButton;
import org.allbinary.input.motion.button.TouchButton;
import org.allbinary.input.motion.button.CommonButtons;
import org.allbinary.util.BasicArrayList;
import org.allbinary.util.BasicArrayListUtil;

import org.allbinary.logic.basic.string.CommonStrings;
import org.allbinary.logic.communication.log.LogFactory;
import org.allbinary.logic.communication.log.LogUtil;
import org.allbinary.animation.Animation;
import org.allbinary.animation.FeaturedAnimationInterfaceFactoryInterfaceFactory;
import org.allbinary.animation.NullAnimationFactory;
import org.allbinary.graphics.CellPositionFactory;

public class TestGameDemoWithSensorTouchButtonsBuilder 
extends BaseTouchInput
{
    public BasicArrayList getList()
    {
        try
        {
            LogUtil.put(LogFactory.getInstance(CommonStrings.getInstance().START, this, CommonStrings.getInstance().CONSTRUCTOR));
            
            final BasicArrayList list = new BasicArrayList();
            
            TouchButtonLocationHelper touchButtonLocationHelper = new TouchButtonLocationHelper();

            BasicTouchButtonCellPositionFactory basicTouchButtonCellPositionFactory =
                new BasicTouchButtonCellPositionFactory();

            CommonButtons commonButtons = CommonButtons.getInstance();
            
            Animation animationInterface = 
                NullAnimationFactory.getFactoryInstance().getInstance();
            Animation hintAnimationInterface = animationInterface;

            BasicTouchInputFactory basicTouchInputFactory = BasicTouchInputFactory.getInstance();
            
            TouchButton LEFT = new FullTouchButton(basicTouchInputFactory.LEFT,
                    TouchButtonTurnLeftResource.getInstance(),
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.BOTTOM_LEFT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(),
                    touchButtonLocationHelper.getRowsRemainderHalf());                    

            TouchButton LEFT2 = new FullTouchButton(basicTouchInputFactory.LEFT,
                    animationInterface,
                    hintAnimationInterface,
                    //(Animation) FeaturedAnimationInterfaceFactoryInterfaceFactory
                    //.getInstance().get(TouchButtonTurnLeftResource.RESOURCE).getInstance(),
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.BOTTOM_SECOND_FROM_LEFT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(), 
                    touchButtonLocationHelper.getRowsRemainderHalf());                    

            TouchButton LEFT3 = new FullTouchButton(basicTouchInputFactory.LEFT,
                    animationInterface,
                    hintAnimationInterface,
                    //(Animation) FeaturedAnimationInterfaceFactoryInterfaceFactory
                    //.getInstance().get(TouchButtonTurnLeftResource.RESOURCE).getInstance(),
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.SECOND_FROM_BOTTOM_LEFT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(), 
                    touchButtonLocationHelper.getRowsRemainderHalf());                    

            TouchButton LEFT4 = new FullTouchButton(basicTouchInputFactory.LEFT,
                    animationInterface,
                    hintAnimationInterface,
                    //(Animation) FeaturedAnimationInterfaceFactoryInterfaceFactory
                    //.getInstance().get(TouchButtonTurnLeftResource.RESOURCE).getInstance(),
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.SECOND_FROM_BOTTOM_SECOND_FROM_LEFT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(), 
                    touchButtonLocationHelper.getRowsRemainderHalf());

            
            TouchButton RIGHT = new FullTouchButton(basicTouchInputFactory.RIGHT,
                    TouchButtonTurnRightResource.getInstance(),
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.BOTTOM_RIGHT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(), 
                    touchButtonLocationHelper.getRowsRemainderHalf());                    

            TouchButton RIGHT2 = new FullTouchButton(basicTouchInputFactory.RIGHT,
                    animationInterface,
                    hintAnimationInterface,
                    //(Animation) FeaturedAnimationInterfaceFactoryInterfaceFactory
                    //.getInstance().get(TouchButtonTurnRightResource.RESOURCE).getInstance(),
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.BOTTOM_SECOND_FROM_RIGHT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(), 
                    touchButtonLocationHelper.getRowsRemainderHalf());                    
            
            TouchButton RIGHT3 = new FullTouchButton(basicTouchInputFactory.RIGHT,
                    animationInterface,
                    hintAnimationInterface,
                    //featuredAnimationInterfaceFactoryInterfaceFactory.get(TouchButtonTurnRightResource.RESOURCE).getInstance(),
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.SECOND_FROM_BOTTOM_RIGHT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(), 
                    touchButtonLocationHelper.getRowsRemainderHalf());                    
            
            TouchButton RIGHT4 = new FullTouchButton(basicTouchInputFactory.RIGHT,
                    animationInterface,
                    hintAnimationInterface,
                    //featuredAnimationInterfaceFactoryInterfaceFactory.get(TouchButtonTurnRightResource.RESOURCE).getInstance(),
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.SECOND_FROM_BOTTOM_SECOND_FROM_RIGHT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(), 
                    touchButtonLocationHelper.getRowsRemainderHalf());

            list.add(LEFT);
            list.add(LEFT2);
            list.add(LEFT3);
            list.add(LEFT4);

            list.add(RIGHT);
            list.add(RIGHT2);
            list.add(RIGHT3);
            list.add(RIGHT4);

            if(basicTouchButtonCellPositionFactory.THIRD_FROM_BOTTOM_RIGHT != 
                CellPositionFactory.getInstance().NONE)
            {
                TouchButton WEAPON = new TouchButton(basicTouchInputFactory.SPECIAL_BUTTON_FIVE,
                        TouchButtonGenericActionResource.getInstance(),
                        commonButtons.NORMAL_BUTTON,
                        basicTouchButtonCellPositionFactory.THIRD_FROM_BOTTOM_RIGHT,
                        touchButtonLocationHelper.getColumnsRemainderHalf(), 
                        touchButtonLocationHelper.getRowsRemainderHalf()
                        );

                list.add(WEAPON);
            }
            
            TouchButton SPECIAL3 = new TouchButton(
                    basicTouchInputFactory.SPECIAL_BUTTON_SIX,
                    TouchButtonGenericActionResource.getInstance(),
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.TOP_LEFT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(), 
                    touchButtonLocationHelper.getRowsRemainderHalf()
                    );

            TouchButton SPECIAL4 = new TouchButton(
                    basicTouchInputFactory.SPECIAL_BUTTON_SEVEN_TESTING_ONLY,
                    TouchButtonGenericActionResource.getInstance(),
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.TOP_SECOND_FROM_LEFT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(), 
                    touchButtonLocationHelper.getRowsRemainderHalf()
                    );
            
            /*
            TouchButton ROTATE_Z = new TouchButton(basicTouchInputFactory.SPECIAL_BUTTON_EIGHT_TESTING_ONLY,
                    animationInterface,
                    commonButtons.NORMAL_BUTTON,
                    basicTouchButtonCellPositionFactory.SECOND_FROM_TOP_LEFT,
                    touchButtonLocationHelper.getColumnsRemainderHalf(), 
                    touchButtonLocationHelper.getRowsRemainderHalf()
                    );
            */
            
            list.add(SPECIAL3);
            list.add(SPECIAL4);
            //list.add(ROTATE_Z);

            return list;
        }
        catch (Exception e)
        {
            LogUtil.put(LogFactory.getInstance(CommonStrings.getInstance().EXCEPTION, this, CommonStrings.getInstance().GET_LIST, e));
            return BasicArrayListUtil.getInstance().getImmutableInstance();
        }
    }
}




Java Source Code List

.TestGameDemoMIDlet.java
.TestGameDemoMIDlet.java
.TestGameDemoMIDlet.java
.TestGameDemoMIDlet.java
.TestGameDemoMIDlet.java
org.allbinary.AndroidResources.java
org.allbinary.AndroidResources.java
org.allbinary.AndroidResources.java
org.allbinary.animation.image.TestGameDemoEarlyResourcesImageBasedAnimationInterfaceFactoryInterfaceFactory.java
org.allbinary.animation.image.TestGameDemoEarlyResourcesOpenGLESImageBasedAnimationInterfaceFactoryInterfaceFactory.java
org.allbinary.animation.image.TestGameDemoGameResourcesImageBasedAnimationInterfaceFactoryInterfaceFactory.java
org.allbinary.animation.image.TestGameDemoImageBasedAnimationInterfaceFactoryInterfaceFactory.java
org.allbinary.animation.image.TestGameDemoOpenGLESImageBasedAnimationInterfaceFactoryInterfaceFactory.java
org.allbinary.game.testgamedemo.TestDemoGameAndroidActivity.java
org.allbinary.game.testgamedemo.TestDemoGameMIDletFactory.java
org.allbinary.game.testgamedemo.TestGameDemoAndroidActivity.java
org.allbinary.game.testgamedemo.TestGameDemoAndroidOpenGLESView.java
org.allbinary.game.testgamedemo.TestGameDemoAndroidView.java
org.allbinary.game.testgamedemo.TestGameDemoMIDletFactory.java
org.allbinary.game.testgamedemo.TestGameDemoMIDlet.java
org.allbinary.game.testgamedemo.canvas.TestDemoPaintable.java
org.allbinary.game.testgamedemo.canvas.TestGameDemoGameCanvas.java
org.allbinary.game.testgamedemo.canvas.TestGameDemoHelpPaintable.java
org.allbinary.game.testgamedemo.canvas.TestGameDemoInputMappingHelpPaintable.java
org.allbinary.game.testgamedemo.canvas.TestGameDemoSoftwareInfo.java
org.allbinary.game.testgamedemo.canvas.TestGameDemoStartCanvas.java
org.allbinary.game.testgamedemo.canvas.TitleAnimationFactory.java
org.allbinary.game.testgamedemo.canvas.TitleVectorData.java
org.allbinary.game.testgamedemo.configuration.TestGameDemoGameFeatures.java
org.allbinary.game.testgamedemo.configuration.TestGameDemoGameFeatures.java
org.allbinary.game.testgamedemo.configuration.TestGameDemoGameFeatures.java
org.allbinary.game.testgamedemo.configuration.TestGameDemoGameFeatures.java
org.allbinary.game.testgamedemo.init.J2METestGameDemoStaticInitializer.java
org.allbinary.game.testgamedemo.init.J2METestGameDemoStaticInitializer.java
org.allbinary.game.testgamedemo.init.J2METestGameDemoStaticInitializer.java
org.allbinary.game.testgamedemo.init.TestGameDemoAndroidAnimationInterfaceFactoryEarlyResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoAndroidAnimationInterfaceFactoryResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoAndroidStaticInitializer.java
org.allbinary.game.testgamedemo.init.TestGameDemoJ2MEAnimationInterfaceFactoryEarlyResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoJ2MEAnimationInterfaceFactoryEarlyResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoJ2MEAnimationInterfaceFactoryEarlyResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoJ2MEAnimationInterfaceFactoryResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoJ2MEAnimationInterfaceFactoryResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoJ2MEAnimationInterfaceFactoryResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoResourceInitialization.java
org.allbinary.game.testgamedemo.init.TestGameDemoStaticInitializerFactory.java
org.allbinary.game.testgamedemo.init.TestGameDemoStaticInitializerFactory.java
org.allbinary.game.testgamedemo.init.TestGameDemoStaticInitializerFactory.java
org.allbinary.game.testgamedemo.init.TestGameDemoStaticInitializerFactory.java
org.allbinary.game.testgamedemo.init.TestGameDemoStaticInitializer.java
org.allbinary.game.testgamedemo.input.TestGameDemoGameInputMappingFactory.java
org.allbinary.game.testgamedemo.layer.TestGameDemoLayerManager.java
org.allbinary.game.testgamedemo.level.TestGameDemoLevelBuilder.java
org.allbinary.game.testgamedemo.resource.TestGameDemoAndroidEarlyResourceInitialization.java
org.allbinary.game.testgamedemo.resource.TestGameDemoAndroidResourceInitialization.java
org.allbinary.game.testgamedemo.resource.TestGameDemoJ2MEEarlyResourceInitialization.java
org.allbinary.game.testgamedemo.resource.TestGameDemoJ2MEEarlyResourceInitialization.java
org.allbinary.game.testgamedemo.resource.TestGameDemoJ2MEEarlyResourceInitialization.java
org.allbinary.game.testgamedemo.resource.TestGameDemoJ2MEResourceInitialization.java
org.allbinary.game.testgamedemo.resource.TestGameDemoJ2MEResourceInitialization.java
org.allbinary.game.testgamedemo.resource.TestGameDemoJ2MEResourceInitialization.java
org.allbinary.input.motion.button.TestGameDemoMultiTouchButtonsBuilder.java
org.allbinary.input.motion.button.TestGameDemoNeededMultiTouchButtonsBuilder.java
org.allbinary.input.motion.button.TestGameDemoNeededTouchButtonsBuilder.java
org.allbinary.input.motion.button.TestGameDemoNeededTouchButtonsBuilder.java
org.allbinary.input.motion.button.TestGameDemoNeededWithSensorTouchButtonsBuilder.java
org.allbinary.input.motion.button.TestGameDemoTouchButtonsBuilder.java
org.allbinary.input.motion.button.TestGameDemoTouchButtonsBuilder.java
org.allbinary.input.motion.button.TestGameDemoWithSensorTouchButtonsBuilder.java
org.allbinary.input.motion.button.TouchButtonAllStopResource.java
org.allbinary.logic.system.security.licensing.AbeClientInformationInterfaceFactory.java
org.allbinary.logic.system.security.licensing.AbeClientInformationInterfaceFactory.java
org.allbinary.logic.system.security.licensing.TestGameDemoAndroidMobileClientInformation.java
org.allbinary.logic.system.security.licensing.TestGameDemoPCClientInformation.java
org.allbinary.media.audio.TestGameDemoSoundsFactoryFactory.java
org.allbinary.media.audio.TestGameDemoSoundsFactoryFactory.java
org.allbinary.media.audio.TestGameDemoSoundsFactoryFactory.java
org.allbinary.media.audio.TestGameDemoSoundsFactoryFactory.java
org.allbinary.media.audio.TestGameDemoSoundsFactory.java
org.allbinary.media.audio.TestSound.java
playn.core.TestGameDemoMidletFactory.java
playn.core.TestGameDemoProcessor.java
playn.core.TestGameDemo.java
playn.html.TestGameDemoGameHtml.java
playn.java.TestGameDemoJ2SE.java
playn.shared.Protocol.java