├── assets
├── gfx
│ ├── bgm.jpg
│ ├── ice.jpg
│ ├── Wood2.jpg
│ ├── Wood3.jpg
│ ├── ball.png
│ ├── brake.png
│ ├── earth.jpg
│ ├── flip.png
│ ├── grass.jpg
│ ├── sheep.png
│ ├── snow.jpg
│ ├── stars.jpg
│ ├── wood.jpg
│ ├── Bricks.png
│ ├── Grass2.jpg
│ ├── accelBar.png
│ ├── carbody.png
│ ├── cliffs2.jpg
│ ├── cliffs3.jpg
│ ├── dirtclod.png
│ ├── earth2.jpg
│ ├── face_box.png
│ ├── leanleft.png
│ ├── pebble.png
│ ├── windows1.jpg
│ ├── wrecker.png
│ ├── accelerate.png
│ ├── doublelogo.png
│ ├── grassyrock.jpg
│ ├── leanright.png
│ ├── leftWheel.png
│ ├── moltenrock.jpg
│ ├── rightWheel.png
│ ├── strawBerry.png
│ ├── whiteRock.jpg
│ ├── checksphere.png
│ ├── frostground.jpg
│ ├── quaking_aspen.png
│ ├── concreteplates.jpg
│ ├── darkfrostground.jpg
│ ├── onscreen_control_base.png
│ ├── onscreen_control_knob.png
│ └── onscreen_control_base_2d.png
├── mfx
│ ├── thunk.wav
│ ├── CLICK21A.WAV
│ ├── bodyHit.wav
│ ├── car_idle.wav
│ ├── wheelHit.wav
│ ├── collected.wav
│ ├── minithunk.wav
│ ├── shortcrash.wav
│ └── skidtrial1.wav
├── font
│ └── Abduction.ttf
└── level
│ ├── xmc
│ ├── i3.lvl
│ ├── i4.lvl
│ ├── i2.lvl
│ ├── i6.lvl
│ ├── i29.lvl
│ ├── i7.lvl
│ ├── i26.lvl
│ ├── i5.lvl
│ ├── i20.lvl
│ ├── i1.lvl
│ ├── i19.lvl
│ ├── i28.lvl
│ ├── i18.lvl
│ ├── i25.lvl
│ ├── i27.lvl
│ ├── i31.lvl
│ └── i9.lvl
│ └── original
│ ├── l6.lvl
│ ├── l2.lvl
│ ├── l11.lvl
│ ├── l12.lvl
│ ├── l10.lvl
│ ├── l7.lvl
│ └── l3.lvl
├── libs
├── andengine.jar
├── armeabi
│ ├── libxmp.so
│ └── libandenginephysicsbox2dextension.so
├── andenginemultiplayerextension.jar
├── andenginemultitouchextension.jar
└── andenginephysicsbox2dextension.jar
├── res
├── drawable
│ ├── .directory
│ └── icon.png
├── drawable-hdpi
│ └── icon.png
├── drawable-ldpi
│ └── icon.png
├── drawable-mdpi
│ └── icon.png
├── values
│ ├── strings.xml
│ ├── attrs.xml
│ └── array.xml
├── layout
│ ├── credits.xml
│ ├── help.xml
│ └── simplelayout.xml
└── xml
│ └── gamerefs.xml
├── Licence.txt
├── .bzrignore
├── src
└── com
│ └── chozabu
│ └── android
│ └── BikeGame
│ ├── UserData.java
│ ├── GameScene.java
│ ├── ParallaxSprite.java
│ ├── GameOptions.java
│ ├── AnalogOnScreenControl2d.java
│ ├── Credits.java
│ ├── MaxStepPhysicsWorld.java
│ ├── ParallaxPoly.java
│ ├── Help.java
│ ├── JointList.java
│ ├── DownloadList.java
│ ├── LoadingJoint.java
│ ├── Sounds.java
│ ├── BikeSplashScreen.java
│ ├── LoadList.java
│ ├── StatStuff.java
│ ├── FileSystem.java
│ └── MainActivity.java
├── project.properties
├── .classpath
├── .project
├── proguard.cfg
└── AndroidManifest.xml
/assets/gfx/bgm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/bgm.jpg
--------------------------------------------------------------------------------
/assets/gfx/ice.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/ice.jpg
--------------------------------------------------------------------------------
/libs/andengine.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/libs/andengine.jar
--------------------------------------------------------------------------------
/assets/gfx/Wood2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/Wood2.jpg
--------------------------------------------------------------------------------
/assets/gfx/Wood3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/Wood3.jpg
--------------------------------------------------------------------------------
/assets/gfx/ball.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/ball.png
--------------------------------------------------------------------------------
/assets/gfx/brake.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/brake.png
--------------------------------------------------------------------------------
/assets/gfx/earth.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/earth.jpg
--------------------------------------------------------------------------------
/assets/gfx/flip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/flip.png
--------------------------------------------------------------------------------
/assets/gfx/grass.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/grass.jpg
--------------------------------------------------------------------------------
/assets/gfx/sheep.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/sheep.png
--------------------------------------------------------------------------------
/assets/gfx/snow.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/snow.jpg
--------------------------------------------------------------------------------
/assets/gfx/stars.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/stars.jpg
--------------------------------------------------------------------------------
/assets/gfx/wood.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/wood.jpg
--------------------------------------------------------------------------------
/assets/mfx/thunk.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/mfx/thunk.wav
--------------------------------------------------------------------------------
/res/drawable/.directory:
--------------------------------------------------------------------------------
1 | [Dolphin]
2 | ShowPreview=true
3 | Timestamp=2010,12,2,21,7,39
4 |
--------------------------------------------------------------------------------
/assets/gfx/Bricks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/Bricks.png
--------------------------------------------------------------------------------
/assets/gfx/Grass2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/Grass2.jpg
--------------------------------------------------------------------------------
/assets/gfx/accelBar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/accelBar.png
--------------------------------------------------------------------------------
/assets/gfx/carbody.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/carbody.png
--------------------------------------------------------------------------------
/assets/gfx/cliffs2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/cliffs2.jpg
--------------------------------------------------------------------------------
/assets/gfx/cliffs3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/cliffs3.jpg
--------------------------------------------------------------------------------
/assets/gfx/dirtclod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/dirtclod.png
--------------------------------------------------------------------------------
/assets/gfx/earth2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/earth2.jpg
--------------------------------------------------------------------------------
/assets/gfx/face_box.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/face_box.png
--------------------------------------------------------------------------------
/assets/gfx/leanleft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/leanleft.png
--------------------------------------------------------------------------------
/assets/gfx/pebble.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/pebble.png
--------------------------------------------------------------------------------
/assets/gfx/windows1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/windows1.jpg
--------------------------------------------------------------------------------
/assets/gfx/wrecker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/wrecker.png
--------------------------------------------------------------------------------
/assets/mfx/CLICK21A.WAV:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/mfx/CLICK21A.WAV
--------------------------------------------------------------------------------
/assets/mfx/bodyHit.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/mfx/bodyHit.wav
--------------------------------------------------------------------------------
/assets/mfx/car_idle.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/mfx/car_idle.wav
--------------------------------------------------------------------------------
/assets/mfx/wheelHit.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/mfx/wheelHit.wav
--------------------------------------------------------------------------------
/libs/armeabi/libxmp.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/libs/armeabi/libxmp.so
--------------------------------------------------------------------------------
/res/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/res/drawable/icon.png
--------------------------------------------------------------------------------
/assets/font/Abduction.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/font/Abduction.ttf
--------------------------------------------------------------------------------
/assets/gfx/accelerate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/accelerate.png
--------------------------------------------------------------------------------
/assets/gfx/doublelogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/doublelogo.png
--------------------------------------------------------------------------------
/assets/gfx/grassyrock.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/grassyrock.jpg
--------------------------------------------------------------------------------
/assets/gfx/leanright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/leanright.png
--------------------------------------------------------------------------------
/assets/gfx/leftWheel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/leftWheel.png
--------------------------------------------------------------------------------
/assets/gfx/moltenrock.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/moltenrock.jpg
--------------------------------------------------------------------------------
/assets/gfx/rightWheel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/rightWheel.png
--------------------------------------------------------------------------------
/assets/gfx/strawBerry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/strawBerry.png
--------------------------------------------------------------------------------
/assets/gfx/whiteRock.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/whiteRock.jpg
--------------------------------------------------------------------------------
/assets/mfx/collected.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/mfx/collected.wav
--------------------------------------------------------------------------------
/assets/mfx/minithunk.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/mfx/minithunk.wav
--------------------------------------------------------------------------------
/assets/mfx/shortcrash.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/mfx/shortcrash.wav
--------------------------------------------------------------------------------
/assets/mfx/skidtrial1.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/mfx/skidtrial1.wav
--------------------------------------------------------------------------------
/assets/gfx/checksphere.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/checksphere.png
--------------------------------------------------------------------------------
/assets/gfx/frostground.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/frostground.jpg
--------------------------------------------------------------------------------
/assets/gfx/quaking_aspen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/quaking_aspen.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/assets/gfx/concreteplates.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/concreteplates.jpg
--------------------------------------------------------------------------------
/assets/gfx/darkfrostground.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/darkfrostground.jpg
--------------------------------------------------------------------------------
/assets/gfx/onscreen_control_base.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/onscreen_control_base.png
--------------------------------------------------------------------------------
/assets/gfx/onscreen_control_knob.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/onscreen_control_knob.png
--------------------------------------------------------------------------------
/libs/andenginemultiplayerextension.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/libs/andenginemultiplayerextension.jar
--------------------------------------------------------------------------------
/libs/andenginemultitouchextension.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/libs/andenginemultitouchextension.jar
--------------------------------------------------------------------------------
/assets/gfx/onscreen_control_base_2d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/assets/gfx/onscreen_control_base_2d.png
--------------------------------------------------------------------------------
/libs/andenginephysicsbox2dextension.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/libs/andenginephysicsbox2dextension.jar
--------------------------------------------------------------------------------
/libs/armeabi/libandenginephysicsbox2dextension.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/Wheelz/master/libs/armeabi/libandenginephysicsbox2dextension.so
--------------------------------------------------------------------------------
/Licence.txt:
--------------------------------------------------------------------------------
1 | CopyRight Chozabu unless stated otherwise
2 | Levels in the xmoto classic pack are not copyright of chozabu and are licenced under the GPL
3 | assets/level/xmc/*
--------------------------------------------------------------------------------
/.bzrignore:
--------------------------------------------------------------------------------
1 | bin
2 | gen
3 | .bzrignore
4 | .classpath
5 | .directory
6 | .project
7 | .settings
8 | proguard
9 | *.BASE
10 | *.OTHER.orig
11 | *.OTHER
12 | *.THIS
13 |
14 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Wheelz
4 | Wheelz Pro
5 |
6 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/UserData.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import org.anddev.andengine.entity.shape.GLShape;
4 |
5 | public class UserData {
6 | public GLShape sprite = null;
7 | public String name = null;
8 | UserData(GLShape pSprite, String pName){
9 | sprite=pSprite;
10 | name=pName;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/GameScene.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import org.anddev.andengine.entity.scene.Scene;
4 |
5 | import android.view.KeyEvent;
6 |
7 | public interface GameScene {
8 |
9 | Scene onLoadScene();
10 | void onLoadComplete();
11 |
12 | public boolean onKeyDown(final int pKeyCode, final KeyEvent pEvent);
13 |
14 | public boolean onKeyUp(final int pKeyCode, final KeyEvent pEvent);
15 | void frameUpdate(float pSecondsElapsed);
16 | }
17 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | proguard.config=proguard.cfg
14 | # Project target.
15 | target=android-4
16 | android.library.reference.1=../../Desktop/heyzap-sdk-3.4.16/android-sdk
17 |
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Wheelz
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/res/layout/credits.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/ParallaxSprite.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import javax.microedition.khronos.opengles.GL10;
4 |
5 | import org.anddev.andengine.entity.sprite.Sprite;
6 | import org.anddev.andengine.opengl.texture.region.TextureRegion;
7 |
8 | public class ParallaxSprite extends Sprite {
9 |
10 | float parallaxX = 1f;
11 | float parallaxY = 1f;
12 |
13 | public ParallaxSprite(float pX, float pY, float pWidth, float pHeight,
14 | TextureRegion pTextureRegion) {
15 | super(pX, pY, pWidth, pHeight, pTextureRegion);
16 | }
17 | public ParallaxSprite(float pX, float pY, float pWidth, float pHeight,
18 | float parX, float parY, TextureRegion pTextureRegion) {
19 | super(pX, pY, pWidth, pHeight, pTextureRegion);
20 | setParallaxFactor(parX, parY);
21 | }
22 |
23 | public void setParallaxFactor(float parX, float parY) {
24 | parallaxX = parX;
25 | parallaxY = parY;
26 | }
27 |
28 | @Override
29 | protected void applyTranslation(final GL10 pGL) {
30 | pGL.glTranslatef(this.mX*parallaxX, this.mY*parallaxY, 0);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/res/layout/help.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/GameOptions.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import com.chozabu.android.BikeGame.R;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.preference.PreferenceActivity;
8 | import android.view.KeyEvent;
9 |
10 |
11 | public class GameOptions extends PreferenceActivity {
12 |
13 | @Override
14 | public void onCreate(Bundle icicle) {
15 | super.onCreate(icicle);
16 | addPreferencesFromResource(R.xml.gamerefs);
17 | }
18 |
19 | @Override
20 | public boolean onKeyUp(final int pKeyCode, final KeyEvent pEvent) {
21 | if (pEvent.getAction() != KeyEvent.ACTION_UP)
22 | return super.onKeyUp(pKeyCode, pEvent);
23 | if (pKeyCode == KeyEvent.KEYCODE_BACK) {
24 | Intent mainMenuIntent = new Intent(GameOptions.this, MainActivity.class);
25 | startActivity(mainMenuIntent);
26 | quitFunc();
27 | return true;
28 | }
29 | return super.onKeyUp(pKeyCode, pEvent);
30 | }
31 |
32 | @Override
33 | public boolean onKeyDown(final int pKeyCode, final KeyEvent pEvent) {
34 | if (pEvent.getAction() != KeyEvent.ACTION_DOWN)
35 | return super.onKeyUp(pKeyCode, pEvent);
36 | if (pKeyCode == KeyEvent.KEYCODE_BACK) {
37 | return true;
38 | }
39 | return super.onKeyDown(pKeyCode, pEvent);
40 | }
41 |
42 | void quitFunc(){
43 | this.finish();
44 | //System.exit(0);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/AnalogOnScreenControl2d.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import org.anddev.andengine.engine.camera.Camera;
4 | import org.anddev.andengine.engine.camera.hud.controls.AnalogOnScreenControl;
5 | import org.anddev.andengine.engine.camera.hud.controls.AnalogOnScreenControl.IAnalogOnScreenControlListener;
6 | import org.anddev.andengine.input.touch.TouchEvent;
7 | import org.anddev.andengine.opengl.texture.region.TextureRegion;
8 |
9 | //import AnalogOnScreenControl;
10 |
11 | public class AnalogOnScreenControl2d extends AnalogOnScreenControl {
12 |
13 | public AnalogOnScreenControl2d(int pX, int pY, Camera pCamera,
14 | TextureRegion pControlBaseTextureRegion,
15 | TextureRegion pControlKnobTextureRegion, float pTimeBetweenUpdates,
16 | long pOnControlClickMaximumMilliseconds,
17 | IAnalogOnScreenControlListener pAnalogOnScreenControlListener) {
18 | super(pX, pY, pCamera, pControlBaseTextureRegion, pControlKnobTextureRegion,
19 | pTimeBetweenUpdates, pOnControlClickMaximumMilliseconds,
20 | pAnalogOnScreenControlListener);
21 | }
22 |
23 |
24 | @Override
25 | protected boolean onHandleControlBaseTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
26 | //super.mClickDetector.onSceneTouchEvent(null, pSceneTouchEvent);
27 | return super.onHandleControlBaseTouched(pSceneTouchEvent, pTouchAreaLocalX, this.getControlBase().getBaseHeight()/2f);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/res/layout/simplelayout.xml:
--------------------------------------------------------------------------------
1 |
5 |
9 |
14 |
15 |
16 |
21 |
22 |
29 |
30 |
31 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/proguard.cfg:
--------------------------------------------------------------------------------
1 | -optimizationpasses 5
2 | -dontusemixedcaseclassnames
3 | -dontskipnonpubliclibraryclasses
4 | -dontpreverify
5 | -verbose
6 | -ignorewarnings
7 | -dontoptimize
8 |
9 | -keep public class * extends android.app.Activity
10 | -keep public class * extends android.app.Application
11 | -keep public class * extends android.app.Service
12 | -keep public class * extends android.content.BroadcastReceiver
13 | -keep public class * extends android.content.ContentProvider
14 | -keep public class com.android.vending.licensing.ILicensingService
15 |
16 | -keep public class com.badlogic.** {*;}
17 | -keep public class org.anddev.** {*;}
18 |
19 | -keep public class * extends Android.view.View {
20 | public (android.content.Context);
21 | public (android.content.Context, android.util.AttributeSet);
22 | public (android.content.Context, android.util.AttributeSet, int);
23 | public void set*(...);
24 | }
25 |
26 | -keepclasseswithmembernames class * {
27 | native ;
28 | }
29 |
30 | -keepclasseswithmembers class * {
31 | public (android.content.Context, android.util.AttributeSet);
32 | }
33 |
34 | -keepclasseswithmembers class * {
35 | public (android.content.Context, android.util.AttributeSet, int);
36 | }
37 |
38 | -keepclassmembers enum * {
39 | public static **[] values();
40 | public static ** valueOf(java.lang.String);
41 | }
42 |
43 | -keep class * implements android.os.Parcelable {
44 | public static final android.os.Parcelable$Creator *;
45 | }
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/Credits.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import com.chozabu.android.BikeGame.R;
4 |
5 | import android.app.Activity;
6 | import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.view.KeyEvent;
9 | import android.view.View;
10 | import android.view.View.OnClickListener;
11 | import android.widget.Button;
12 |
13 | public class Credits extends Activity implements OnClickListener {
14 |
15 | private Button emailButton;
16 | /** Called when the activity is first created. */
17 | @Override
18 | public void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 | setContentView(R.layout.credits);
21 |
22 |
23 |
24 | // Get referenc to Email Button
25 | this.emailButton = (Button) this.findViewById(R.id.EmailButton);
26 |
27 | // Sets the Event Listener onClick
28 | this.emailButton.setOnClickListener(this);
29 |
30 | }
31 |
32 |
33 | @Override
34 | public void onClick(View view) {
35 | if (view == this.emailButton)
36 | {
37 | StatStuff.sendMail(this);
38 | }
39 | }
40 |
41 | @Override
42 | public boolean onKeyDown(final int pKeyCode, final KeyEvent pEvent) {
43 | if (pEvent.getAction() != KeyEvent.ACTION_DOWN)
44 | return super.onKeyDown(pKeyCode, pEvent);
45 | if (pKeyCode == KeyEvent.KEYCODE_BACK) {
46 | Intent mainMenuIntent = new Intent(Credits.this, MainActivity.class);
47 | startActivity(mainMenuIntent);
48 | this.finish();
49 | //System.exit(0);
50 | return true;
51 | }
52 | return super.onKeyUp(pKeyCode, pEvent);
53 | }
54 | }
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/MaxStepPhysicsWorld.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import org.anddev.andengine.extension.physics.box2d.PhysicsWorld;
4 |
5 | //import android.util.Log;
6 |
7 | import android.os.Debug;
8 | import android.util.Log;
9 |
10 | import com.badlogic.gdx.math.Vector2;
11 | //import com.badlogic.gdx.physics.box2d.World;
12 |
13 | public class MaxStepPhysicsWorld extends PhysicsWorld {
14 |
15 | public static final int STEPSPERSECOND_DEFAULT = 60;
16 |
17 |
18 | private final float mStepLength;
19 |
20 |
21 | public MaxStepPhysicsWorld(final int pStepsPerSecond, final Vector2 pGravity, final boolean pAllowSleep) {
22 | super(pGravity, pAllowSleep);
23 | this.mStepLength = 1.0f / pStepsPerSecond;
24 | }
25 |
26 | public MaxStepPhysicsWorld(final int pStepsPerSecond, final Vector2 pGravity, final boolean pAllowSleep, final int pVelocityIterations, final int pPositionIterations) {
27 | super(pGravity, pAllowSleep, pVelocityIterations, pPositionIterations);
28 | this.mStepLength = 1.0f / pStepsPerSecond;
29 | }
30 |
31 | public float getStepLength(){
32 | return this.mStepLength;
33 | }
34 |
35 |
36 | @Override
37 | public void onUpdate(final float pSecondsElapsed) {
38 | this.mRunnableHandler.onUpdate(this.mStepLength);
39 |
40 | //float stepLength;// = pSecondsElapsed;
41 | //if(pSecondsElapsed>= this.mStepLength || true){
42 | // stepLength = this.mStepLength;
43 | //Log.i("ABike","WARNING LOW FPS - GOING SLOWMO!");
44 | //}
45 | this.mWorld.step(this.mStepLength, this.mVelocityIterations, this.mPositionIterations);
46 |
47 | this.mPhysicsConnectorManager.onUpdate(this.mStepLength);
48 | //Log.i("IAMMAREADER", ""+1.0f/stepLength);
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/ParallaxPoly.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import javax.microedition.khronos.opengles.GL10;
4 |
5 | import org.anddev.andengine.engine.camera.Camera;
6 | import org.anddev.andengine.entity.primitive.Polygon;
7 | import org.anddev.andengine.opengl.texture.region.PolygonTextureRegion;
8 |
9 | public class ParallaxPoly extends Polygon {
10 |
11 | float parallaxX = 1f;
12 | float parallaxY = 1f;
13 |
14 | float translateX = 0f;
15 | float translateY = 0f;
16 |
17 | Camera camera;
18 |
19 | public ParallaxPoly(float pX, float pY, float[] pVertices,
20 | PolygonTextureRegion pTextureRegion, Camera cam) {
21 | super(pX, pY, pVertices, pTextureRegion);
22 | camera = cam;
23 | }
24 | public ParallaxPoly(float pX, float pY,float parX, float parY, float[] pVertices,
25 | PolygonTextureRegion pTextureRegion, Camera cam) {
26 | super(pX, pY, pVertices, pTextureRegion);
27 | setParallaxFactor(parX, parY);
28 | camera = cam;
29 | }
30 |
31 | public void setParallaxFactor(float parX, float parY) {
32 | parallaxX = parX;
33 | parallaxY = parY;
34 | }
35 | float offsetX = 0;
36 | float offsetY = 0;
37 | public void setOffsetCentre(float pX, float pY){
38 | offsetX=mX-pX;
39 | offsetY=mY-pY;
40 | }
41 |
42 | private void calcPos(){
43 | float cx = camera.getCenterX();
44 | float cy = camera.getCenterY();
45 | float xd= cx-mX;
46 | float yd= cy-mY;
47 | //+offsetX*(xd*parallaxX)
48 | translateX=mX+xd*(1f-parallaxX);
49 | translateY=mY+yd*(1f-parallaxY);
50 | }
51 |
52 | @Override
53 | protected void applyTranslation(final GL10 pGL) {
54 | calcPos();
55 | pGL.glTranslatef(translateX, translateY, 0);
56 | //pGL.glTranslatef(this.mX, this.mY, 0);
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/Help.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import com.chozabu.android.BikeGame.R;
4 |
5 | import android.app.Activity;
6 | import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.view.KeyEvent;
9 | import android.view.View;
10 | import android.view.View.OnClickListener;
11 | import android.widget.Button;
12 |
13 | public class Help extends Activity implements OnClickListener {
14 |
15 | private Button emailButton;
16 | private Button optionsButton;
17 |
18 | /** Called when the activity is first created. */
19 | @Override
20 | public void onCreate(Bundle savedInstanceState) {
21 | super.onCreate(savedInstanceState);
22 | setContentView(R.layout.help);
23 |
24 | // Get referenc to Email Button
25 | this.emailButton = (Button) this.findViewById(R.id.EmailButton);
26 | // this.optionsButton = (Button) this.findViewById(R.id.OptionsButton);
27 |
28 | // Sets the Event Listener onClick
29 | this.emailButton.setOnClickListener(this);
30 | // this.optionsButton.setOnClickListener(this);
31 |
32 | }
33 |
34 | @Override
35 | public void onClick(View view) {
36 | if (view == this.emailButton) {
37 | StatStuff.sendMail(this);
38 | } else if (view == this.optionsButton) {
39 |
40 | }
41 | }
42 |
43 | @Override
44 | public boolean onKeyDown(final int pKeyCode, final KeyEvent pEvent) {
45 | if (pEvent.getAction() != KeyEvent.ACTION_DOWN)
46 | return super.onKeyDown(pKeyCode, pEvent);
47 | if (pKeyCode == KeyEvent.KEYCODE_BACK) {
48 | Intent mainMenuIntent = new Intent(Help.this, MainActivity.class);
49 | startActivity(mainMenuIntent);
50 | this.finish();
51 | //System.exit(0);
52 | return true;
53 | }
54 | return super.onKeyUp(pKeyCode, pEvent);
55 | }
56 |
57 | }
--------------------------------------------------------------------------------
/assets/level/xmc/i3.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Paxed Alpha
5 |
6 | paxed@alt.org
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/assets/level/xmc/i4.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Paxed Bravo
5 |
6 | paxed@alt.org
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/JointList.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import java.util.Iterator;
4 | import java.util.LinkedList;
5 | import java.util.List;
6 |
7 | import org.anddev.andengine.entity.shape.Shape;
8 | import org.anddev.andengine.entity.sprite.Sprite;
9 |
10 | import com.badlogic.gdx.math.Vector2;
11 | import com.badlogic.gdx.physics.box2d.Body;
12 |
13 | public class JointList {
14 |
15 | static List jointDefs = new LinkedList();
16 |
17 | //static List bodyDefs = new LinkedList();
18 | //static List bodyNames = new LinkedList();
19 |
20 | static void add(Vector2 pos,String jointStart,String jointEnd,String jointType){
21 | LoadingJoint lj = new LoadingJoint(pos.cpy(),jointStart,jointEnd,jointType);
22 | jointDefs.add(lj);
23 | }
24 |
25 | public static void passBody(String blockName, Body bod) {
26 | Iterator vi = jointDefs.iterator();
27 | while (vi.hasNext()) {
28 | LoadingJoint current = vi.next();
29 | //if(current.contains(blockName)){
30 | current.pair(blockName,bod);
31 | //}
32 | }
33 |
34 | }
35 | public static void reset(){
36 | jointDefs.clear();
37 | }
38 |
39 | public static void makeJoints(GameWorld gameWorld) {
40 | gameWorld.mPhysicsWorld.getBodies();
41 |
42 | Iterable bs = gameWorld.mPhysicsWorld.getBodies();
43 | for (Body b : bs) {
44 | UserData ud = (UserData)b.getUserData();
45 | if (ud == null)
46 | continue;
47 | if (ud.name == null)
48 | continue;
49 | passBody(ud.name,b);
50 | //final Shape shape = ((UserData) b.getUserData()).sprite;
51 | //final Body body = b;
52 | }
53 |
54 | Iterator vi = jointDefs.iterator();
55 | while (vi.hasNext()) {
56 | LoadingJoint current = vi.next();
57 | //if(current.contains(blockName)){
58 | current.makeJoint(gameWorld);
59 | //}
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/DownloadList.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import java.util.Iterator;
4 |
5 | //import org.json.JSONArray;
6 | import org.json.JSONException;
7 | import org.json.JSONObject;
8 |
9 | import android.app.ListActivity;
10 | //import android.content.Intent;
11 | import android.os.Bundle;
12 | import android.util.Log;
13 | import android.view.View;
14 | import android.widget.ArrayAdapter;
15 | import android.widget.ListView;
16 | import android.widget.Toast;
17 |
18 | public class DownloadList extends ListActivity {
19 | private String[] levelNames;
20 | private String[] levelIDs;
21 | @Override
22 | public void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setTitle("Download PP Worlds");
25 |
26 | String lList = FileSystem.getLevelList("default", 10);
27 | JSONObject levels;
28 |
29 | try {
30 | levels = new JSONObject(lList);
31 | levelNames = new String[levels.length()];
32 | levelIDs = new String[levels.length()];
33 | Iterator keys = levels.keys();
34 | int i=0;
35 | while (keys.hasNext()){//
36 | JSONObject level = levels.getJSONObject(keys.next());
37 | String Id = level.getString("name")+"("+level.getString("author")+")";
38 | levelNames[i] = Id;//level.getString("name");
39 | levelIDs[i] = level.getString("filename");
40 | i++;
41 | }
42 | } catch (JSONException e) {
43 | e.printStackTrace();
44 | return;
45 | }
46 |
47 | setListAdapter(new ArrayAdapter(this,
48 | android.R.layout.simple_list_item_1, levelNames));
49 | getListView().setTextFilterEnabled(true);
50 | }
51 |
52 | @Override
53 | protected void onListItemClick(ListView l, View v, int position, long id) {
54 | super.onListItemClick(l, v, position, id);
55 | String toDl = levelIDs[position];
56 | String newLevel = FileSystem.downloadLevel(toDl);
57 | //Log.i("PPground", newLevel);
58 | Toast.makeText(getApplicationContext(), "downloaded: "+levelNames[position], Toast.LENGTH_SHORT).show();
59 |
60 | FileSystem.writeFile(levelIDs[position], newLevel);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/assets/level/xmc/i2.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Hillclimbing
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/LoadingJoint.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import android.util.Log;
4 |
5 | import com.badlogic.gdx.math.Vector2;
6 | import com.badlogic.gdx.physics.box2d.Body;
7 | import com.badlogic.gdx.physics.box2d.JointDef;
8 | import com.badlogic.gdx.physics.box2d.joints.RevoluteJointDef;
9 | import com.badlogic.gdx.physics.box2d.joints.WeldJointDef;
10 | import com.badlogic.gdx.physics.box2d.joints.DistanceJointDef;
11 |
12 | public class LoadingJoint {
13 | Vector2 pos;
14 | String jointStart;
15 | Body start = null;
16 | String jointEnd;
17 | Body end = null;
18 | String jointType;
19 | //boolean foundStart = false;
20 | //boolean foundEnd = false;
21 | LoadingJoint(Vector2 posIn,String jointStartIn,String jointEndIn,String jointTypeIn){
22 | pos=posIn;
23 | jointStart=jointStartIn;
24 | jointEnd=jointEndIn;
25 | jointType=jointTypeIn;
26 | //Log.d("ABike","got a joint");
27 | }
28 | public void pair(String blockName, Body bod) {
29 | if (blockName.compareTo(jointStart)==0){
30 | start = bod;
31 | //Log.d("ABike","got start:"+blockName);
32 | return;
33 | }else if (blockName.compareTo(jointEnd)==0){
34 | end = bod;
35 | //Log.d("ABike","got end:"+blockName);
36 | return;
37 | }
38 |
39 | }
40 | public void makeJoint(GameWorld gameWorld) {
41 |
42 | if(start==null || end==null){
43 | //Log.d("ABike","failed to make joint - needs 2 bodies!");
44 | return;
45 | }
46 | //DistanceJointDef djd = new DistanceJointDef();
47 | //WeldJointDef wjd = new WeldJointDef();
48 | //wjd.initialize(start, end, start.getPosition());
49 | //djd.initialize(start, end, start.getPosition(), end.getPosition());
50 | //djd.frequencyHz=30.0f;
51 | //djd.dampingRatio=0.001f;
52 | //djd.
53 | //gameWorld.mPhysicsWorld.createJoint(wjd);
54 |
55 | if(jointType.equals("pivot")){
56 |
57 | RevoluteJointDef jd = new RevoluteJointDef();
58 | jd.initialize(start, end, pos);
59 | //Log.d("ABike","made a piviot joint");
60 | gameWorld.mPhysicsWorld.createJoint(jd);
61 | }else if(jointType.equals("pin")){
62 |
63 | DistanceJointDef djd = new DistanceJointDef();
64 | djd.initialize(start, end, start.getPosition(), end.getPosition());
65 | //Log.d("ABike","made a pin joint");
66 | gameWorld.mPhysicsWorld.createJoint(djd);
67 | }else if(jointType.equals("pin2point")){
68 |
69 | DistanceJointDef djd = new DistanceJointDef();
70 | djd.initialize(start, end, start.getPosition(), pos);
71 | //Log.d("ABike","made a pin2point joint");
72 | gameWorld.mPhysicsWorld.createJoint(djd);
73 | }
74 |
75 |
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/res/values/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - Highest
5 | - High
6 | - Normal
7 | - Low
8 | - Lowest
9 |
10 |
11 | - 0.25
12 | - 0.15
13 | - 0.01
14 | - -0.15
15 | - -0.2
16 |
17 |
18 |
19 |
20 | - Hard
21 | - Normal
22 | - Soft
23 |
24 |
25 | - Long
26 | - Normal
27 | - Short
28 |
29 |
30 | - 1.1
31 | - 1.0
32 | - 0.9
33 |
34 |
35 | - 1.2
36 | - 1.1
37 | - 1.0
38 | - 0.9
39 | - 0.8
40 |
41 |
42 |
43 | - Giant
44 | - Big
45 | - Normal
46 | - Small
47 | - Tiny
48 |
49 |
50 | - 48
51 | - 45
52 | - 42
53 | - 39
54 | - 36
55 |
56 |
57 |
58 |
59 | - 60
60 | - 50
61 | - 40
62 | - 35
63 | - 30
64 | - 25
65 | - 20
66 |
67 |
68 |
69 | - 60
70 | - 50
71 | - 40
72 | - 35
73 | - 30
74 | - 25
75 | - 20
76 |
77 |
78 |
79 |
80 | - Buttons
81 | - Acceleration Bar
82 | - Acceleration Joystick
83 |
84 |
85 |
86 | - Buttons
87 | - accelBar
88 | - accelStick
89 |
90 |
91 |
92 | - Buttons
93 | - Accelerometer
94 | - Share Acceleration Joystick
95 | - Lean Stick
96 |
97 |
98 | - Buttons
99 | - Accelerometer
100 | - accelStick
101 | - leanStick
102 |
103 |
104 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/Sounds.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import java.io.IOException;
4 |
5 | import org.anddev.andengine.audio.sound.Sound;
6 | import org.anddev.andengine.audio.sound.SoundFactory;
7 | import org.anddev.andengine.ui.activity.BaseGameActivity;
8 | import org.anddev.andengine.util.Debug;
9 |
10 | import android.content.SharedPreferences;
11 | import android.preference.PreferenceManager;
12 | import android.util.Log;
13 |
14 |
15 |
16 | public class Sounds {
17 |
18 | BaseGameActivity root = null;
19 | public Sound mEngineSound = null;
20 | public Sound mBeBoopSound = null;
21 | public Sound mCrashSound = null;
22 | public Sound mCollectedSound = null;
23 | //public Sound mThunkSound = null;
24 | //public Sound mMThunkSound = null;
25 | public Sound mHitBodySound = null;
26 | public Sound mHitWheelSound = null;
27 | public Sound mSkidSound = null;
28 | private SharedPreferences prefs;
29 |
30 | public void init(BaseGameActivity rootIn){
31 | root = rootIn;
32 | SoundFactory.setAssetBasePath("mfx/");
33 | try {
34 | mEngineSound = SoundFactory.createSoundFromAsset(root.getEngine().getSoundManager(), root, "car_idle.wav");
35 | mBeBoopSound = SoundFactory.createSoundFromAsset(root.getEngine().getSoundManager(), root, "CLICK21A.WAV");
36 | mCrashSound = SoundFactory.createSoundFromAsset(root.getEngine().getSoundManager(), root, "shortcrash.wav");
37 | mCollectedSound = SoundFactory.createSoundFromAsset(root.getEngine().getSoundManager(), root, "collected.wav");
38 | mHitBodySound = SoundFactory.createSoundFromAsset(root.getEngine().getSoundManager(), root, "bodyHit.wav");
39 | mHitWheelSound = SoundFactory.createSoundFromAsset(root.getEngine().getSoundManager(), root, "wheelHit.wav");
40 | mSkidSound = SoundFactory.createSoundFromAsset(root.getEngine().getSoundManager(), root, "skidtrial1.wav");
41 | } catch (final IOException e) {
42 | Debug.e("Error", e);
43 | }
44 | prefs = PreferenceManager.getDefaultSharedPreferences(root);
45 |
46 |
47 | //Log.i("ABike","LOADED SOUNDS");
48 | }
49 | public void stop(){
50 | if(mEngineSound==null)return;
51 | mEngineSound.stop();
52 | mSkidSound.stop();
53 | }
54 | public void start(){
55 | if(mEngineSound==null)return;
56 | if(!prefs.getBoolean("soundOn", true))return;
57 | mEngineSound.setLooping(true);
58 | mEngineSound.setRate(0.5f);
59 | mEngineSound.setVolume(0.3f);
60 | mSkidSound.setLooping(true);
61 | //mSkidSound.setRate
62 | mSkidSound.setVolume(0f);
63 | mSkidSound.stop();
64 | mSkidSound.play();
65 | //if(prefs.getBoolean("soundOn", true))
66 | //Log.i("ABike","PLAYING SOUNDS");
67 | mEngineSound.stop();
68 | mEngineSound.play();
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/BikeSplashScreen.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 |
4 | import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
5 | import org.anddev.andengine.opengl.texture.source.AssetTextureSource;
6 | import org.anddev.andengine.opengl.texture.source.ITextureSource;
7 | import org.anddev.andengine.ui.activity.BaseSplashActivity;
8 |
9 | //import com.openfeint.api.OpenFeintDelegate;
10 | //import com.openfeint.api.OpenFeintSettings;
11 |
12 | import android.app.Activity;
13 | import android.content.SharedPreferences;
14 | import android.content.SharedPreferences.Editor;
15 | import android.os.Bundle;
16 | import android.os.Debug;
17 | import android.os.Looper;
18 | import android.preference.PreferenceManager;
19 | import android.widget.Toast;
20 |
21 |
22 | import android.os.Handler;
23 |
24 | public class BikeSplashScreen extends BaseSplashActivity {
25 | // ===========================================================
26 | // Constants
27 | // ===========================================================
28 |
29 | private static final int SPLASH_DURATION = 2;
30 | private static final float SPLASH_SCALE_FROM = 0.5f;
31 | public void onStart()
32 | {
33 | super.onStart();
34 | }
35 | public void onStop()
36 | {
37 | super.onStop();
38 | }
39 |
40 |
41 | @Override
42 | public void onLoadComplete() {
43 | //Debug.startMethodTracing("abike");
44 | final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
45 | int playCount = prefs.getInt("playCount", 0);
46 | playCount++;
47 |
48 | Editor edit = prefs.edit();
49 | edit.putInt("playCount", playCount);
50 | edit.commit();
51 |
52 | }
53 |
54 |
55 |
56 | @Override
57 | protected void onCreate(Bundle savedInstanceState) {
58 | super.onCreate(savedInstanceState);
59 | }
60 | @Override
61 | protected void onDestroy() {
62 | super.onDestroy();
63 | //Toast.makeText(this.getApplicationContext(), "Loading", Toast.LENGTH_SHORT).show();
64 | }
65 |
66 |
67 | @Override
68 | protected ScreenOrientation getScreenOrientation() {
69 | // TODO check real orientation ?
70 | return ScreenOrientation.LANDSCAPE;
71 | }
72 |
73 | @Override
74 | protected ITextureSource onGetSplashTextureSource() {
75 | return new AssetTextureSource(this, "gfx/doublelogo.png");
76 | }
77 |
78 | @Override
79 | protected float getSplashDuration() {
80 | return SPLASH_DURATION;
81 | }
82 |
83 | @Override
84 | protected float getSplashScaleFrom() {
85 | return SPLASH_SCALE_FROM;
86 | }
87 |
88 | @Override
89 | protected Class extends Activity> getFollowUpActivity() {
90 | return MainActivity.class;
91 | }
92 |
93 | }
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/LoadList.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 |
4 | import android.app.ListActivity;
5 | import android.content.Intent;
6 | //import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.view.KeyEvent;
9 | import android.view.View;
10 | import android.widget.ArrayAdapter;
11 | import android.widget.ListView;
12 | import android.widget.Toast;
13 |
14 | public class LoadList extends ListActivity {
15 | private String[] levelNames;
16 | //private String[] levelIDs;
17 | @Override
18 | public void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 | setTitle("Load Level");
21 |
22 | levelNames = FileSystem.getFileNames();
23 | if (levelNames == null){
24 | Toast.makeText(getApplicationContext(), "This is to load levels you have made\nfrom /sdcard/xlvls/", Toast.LENGTH_SHORT).show();
25 | return;
26 | }
27 | if(levelNames.length == 0){
28 | Toast.makeText(getApplicationContext(), "This is to load levels you have made\nfrom /sdcard/xlvls/", Toast.LENGTH_SHORT).show();
29 | return;
30 | }
31 | setListAdapter(new ArrayAdapter(this,
32 | android.R.layout.simple_list_item_1, levelNames));
33 | getListView().setTextFilterEnabled(true);
34 |
35 | }
36 |
37 | @Override
38 | public boolean onKeyDown(final int pKeyCode, final KeyEvent pEvent) {
39 | if (pEvent.getAction() != KeyEvent.ACTION_DOWN)
40 | return super.onKeyDown(pKeyCode, pEvent);
41 | if (pKeyCode == KeyEvent.KEYCODE_BACK){
42 | return true;
43 | }
44 |
45 | return super.onKeyDown(pKeyCode, pEvent);
46 | }
47 |
48 | @Override
49 | public boolean onKeyUp(final int pKeyCode, final KeyEvent pEvent) {
50 | if (pKeyCode == KeyEvent.KEYCODE_BACK){
51 | Intent StartGameIntent = new Intent(LoadList.this,MainActivity.class);
52 | startActivity(StartGameIntent);
53 | //System.exit(0);
54 | this.finish();
55 | return true;
56 | }
57 | return super.onKeyUp(pKeyCode, pEvent);
58 | }
59 |
60 | @Override
61 | protected void onListItemClick(ListView l, View v, int position, long id) {
62 | super.onListItemClick(l, v, position, id);
63 | Intent StartGameIntent = new Intent(LoadList.this,MainActivity.class);
64 | StartGameIntent.putExtra("com.chozabu.android.BikeGame.toLoad", levelNames[position]);
65 | startActivity(StartGameIntent);
66 | //System.exit(0);
67 | this.finish();
68 | //String toDl = levelIDs[position];
69 | //String newLevel = FileSystem.downloadLevel(toDl);
70 | //Log.i("PPground", newLevel);
71 | //Toast.makeText(getApplicationContext(), "downloaded: "+levelNames[position], Toast.LENGTH_SHORT).show();
72 |
73 | //FileSystem.writeFile(levelIDs[position], newLevel);
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/assets/level/xmc/i6.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Paxed Delta
5 |
6 | paxed@alt.org
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/assets/level/xmc/i29.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Master of Pie
5 |
6 |
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/assets/level/xmc/i7.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Paxed Echo
5 |
6 | paxed@alt.org
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
17 |
18 |
19 |
20 |
22 |
23 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
64 |
65 |
66 |
67 |
68 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/assets/level/xmc/i26.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | GreenHill
5 |
6 |
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/assets/level/xmc/i5.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Paxed Charlie
5 |
6 | paxed@alt.org
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/res/xml/gamerefs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
11 |
12 |
15 |
17 |
20 |
21 |
22 |
23 |
25 |
29 |
33 |
36 |
40 |
44 |
47 |
50 |
51 |
52 |
54 |
58 |
62 |
66 |
70 |
71 |
75 |
76 |
77 |
78 |
80 |
81 |
--------------------------------------------------------------------------------
/assets/level/xmc/i20.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Recursion
5 | Havn't I seen that before ?
6 | Clive Crous
7 | 09/11/2005
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/StatStuff.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import android.app.Activity;
4 | import android.content.ComponentName;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.content.pm.PackageInfo;
8 | import android.net.Uri;
9 |
10 | public class StatStuff {
11 | public static final int CAMERA_WIDTH = 800;
12 | public static final int CAMERA_HEIGHT = 480;
13 | public static final String dbt = "ABike";
14 | public static final float menuSpacing = 10f;
15 | public static final int originalPackID = 0;
16 | public static final int xmClassicPackID = 1;
17 | public static final int janPackID = 2;
18 | public static final int bonusPackID = 3;
19 | public static final int tWheelPackID = 4;
20 | //free="3HXVXYADVUY16UGGWCWZ" pro="W51CCN4DSZYGJ52XFUSS"
21 | public static final String flurryKey = "W51CCN4DSZYGJ52XFUSS";
22 |
23 | public static final String[] packCompletedID = {"768973","768983","782982","822422","1720812","ERR"};//
24 | public static final String[] packNames = {"ORIGNAL","XMCLASSIC","JAN-PACK","BONUS PACK","Third Wheel PACK"};
25 | public static final String[] packPrefix = {"level/original/l","level/xmc/i","level/janpack/l","level/propack/l","level/thirdwheel/l"};
26 | public static final String[] originalScoresID = {
27 | "605944", "605954", "605964", "605974",
28 | "605984", "605994", "606004", "606014",
29 | "606024", "606034", "606044", "606054",
30 | "606064", "606074", "606084", "606094",
31 | "ERROR"
32 | };
33 | public static final String[] xmClassicScoresID = {
34 | "606104", "606114", "606124", "606134",
35 | "606144", "606154", "606164", "606174",
36 | "606184", "606194", "606204", "606214",
37 | "606224", "606234", "606244", "606254",
38 | "606264", "606274", "606284", "606294",
39 | "606304", "606314", "606324", "606334",
40 | "606344", "606354", "606364", "606374",
41 | "606384", "606394", "606404", "606414",
42 | "ERROR"
43 | };
44 | public static final String[] janPackScoresID = {
45 | "610064", "610074", "610084", "613964",
46 | "615524", "620194", "622654", "632984",
47 | "ERROR"
48 | };
49 | public static final String[] bonusPackScoresID = {
50 | "642444", "695296", "695306",
51 | "ERROR"
52 | };
53 | public static final String[] tWheelPackScoresID = {
54 | "1208887", "1208897", "1208907",
55 | "ERROR"
56 | };
57 |
58 |
59 | public static final String[][] levelScoreIDs = {originalScoresID,xmClassicScoresID,janPackScoresID,bonusPackScoresID,tWheelPackScoresID};
60 | public static final int[] packLevelCount = {17,33,9,4,4};// 1 more than lvl num
61 | //
62 | public static final boolean isDemo = false;
63 | public static boolean isDev = false;
64 | public static boolean isWinner = false;
65 |
66 | /* The categories. */
67 | public static final short CATEGORYBIT_FG_DYNAMIC = 1;
68 | public static final short CATEGORYBIT_BG_DYNAMIC = 2;
69 | public static final short CATEGORYBIT_FG_STATIC = 4;
70 | public static final short CATEGORYBIT_BG_STATIC= 8;
71 |
72 | /* And what should collide with what. */
73 | public static final short MASKBITS_FG_DYNAMIC = CATEGORYBIT_FG_DYNAMIC+CATEGORYBIT_FG_STATIC;
74 | public static final short MASKBITS_BG_DYNAMIC = CATEGORYBIT_BG_DYNAMIC+CATEGORYBIT_BG_STATIC+CATEGORYBIT_FG_STATIC;
75 | public static final short MASKBITS_FG_STATIC = CATEGORYBIT_FG_DYNAMIC+CATEGORYBIT_BG_DYNAMIC;
76 | public static final short MASKBITS_BG_STATIC = CATEGORYBIT_BG_DYNAMIC;
77 |
78 |
79 | public static void marketLite(Activity currentActivity){
80 | //String updateURI = "http://www.amazon.com/gp/mas/dl/android?p=com.chozabu.android.LightBikeGame";
81 | String updateURI = "market://details?id=com.chozabu.android.LightBikeGame";
82 | Intent updateIntent = new Intent(Intent.ACTION_VIEW,
83 | Uri.parse(updateURI));
84 | currentActivity.startActivity(updateIntent);
85 | }
86 | public static void marketFull(Activity currentActivity){
87 | String updateURI = "market://details?id=com.chozabu.android.BikeGame";
88 | //String updateURI = "http://www.amazon.com/gp/mas/dl/android?p=com.chozabu.android.BikeGame";
89 | Intent updateIntent = new Intent(Intent.ACTION_VIEW,
90 | Uri.parse(updateURI));
91 | currentActivity.startActivity(updateIntent);
92 | }
93 | public static void sendMail(Activity currentActivity){
94 | Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
95 | emailIntent.setType("text/plain");
96 | emailIntent.putExtra(android.content.Intent.EXTRA_TITLE, currentActivity.getString(R.string.email_name));
97 | emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, currentActivity.getString(R.string.email_name));
98 | emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
99 | "delete this text to avoid my wheelz spam filter"
100 | );
101 | String[] address = new String[1];
102 | address[0] = "chozabu+wheelzpro@gmail.com";
103 | //String[] address2 = String[new String("a")];
104 | emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, address);
105 |
106 |
107 | // Obtain refenerenc to String and pass it to Intent
108 | //emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, getString(R.string.my_text));
109 | currentActivity.startActivity(emailIntent);
110 | }
111 |
112 | }
113 |
--------------------------------------------------------------------------------
/assets/level/xmc/i1.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Max Power
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
--------------------------------------------------------------------------------
/assets/level/xmc/i19.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Just For Fun
5 |
6 | Cow
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
--------------------------------------------------------------------------------
/assets/level/xmc/i28.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SuperTostos
5 |
6 | Torben Green
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
--------------------------------------------------------------------------------
/assets/level/original/l6.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Rock Fall
5 | Escape Falling Rocks!
6 | Chozabu
7 | 2010-12-09
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
--------------------------------------------------------------------------------
/assets/level/xmc/i18.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Free Fall
5 |
6 |
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
--------------------------------------------------------------------------------
/assets/level/original/l2.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Walk the Plank!
5 |
6 | chozabu
7 | 2010-12-09
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
--------------------------------------------------------------------------------
/assets/level/xmc/i25.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | GreenHell
5 |
6 | Torben Green
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
--------------------------------------------------------------------------------
/assets/level/original/l11.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Inside the Ball
5 |
6 | Chozabu
7 | 2010-12-12
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/FileSystem.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | //import java.io.File;
4 | import java.io.*;
5 | import java.util.ArrayList;
6 | import java.util.List;
7 |
8 | import org.apache.http.HttpEntity;
9 | import org.apache.http.HttpResponse;
10 | import org.apache.http.NameValuePair;
11 | import org.apache.http.client.*;
12 | import org.apache.http.client.entity.UrlEncodedFormEntity;
13 | import org.apache.http.client.methods.*;
14 | import org.apache.http.impl.client.DefaultHttpClient;
15 | import org.apache.http.message.BasicNameValuePair;
16 |
17 | import android.os.*;
18 |
19 | public class FileSystem {
20 |
21 | private static final String SERVER_ADDR = "http://www.pground.chozabu.net/";
22 | //File path = Environment.getExternalStoragePublicDirectory(
23 | // Environment.DIRECTORY_PICTURES);
24 | static File prePath = Environment.getExternalStorageDirectory();
25 | //static File path = new File(prePath,"/Android/data/com.chozabu.android.BikeGame/cache/");
26 | //static File path = new File(prePath,"/ABike/");
27 | static File path = new File(prePath,"/xlvls/");
28 |
29 |
30 | static boolean mExternalStorageAvailable = false;
31 | static boolean mExternalStorageWriteable = false;
32 | public static File[] getFileList(){
33 | checkRW();
34 | if (!mExternalStorageAvailable)return null;
35 | path.mkdirs();
36 | return path.listFiles();
37 | }
38 | public static String[] getFileNames(){
39 | checkRW();
40 | if (!mExternalStorageAvailable)return null;
41 | path.mkdirs();
42 | return path.list();
43 | }
44 |
45 | public static void writeFile(String name,String data){
46 | checkRW();
47 | if (!mExternalStorageWriteable)return;
48 | path.mkdirs();
49 | File file = new File(path, name);
50 | //InputStream is = data;
51 | OutputStream os;
52 | try {
53 | os = new FileOutputStream(file);
54 | try {
55 | os.write(data.getBytes());
56 | } catch (IOException e) {
57 | e.printStackTrace();
58 | }
59 | } catch (FileNotFoundException e) {
60 | e.printStackTrace();
61 | }
62 | }
63 | public static String readFile(String name){
64 | return readFilep(new File(path, name));
65 | }
66 | public static String readFilep(File file){
67 | checkRW();
68 | if (!mExternalStorageAvailable)return null;
69 | path.mkdirs();
70 | //File file = new File(path, name);
71 | InputStream is;
72 | byte[] data = null;
73 | try {
74 | is = new FileInputStream(file);
75 | try {
76 | data = new byte[is.available()];
77 | is.read(data);
78 | } catch (IOException e) {
79 | e.printStackTrace();
80 | }
81 | } catch (FileNotFoundException e) {
82 | e.printStackTrace();
83 | }
84 | return new String(data);
85 | }
86 | public static void checkRW(){
87 | String state = Environment.getExternalStorageState();
88 |
89 | if (Environment.MEDIA_MOUNTED.equals(state)) {
90 | // We can read and write the media
91 | mExternalStorageAvailable = mExternalStorageWriteable = true;
92 | } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
93 | // We can only read the media
94 | mExternalStorageAvailable = true;
95 | mExternalStorageWriteable = false;
96 | } else {
97 | // Something else is wrong. It may be one of many other states, but all we need
98 | // to know is we can neither read nor write
99 | mExternalStorageAvailable = mExternalStorageWriteable = false;
100 | }
101 | }
102 |
103 | public static String uploadLevel(String name, String author, String passHash, String data) {
104 | String url = SERVER_ADDR+"uploadLevel";
105 | List nameValuePairs = new ArrayList(4);
106 | nameValuePairs.add(new BasicNameValuePair("author", author));
107 | nameValuePairs.add(new BasicNameValuePair("passHash", passHash));
108 | nameValuePairs.add(new BasicNameValuePair("levelData", data));
109 | nameValuePairs.add(new BasicNameValuePair("name", name));
110 | return generalPost(url,nameValuePairs);
111 | }
112 | public static String downloadLevel(String fullname) {
113 | String url = SERVER_ADDR+"downloadLevel";
114 | List nameValuePairs = new ArrayList(1);
115 | nameValuePairs.add(new BasicNameValuePair("fullname", fullname));
116 | return generalPost(url,nameValuePairs);
117 | }
118 | public static String createAccount(String userName, String passHash, String creating) {
119 | String url = SERVER_ADDR+"createUser";
120 | List nameValuePairs = new ArrayList(3);
121 | nameValuePairs.add(new BasicNameValuePair("userName", userName));
122 | nameValuePairs.add(new BasicNameValuePair("passHash", passHash));
123 | nameValuePairs.add(new BasicNameValuePair("creating", creating));
124 | return generalPost(url,nameValuePairs);
125 | }
126 |
127 |
128 | public static String getLevelList(String SortBy, int count) {
129 | String url = SERVER_ADDR+"listLevels";
130 |
131 | List nameValuePairs = new ArrayList(2);
132 | nameValuePairs.add(new BasicNameValuePair("SortBy", SortBy));
133 | String cStr = ""+count;
134 | nameValuePairs.add(new BasicNameValuePair("count", cStr));
135 | return generalGet(url,nameValuePairs);
136 |
137 | }
138 | public static String generalPost(String url, List pairs) {
139 | HttpClient httpClient = new DefaultHttpClient();
140 |
141 | HttpPost httpPost = new HttpPost(url);
142 | HttpResponse response = null;
143 |
144 | try{
145 | httpPost.setEntity(new UrlEncodedFormEntity(pairs));
146 | } catch(Exception e){
147 | System.out.println("Error encoding pairs: "+e);
148 | return "Failed to encode information";
149 | }
150 | try {
151 | response = httpClient.execute(httpPost);
152 | ByteArrayOutputStream ostream = new ByteArrayOutputStream();
153 | response.getEntity().writeTo(ostream);
154 | return ostream.toString();
155 | } catch (ClientProtocolException e) {
156 | System.out.println("HTTPHelp : ClientProtocolException : "+e);
157 | } catch (IOException e) {
158 | System.out.println("HTTPHelp : IOException : "+e);
159 | }
160 | return "Unknown Failure";
161 | }
162 | public static String generalGet(String url, List pairs) {
163 | HttpClient httpClient = new DefaultHttpClient();
164 |
165 | HttpGet httpPost = new HttpGet(url);
166 | HttpResponse response = null;
167 |
168 | try {
169 | response = httpClient.execute(httpPost);
170 | ByteArrayOutputStream ostream = new ByteArrayOutputStream();
171 | HttpEntity temp = response.getEntity();
172 | temp.writeTo(ostream);
173 | return ostream.toString();
174 | } catch (ClientProtocolException e) {
175 | System.out.println("HTTPHelp : ClientProtocolException : "+e);
176 | } catch (IOException e) {
177 | System.out.println("HTTPHelp : IOException : "+e);
178 | }
179 | return "Unknown Failure";
180 | }
181 | }
182 |
--------------------------------------------------------------------------------
/assets/level/xmc/i27.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | GreenWorld
5 |
6 |
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
--------------------------------------------------------------------------------
/assets/level/original/l12.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Inside the Ball
5 |
6 | Chozabu
7 | 2010-12-12
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
--------------------------------------------------------------------------------
/assets/level/xmc/i31.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | One Two
5 |
6 |
7 |
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
--------------------------------------------------------------------------------
/src/com/chozabu/android/BikeGame/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.chozabu.android.BikeGame;
2 |
3 | import org.anddev.andengine.engine.Engine;
4 | import org.anddev.andengine.engine.options.EngineOptions;
5 | import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
6 | import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
7 | import org.anddev.andengine.engine.camera.ZoomCamera;
8 | import org.anddev.andengine.engine.handler.IUpdateHandler;
9 | import org.anddev.andengine.entity.scene.Scene;
10 | import org.anddev.andengine.extension.input.touch.controller.MultiTouch;
11 | import org.anddev.andengine.extension.input.touch.controller.MultiTouchController;
12 | import org.anddev.andengine.extension.input.touch.controller.MultiTouchException;
13 | import org.anddev.andengine.sensor.accelerometer.IAccelerometerListener;
14 | import org.anddev.andengine.ui.activity.LayoutGameActivity;
15 |
16 | import android.content.SharedPreferences;
17 | import android.os.Bundle;
18 | import android.os.Handler;
19 | import android.preference.PreferenceManager;
20 | import android.view.KeyEvent;
21 |
22 |
23 |
24 | public class MainActivity extends LayoutGameActivity{
25 |
26 |
27 | ZoomCamera camera;
28 | Textures textures = new Textures();
29 | Sounds sounds = new Sounds();
30 | GameWorld gameWorld = new GameWorld();
31 | SharedPreferences prefs;
32 | GameScene currentGameScene;
33 |
34 | @Override
35 | public void onPause() {
36 | super.onPause();
37 | if (sounds != null)
38 | sounds.stop();
39 | }
40 |
41 |
42 |
43 | @Override
44 | protected void onCreate(final Bundle pSavedInstanceState) {
45 | super.onCreate(pSavedInstanceState);
46 | prefs = PreferenceManager.getDefaultSharedPreferences(this);
47 | //this.currentGameScene = new MainMenuGameScene();
48 | m_Handler = new Handler();
49 |
50 |
51 | }
52 |
53 |
54 | private Handler m_Handler;
55 |
56 |
57 | @Override
58 | public void onStart() {
59 | super.onStart();
60 | }
61 | public void onStop()
62 | {
63 | super.onStop();
64 | if (sounds != null)
65 | sounds.stop();
66 | }
67 |
68 | protected void onDestroy() {
69 | super.onDestroy();
70 | if (sounds != null)
71 | sounds.stop();
72 | }
73 |
74 |
75 | @Override
76 | public void onResume() {
77 | super.onResume();
78 | if(sounds!=null)
79 | sounds.start();
80 | }
81 |
82 | @Override
83 | protected int getLayoutID() {
84 | return R.layout.simplelayout;
85 | }
86 |
87 | @Override
88 | protected int getRenderSurfaceViewID() {
89 | return R.id.flip_render;
90 | }
91 |
92 |
93 | @Override
94 | public Engine onLoadEngine() {
95 | camera = new ZoomCamera(0, 0, StatStuff.CAMERA_WIDTH,
96 | StatStuff.CAMERA_HEIGHT);
97 | gameWorld.initEngine(this, camera);
98 | // camera.setRotation(180.f);
99 | // camera.setCameraSceneRotation(50.f);
100 | // camera.setZoomFactor(.05f);
101 | Engine engine = new Engine(new EngineOptions(true,
102 | ScreenOrientation.LANDSCAPE, new RatioResolutionPolicy(
103 | StatStuff.CAMERA_WIDTH, StatStuff.CAMERA_HEIGHT),
104 | camera).setNeedsSound(true));
105 |
106 | try {
107 | if (MultiTouch.isSupported(this)) {
108 | engine.setTouchController(new MultiTouchController());
109 | }
110 | } catch (final MultiTouchException e) {
111 | }
112 |
113 | return engine;
114 | }
115 |
116 | public void enableAccel(IAccelerometerListener pAccelerometerListener){
117 | this.enableAccelerometerSensor(pAccelerometerListener);
118 | }
119 |
120 | @Override
121 | public void onLoadResources() {
122 | System.gc();
123 | textures.init(this);
124 | sounds.init(this);
125 | sounds.start();
126 |
127 | gameWorld.initRes(textures, sounds);
128 |
129 | System.gc();
130 |
131 | }
132 |
133 | @Override
134 | public Scene onLoadScene() {
135 | //return null;
136 |
137 | Bundle extras = getIntent().getExtras();
138 | if (extras != null) {
139 | String toLoad = extras
140 | .getString("com.chozabu.android.BikeGame.toLoad");
141 |
142 | extras.clear();
143 |
144 |
145 | currentGameScene = new GameRoot(MainActivity.this, -1, -1, toLoad);
146 | Scene nScene = currentGameScene.onLoadScene();
147 | nScene.registerUpdateHandler(new IUpdateHandler() {
148 |
149 | @Override
150 | public void onUpdate(float pSecondsElapsed) {
151 | MainActivity.this.frameUpdate(1.0f / 45.f);
152 | }
153 |
154 | @Override
155 | public void reset() {
156 |
157 | }
158 | });
159 | return nScene;
160 | }
161 |
162 | AEMainMenu temp = new AEMainMenu(this);
163 | temp.doIntroDialog();
164 | currentGameScene = temp;
165 | Scene nScene = currentGameScene.onLoadScene();
166 | nScene.registerUpdateHandler(new IUpdateHandler() {
167 |
168 | @Override
169 | public void onUpdate(float pSecondsElapsed) {
170 | MainActivity.this.frameUpdate(1.0f / 45.f);
171 | }
172 |
173 | @Override
174 | public void reset() {
175 |
176 | }
177 | });
178 | //temp.doIntroDialog();
179 | temp = null;
180 |
181 | return nScene;
182 | }
183 | public void frameUpdate(float pSecondsElapsed){
184 | this.currentGameScene.frameUpdate(1.0f / 45.f);
185 | }
186 |
187 | public void setMainMenu() {
188 | this.disableAccelerometerSensor();
189 | this.getEngine().runOnUpdateThread(new Runnable() {
190 | @Override
191 | public void run() {
192 | //BufferObjectManager.getActiveInstance().clear();
193 | currentGameScene = new AEMainMenu(MainActivity.this);
194 |
195 | Scene nScene = currentGameScene.onLoadScene();
196 | nScene.registerUpdateHandler(new IUpdateHandler() {
197 |
198 | @Override
199 | public void onUpdate(float pSecondsElapsed) {
200 | MainActivity.this.frameUpdate(1.0f / 45.f);
201 | }
202 |
203 | @Override
204 | public void reset() {
205 |
206 | }
207 | });
208 | MainActivity.this.getEngine().setScene(nScene);
209 | currentGameScene.onLoadComplete();
210 |
211 | }
212 | });
213 |
214 | }
215 | public void setInGame(final int packID, final int levelID) {
216 | this.getEngine().runOnUpdateThread(new Runnable() {
217 | @Override
218 | public void run() {
219 |
220 | //BufferObjectManager.getActiveInstance().clear();
221 | currentGameScene = new GameRoot(MainActivity.this, packID, levelID, null);
222 | Scene nScene = currentGameScene.onLoadScene();
223 | nScene.registerUpdateHandler(new IUpdateHandler() {
224 |
225 | @Override
226 | public void onUpdate(float pSecondsElapsed) {
227 | MainActivity.this.frameUpdate(1.0f / 45.f);
228 | }
229 |
230 | @Override
231 | public void reset() {
232 |
233 | }
234 | });
235 |
236 | MainActivity.this.getEngine().setScene(nScene);
237 | currentGameScene.onLoadComplete();
238 |
239 | }
240 | });
241 | }
242 |
243 | @Override
244 | public void onLoadComplete() {
245 | if (StatStuff.isDemo)loadAds();
246 | currentGameScene.onLoadComplete();
247 | //doIntroDialog();
248 |
249 | }
250 |
251 |
252 |
253 | @Override
254 | public boolean onKeyDown(final int pKeyCode, final KeyEvent pEvent) {
255 | if(currentGameScene==null)
256 | return super.onKeyDown(pKeyCode, pEvent);
257 |
258 | //Debug.stopMethodTracing();
259 | if(currentGameScene.onKeyDown(pKeyCode, pEvent))
260 | return true;
261 | return super.onKeyDown(pKeyCode, pEvent);
262 | }
263 | @Override
264 | public boolean onKeyUp(final int pKeyCode, final KeyEvent pEvent) {
265 | if(currentGameScene==null)
266 | return super.onKeyUp(pKeyCode, pEvent);
267 | if(currentGameScene.onKeyUp(pKeyCode, pEvent))
268 | return true;
269 | return super.onKeyUp(pKeyCode, pEvent);
270 | }
271 |
272 |
273 | public Scene getScene() {
274 | return this.mEngine.getScene();
275 | }
276 |
277 |
278 | private void loadAds() {
279 |
280 | }
281 |
282 |
283 | void quitFunc(){
284 | if(sounds!=null)
285 | sounds.stop();
286 | this.finish();
287 | }
288 | void superQuitFunc(){
289 | quitFunc();
290 | int pid = android.os.Process.myPid();
291 | android.os.Process.killProcess(pid);
292 | }
293 |
294 | }
295 |
--------------------------------------------------------------------------------
/assets/level/original/l10.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Rock Fall
5 | Escape Falling Rocks!
6 | Chozabu
7 | 2010-12-14
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
--------------------------------------------------------------------------------
/assets/level/original/l7.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Rock Fall
5 | Escape Falling Rocks!
6 | Chozabu
7 | 2010-12-09
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
--------------------------------------------------------------------------------
/assets/level/xmc/i9.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Monkey Boogie
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
--------------------------------------------------------------------------------
/assets/level/original/l3.lvl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Flimsy planks!
5 | early test
6 | Alex PB (Chozabu)
7 | 2010-12-04
8 | sky1
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
--------------------------------------------------------------------------------