Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed the old game

  • Loading branch information...
commit 72d57240491cf80d6ad6e750c15de539a288222e 1 parent 21c2d76
Mathias Forssén authored
Showing with 358 additions and 363 deletions.
  1. +2 −1  .gitignore
  2. +13 −0 Kandidat33MobileGame/mobile/AndroidManifest.xml
  3. +17 −0 Kandidat33MobileGame/mobile/ant.properties
  4. +92 −0 Kandidat33MobileGame/mobile/build.xml
  5. BIN  Kandidat33MobileGame/mobile/libs/MyGame.jar
  6. BIN  Kandidat33MobileGame/mobile/libs/armeabi-v7a/libbulletjme.so
  7. BIN  Kandidat33MobileGame/mobile/libs/armeabi/libbulletjme.so
  8. BIN  Kandidat33MobileGame/mobile/libs/assets.jar
  9. BIN  Kandidat33MobileGame/mobile/libs/eventbus.jar
  10. BIN  Kandidat33MobileGame/mobile/libs/j-ogg-oggd.jar
  11. BIN  Kandidat33MobileGame/mobile/libs/j-ogg-vorbisd.jar
  12. BIN  Kandidat33MobileGame/mobile/libs/jME3-android.jar
  13. BIN  Kandidat33MobileGame/mobile/libs/jME3-bullet.jar
  14. BIN  Kandidat33MobileGame/mobile/libs/jME3-core.jar
  15. BIN  Kandidat33MobileGame/mobile/libs/jME3-effects.jar
  16. BIN  Kandidat33MobileGame/mobile/libs/jME3-jogg.jar
  17. BIN  Kandidat33MobileGame/mobile/libs/jME3-networking.jar
  18. BIN  Kandidat33MobileGame/mobile/libs/jME3-niftygui.jar
  19. BIN  Kandidat33MobileGame/mobile/libs/jME3-plugins.jar
  20. BIN  Kandidat33MobileGame/mobile/libs/jME3-terrain.jar
  21. BIN  Kandidat33MobileGame/mobile/libs/nifty-default-controls.jar
  22. BIN  Kandidat33MobileGame/mobile/libs/nifty-style-black.jar
  23. BIN  Kandidat33MobileGame/mobile/libs/nifty.jar
  24. BIN  Kandidat33MobileGame/mobile/libs/xmlpull-xpp3.jar
  25. +20 −0 Kandidat33MobileGame/mobile/proguard-project.txt
  26. +14 −0 Kandidat33MobileGame/mobile/project.properties
  27. BIN  Kandidat33MobileGame/mobile/res/drawable-hdpi/ic_launcher.png
  28. BIN  Kandidat33MobileGame/mobile/res/drawable-ldpi/ic_launcher.png
  29. BIN  Kandidat33MobileGame/mobile/res/drawable-mdpi/ic_launcher.png
  30. +13 −0 Kandidat33MobileGame/mobile/res/layout/main.xml
  31. +4 −0 Kandidat33MobileGame/mobile/res/values/strings.xml
  32. +34 −0 Kandidat33MobileGame/mobile/src/com/mycompany/mygame/MainActivity.java
  33. +2 −1  Kandidat33MobileGame/nbproject/build-impl.xml
  34. +4 −0 Kandidat33MobileGame/nbproject/configs/run-android.properties
  35. +2 −2 Kandidat33MobileGame/nbproject/genfiles.properties
  36. +118 −0 Kandidat33MobileGame/nbproject/mobile-impl.xml
  37. +20 −1 Kandidat33MobileGame/nbproject/project.properties
  38. +3 −0  Kandidat33MobileGame/nbproject/project.xml
  39. +0 −48 Kandidat33MobileGame/src/mygame/LevelSupply.java
  40. +0 −276 Kandidat33MobileGame/src/mygame/Main.java
  41. +0 −34 Kandidat33MobileGame/src/mygame/PlatformPosition.java
3  .gitignore
View
@@ -20,4 +20,5 @@ local.properties
.project
/Kandidat33MobileGame/nbproject/private/
/TestingStuff/nbproject/private/
-/Kandidat33MobileGame/build/
+/Kandidat33MobileGame/build/
+/Kandidat33MobileGame/dist/
13 Kandidat33MobileGame/mobile/AndroidManifest.xml
View
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.mycompany.mygame">
+ <application android:icon="@drawable/ic_launcher" android:label="@string/app_name">
+ <activity android:label="@string/app_name" android:name="MainActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+ <uses-sdk android:minSdkVersion="8"/>
+ <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
+</manifest>
17 Kandidat33MobileGame/mobile/ant.properties
View
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked into Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+# 'source.dir' for the location of your java source folder and
+# 'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+# 'key.store' for the location of your keystore and
+# 'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
92 Kandidat33MobileGame/mobile/build.xml
View
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="MyGame" default="help">
+
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked into
+ Version Control Systems. -->
+ <property file="local.properties" />
+
+ <!-- The ant.properties file can be created by you. It is only edited by the
+ 'android' tool to add properties to it.
+ This is the place to change some Ant specific build properties.
+ Here are some properties you may want to change/update:
+
+ source.dir
+ The name of the source directory. Default is 'src'.
+ out.dir
+ The name of the output directory. Default is 'bin'.
+
+ For other overridable properties, look at the beginning of the rules
+ files in the SDK, at tools/ant/build.xml
+
+ Properties related to the SDK location or the project target should
+ be updated using the 'android' tool with the 'update' action.
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems.
+
+ -->
+ <property file="ant.properties" />
+
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var.
+ This must be done before we load project.properties since
+ the proguard config can use sdk.dir -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
+ <!-- The project.properties file is created and updated by the 'android'
+ tool, as well as ADT.
+
+ This contains project specific properties such as project target, and library
+ dependencies. Lower level build properties are stored in ant.properties
+ (or in .classpath for Eclipse projects).
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems. -->
+ <loadproperties srcFile="project.properties" />
+
+ <!-- quick check on sdk.dir -->
+ <fail
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
+ unless="sdk.dir"
+ />
+
+ <!--
+ Import per project custom build rules if present at the root of the project.
+ This is the place to put custom intermediary targets such as:
+ -pre-build
+ -pre-compile
+ -post-compile (This is typically used for code obfuscation.
+ Compiled code location: ${out.classes.absolute.dir}
+ If this is not done in place, override ${out.dex.input.absolute.dir})
+ -post-package
+ -post-build
+ -pre-clean
+ -->
+ <import file="custom_rules.xml" optional="true" />
+
+ <!-- Import the actual build file.
+
+ To customize existing targets, there are two options:
+ - Customize only one target:
+ - copy/paste the target into this file, *before* the
+ <import> task.
+ - customize it to your needs.
+ - Customize the whole content of build.xml
+ - copy/paste the content of the rules files (minus the top node)
+ into this file, replacing the <import> task.
+ - customize to your needs.
+
+ ***********************
+ ****** IMPORTANT ******
+ ***********************
+ In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+ in order to avoid having your file be overridden by tools such as "android update project"
+ -->
+ <!-- version-tag: 1 -->
+ <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>
BIN  Kandidat33MobileGame/mobile/libs/MyGame.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/armeabi-v7a/libbulletjme.so
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/armeabi/libbulletjme.so
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/assets.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/eventbus.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/j-ogg-oggd.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/j-ogg-vorbisd.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/jME3-android.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/jME3-bullet.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/jME3-core.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/jME3-effects.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/jME3-jogg.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/jME3-networking.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/jME3-niftygui.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/jME3-plugins.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/jME3-terrain.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/nifty-default-controls.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/nifty-style-black.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/nifty.jar
View
Binary file not shown
BIN  Kandidat33MobileGame/mobile/libs/xmlpull-xpp3.jar
View
Binary file not shown
20 Kandidat33MobileGame/mobile/proguard-project.txt
View
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
14 Kandidat33MobileGame/mobile/project.properties
View
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-15
BIN  Kandidat33MobileGame/mobile/res/drawable-hdpi/ic_launcher.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  Kandidat33MobileGame/mobile/res/drawable-ldpi/ic_launcher.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  Kandidat33MobileGame/mobile/res/drawable-mdpi/ic_launcher.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 Kandidat33MobileGame/mobile/res/layout/main.xml
View
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+<TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="Hello World, MainActivity"
+ />
+</LinearLayout>
+
4 Kandidat33MobileGame/mobile/res/values/strings.xml
View
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources>
+ <string name="app_name">MyGame</string>
+</resources>
34 Kandidat33MobileGame/mobile/src/com/mycompany/mygame/MainActivity.java
View
@@ -0,0 +1,34 @@
+package com.mycompany.mygame;
+
+import com.jme3.app.AndroidHarness;
+import android.content.pm.ActivityInfo;
+import com.jme3.system.android.AndroidConfigChooser.ConfigType;
+
+public class MainActivity extends AndroidHarness{
+
+ /*
+ * Note that you can ignore the errors displayed in this file,
+ * the android project will build regardless.
+ * Install the 'Android' plugin under Tools->Plugins->Available Plugins
+ * to get error checks and code completion for the Android project files.
+ */
+
+ public MainActivity(){
+ // Set the application class to run
+ appClass = "main.Main";
+ // Try ConfigType.FASTEST; or ConfigType.LEGACY if you have problems
+ eglConfigType = ConfigType.BEST;
+ // Exit Dialog title & message
+ exitDialogTitle = "Exit?";
+ exitDialogMessage = "Press Yes";
+ // Enable verbose logging
+ eglConfigVerboseLogging = false;
+ // Choose screen orientation
+ screenOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
+ // Invert the MouseEvents X (default = true)
+ mouseEventsInvertX = true;
+ // Invert the MouseEvents Y (default = true)
+ mouseEventsInvertY = true;
+ }
+
+}
3  Kandidat33MobileGame/nbproject/build-impl.xml
View
@@ -20,6 +20,7 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="Kandidat33MobileGame-impl">
+ <import file="mobile-impl.xml"/>
<import file="assets-impl.xml"/>
<fail message="Please build using Ant 1.8.0 or higher.">
<condition>
@@ -999,7 +1000,7 @@ is divided into following sections:
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
- <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
+ <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar,-mobile-deployment" description="Build JAR." name="jar"/>
<!--
=================
EXECUTION SECTION
4 Kandidat33MobileGame/nbproject/configs/run-android.properties
View
@@ -0,0 +1,4 @@
+$label=Android Device
+$target.clean=clean clean-android
+$target.debug=run-android
+$target.run=run-android
4 Kandidat33MobileGame/nbproject/genfiles.properties
View
@@ -3,6 +3,6 @@ build.xml.script.CRC32=79a29eb7
build.xml.stylesheet.CRC32=958a1d3e@1.32.1.45
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=94bb0088
-nbproject/build-impl.xml.script.CRC32=4feccb11
+nbproject/build-impl.xml.data.CRC32=ec598e7f
+nbproject/build-impl.xml.script.CRC32=7490e12c
nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46
118 Kandidat33MobileGame/nbproject/mobile-impl.xml
View
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--mobile-impl.xml v0.18-->
+<project name="mobile-impl" basedir="..">
+ <condition property="android-adb-name" value="${file.separator}platform-tools${file.separator}adb.exe" else="${file.separator}platform-tools${file.separator}adb">
+ <os family="windows" />
+ </condition>
+
+ <target name="run-android" depends="-flag-no-android, jar, -test-android-enabled, -copy-android-libs" if="is.android.enabled">
+ <echo>Building debug android application version.</echo>
+ <ant dir="mobile" target="debug" inheritall="false"/>
+ <antcall target="-start-android-device"/>
+ <ant dir="mobile" target="installd" inheritall="false"/>
+ <antcall target="-run-android-device"/>
+ </target>
+
+ <target name="clean-android">
+ <ant dir="mobile" target="clean" inheritall="false"/>
+ </target>
+
+ <target name="-mobile-deployment" depends="-test-android-enabled, -copy-android-libs" if="is.android.enabled" unless="no.android.build">
+ <ant dir="mobile" target="release" inheritall="false"/>
+ <copy todir="dist" verbose="false" flatten="true">
+ <fileset dir="mobile/bin/">
+ <include name="**/*.apk"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="-copy-android-libs" if="is.android.enabled">
+ <echo>Copying application libraries to android project.</echo>
+ <delete dir="mobile/libs" failonerror="false"/>
+ <mkdir dir="mobile/libs"/>
+ <copy todir="mobile/libs" verbose="false" flatten="true">
+ <fileset dir="dist/lib/">
+ <exclude name="jME3-desktop.jar"/>
+ <exclude name="jME3-blender.jar"/>
+ <exclude name="jME3-lwjgl.jar"/>
+ <exclude name="jME3-lwjgl-natives.jar"/>
+ <exclude name="jME3-bullet-natives.jar"/>
+ <exclude name="jME3-jbullet.jar"/>
+ <exclude name="jME3-bullet.jar"/>
+ <exclude name="jbullet.jar"/>
+ <exclude name="stack-alloc.jar"/>
+ <exclude name="vecmath.jar"/>
+ <exclude name="lwjgl.jar"/>
+ <exclude name="jinput.jar"/>
+ </fileset>
+ </copy>
+
+ <echo>Adding libraries for android.</echo>
+ <copy todir="mobile/libs" flatten="true">
+ <path>
+ <pathelement path="${libs.android-base.classpath}"/>
+ </path>
+ </copy>
+ <antcall target="-unzip-bullet-libs"/>
+ <copy file="${dist.jar}" todir="mobile/libs/" verbose="false"/>
+ </target>
+
+ <target name="-unzip-bullet-libs" depends="-delete-bullet-libs" if="bulletIsIncluded">
+ <echo>Replacing bullet library with android native version.</echo>
+ <unzip src="mobile/libs/jME3-bullet-natives-android.jar" dest="mobile/libs"/>
+ <delete file="mobile/libs/jME3-bullet-natives-android.jar"/>
+ <delete dir="mobile/libs/x86"/>
+ </target>
+
+ <target name="-delete-bullet-libs" depends="-test-bullet-included" unless="bulletIsIncluded">
+ <delete file="mobile/libs/jME3-bullet.jar"/>
+ <delete file="mobile/libs/jME3-bullet-natives-android.jar"/>
+ </target>
+
+ <target name="-test-bullet-included">
+ <condition property="bulletIsIncluded">
+ <contains string="${javac.classpath}" substring="bullet.jar"/>
+ </condition>
+ </target>
+
+ <target name="-start-android-device">
+ <property file="mobile/local.properties"/>
+ <exec executable="${sdk.dir}${android-adb-name}" failonerror="true">
+ <arg value="start-server"/>
+ </exec>
+ <echo>Waiting for device to be ready.. Connect your device now if its not connected yet.</echo>
+ <exec executable="${sdk.dir}${android-adb-name}" failonerror="true">
+ <arg value="wait-for-device"/>
+ </exec>
+ </target>
+
+ <target name="-run-android-device">
+ <property file="mobile/local.properties"/>
+ <exec executable="${sdk.dir}${android-adb-name}" failonerror="true">
+ <arg value="logcat"/>
+ <arg value="-c"/>
+ </exec>
+ <exec executable="${sdk.dir}${android-adb-name}" failonerror="true">
+ <arg value="shell"/>
+ <arg value="am start -n ${mobile.android.package}/.MainActivity"/>
+ </exec>
+ <echo>Logging android device output, cancel build or disconnect device to stop logging.</echo>
+ <exec executable="${sdk.dir}${android-adb-name}" failonerror="true">
+ <arg value="logcat"/>
+ <arg value="AndroidRuntime:E"/>
+ <arg value="System.out:I"/>
+ <arg value="System.err:W"/>
+ <arg value="NSLog:*"/>
+ </exec>
+ </target>
+
+ <target name="-test-android-enabled">
+ <condition property="is.android.enabled">
+ <istrue value="${mobile.android.enabled}"/>
+ </condition>
+ </target>
+
+ <target name="-flag-no-android">
+ <property name="no.android.build" value="true"/>
+ </target>
+</project>
21 Kandidat33MobileGame/nbproject/project.properties
View
@@ -1,7 +1,12 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+ant.customtasks.libs=android-base
application.title=MyGame
application.vendor=MyCompany
assets.jar.name=assets.jar
-assets.excludes=**/*.j3odata,**/*.mesh\.xml,**/*.skeleton\.xml,**/*.scene,**/*.material,**/*.obj,**/*.mtl,**/*.blend
+assets.excludes=**/*.j3odata,**/*.mesh.xml,**/*.skeleton.xml,**/*.scene,**/*.material,**/*.obj,**/*.mtl,**/*.blend
assets.folder.name=assets
assets.compress=true
build.classes.dir=${build.dir}/classes
@@ -28,13 +33,17 @@ dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
includes=**
+jar.archive.disabled=${jnlp.enabled}
jar.compress=false
+jar.index=${jnlp.enabled}
javac.classpath=\
${libs.jme3.classpath}:\
${libs.jme3-libraries.classpath}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
@@ -55,11 +64,21 @@ jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
jnlp.codebase.type=local
jnlp.descriptor=application
jnlp.enabled=false
+jnlp.mixed.code=default
jnlp.offline-allowed=false
jnlp.signed=false
+jnlp.signing=
+jnlp.signing.alias=
+jnlp.signing.keystore=
+lwjgl.applet.height=480
+lwjgl.applet.width=640
main.class=main.Main
meta.inf.dir=${src.dir}/META-INF
manifest.file=MANIFEST.MF
+mkdist.disabled=false
+mobile.android.enabled=true
+mobile.android.package=com.mycompany.mygame
+mobile.android.target=android-15
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
3  Kandidat33MobileGame/nbproject/project.xml
View
@@ -6,6 +6,9 @@
<extension file="assets-impl.xml" id="assets">
<dependency dependsOn="-init-assets" target="-do-init"/>
</extension>
+ <extension file="mobile-impl.xml" id="mobile">
+ <dependency dependsOn="-mobile-deployment" target="jar"/>
+ </extension>
</buildExtensions>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>Kandidat33MobileGame</name>
48 Kandidat33MobileGame/src/mygame/LevelSupply.java
View
@@ -1,48 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package mygame;
-
-import com.jme3.bullet.BulletAppState;
-import com.jme3.bullet.control.RigidBodyControl;
-import com.jme3.scene.Geometry;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author jonatankilhamn
- */
-public class LevelSupply {
-
- private BulletAppState bulletAppState;
-
-
- ArrayList<PlatformPosition> platforms;
-
- public List<PlatformPosition> getLevel(int level) {
- platforms = new ArrayList<PlatformPosition>();
- switch(level) {
- case(0):
- return getLevelZero();
-
- case (1):
- //return getLevelOne();
- default:
- return platforms;
- }
- }
-
- private List<PlatformPosition> getLevelZero() {
- for (int i = 0; i < 10; i++) {
- platforms.add(new PlatformPosition(0,i*1f,0f));
- }
- for (int i = 0; i < 5; i++) {
- platforms.add(new PlatformPosition(0,3+i*2f,i*0.3f));
- }
- return platforms;
- }
-
-
-}
276 Kandidat33MobileGame/src/mygame/Main.java
View
@@ -1,276 +0,0 @@
-package mygame;
-
-import com.jme3.app.SimpleApplication;
-import com.jme3.bullet.BulletAppState;
-import com.jme3.bullet.collision.shapes.CapsuleCollisionShape;
-import com.jme3.bullet.control.CharacterControl;
-import com.jme3.bullet.control.RigidBodyControl;
-import com.jme3.input.ChaseCamera;
-import com.jme3.input.KeyInput;
-import com.jme3.input.MouseInput;
-import com.jme3.input.controls.ActionListener;
-import com.jme3.input.controls.KeyTrigger;
-import com.jme3.input.controls.MouseButtonTrigger;
-import com.jme3.light.DirectionalLight;
-import com.jme3.material.Material;
-import com.jme3.math.ColorRGBA;
-import com.jme3.math.FastMath;
-import com.jme3.math.Vector2f;
-import com.jme3.math.Vector3f;
-import com.jme3.renderer.RenderManager;
-import com.jme3.scene.CameraNode;
-import com.jme3.scene.Geometry;
-import com.jme3.scene.Node;
-import com.jme3.scene.Spatial;
-import com.jme3.scene.shape.Box;
-import com.jme3.texture.Texture;
-import java.util.List;
-
-/**
- * test
- *
- * @author jonatankilhamn
- */
-public class Main extends SimpleApplication implements ActionListener {
-
- public static void main(String[] args) {
- Main app = new Main();
- app.start();
- }
- /**
- * Prepare the Physics Application State (jBullet)
- */
- private BulletAppState bulletAppState;
- private CharacterControl playerCharacter;
- private static final Box player_model;
- private RigidBodyControl floor_phy;
- private static final Box platform_box;
- //private Geometry player;
- private Node player;
- private Node playerNode;
- private CameraNode camNode;
- private ChaseCamera chaseCam;
- private boolean light;
- private DirectionalLight sun;
-
- /**
- * dimensions used for bricks and wall
- */
- private static final float platform_length = 20f;
- private static final float platform_width = 5f;
- private static final float platform_height = 0.5f;
- private int level;
- private static final int platforms_per_level = 25;
- private static float level_length = platform_length * platforms_per_level;
-
- /**
- * Constants used for the player character
- */
- private float run_speed = 0.5f;
- private float jump_speed = 20f;
-
- /**
- * Prepare Materials
- */
- Material player_mat;
- Material stone_mat;
- Material floor_mat;
- private LevelSupply levelSupply;
-
- static {
- /**
- * Initialize the geometries;
- */
- player_model = new Box(Vector3f.ZERO, 2f, 2f, 3f);
- player_model.scaleTextureCoordinates(new Vector2f(1f, .5f));
- platform_box = new Box(Vector3f.ZERO, platform_length/2, platform_height, platform_width);
- }
-
- @Override
- public void simpleInitApp() {
-
- /**
- * Set up Physics Game
- */
- bulletAppState = new BulletAppState();
- stateManager.attach(bulletAppState);
- //bulletAppState.getPhysicsSpace().enableDebug(assetManager);
-
-
-
- sun = new DirectionalLight();
- sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
-
- rootNode.addLight(sun);
- light = true;
-
-
- /**
- * Initialize the scene, materials, inputs, and physics space
- */
- initInputs();
- initMaterials();
- player = initPlayer();
-
- levelSupply = new LevelSupply();
-
- initLevel();
-
-
-
- // Disable the default flyby cam
- flyCam.setEnabled(false);
- // Enable a chase cam for this target (typically the player).
- chaseCam = new ChaseCamera(cam, player, inputManager);
- chaseCam.setSmoothMotion(true);
- chaseCam.setTrailingEnabled(false);
- chaseCam.setDefaultHorizontalRotation(-FastMath.DEG_TO_RAD * 270);
- chaseCam.setDefaultDistance(50);
- }
-
- /**
- * Initialize the materials used in this scene.
- */
- public void initMaterials() {
- this.player_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
- this.player_mat.setColor("Color", ColorRGBA.Red);
-
- this.stone_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
- this.stone_mat.setColor("Color", ColorRGBA.Blue);
-
- this.floor_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
- Texture tex = assetManager.loadTexture("Textures/bluefire.jpg");
-
- this.floor_mat.setTexture("ColorMap", tex);
- }
-
- /**
- * Make a solid platform and add it to the scene.
- */
- private void makePlatform(float x, float y) {
- Geometry platform_geo = new Geometry("Platform", platform_box);
- platform_geo.setMaterial(floor_mat);
- platform_geo.setLocalTranslation(x, y - 0.1f, 0);
- rootNode.attachChild(platform_geo);
- /* Make the floor physical with mass 0.0f! */
- floor_phy = new RigidBodyControl(0.0f);
- platform_geo.addControl(floor_phy);
- bulletAppState.getPhysicsSpace().add(floor_phy);
- }
-
- /**
- * Creates a platform from a PlatformPosition.
- * @param p The PlatformPosition containing the position of the new
- * platform, relative to the start of the level.
- */
- private void makePlatform(PlatformPosition p) {
- float offset = level_length * p.getLevel();
- float x = offset + platform_length * p.getX();
- float y = platform_length * p.getY();
-
- makePlatform(x, y);
- }
-
- /**
- * Creates the first level.
- */
- public void initLevel() {
- List<PlatformPosition> platforms = levelSupply.getLevel(0);
- for (PlatformPosition p : platforms) {
- makePlatform(p);
- }
- }
-
- /**
- * This method creates the player.
- */
- public Node initPlayer() {
-
- Vector3f vt =
- new Vector3f(0, 10, 0);
-
-
- Geometry playerGeo = new Geometry("player", player_model);
- playerGeo.setMaterial(player_mat);
- Node playerNode = new Node();
- playerNode.attachChild(playerGeo);
-
- /**
- * Create a CharacterControl object
- */
- CapsuleCollisionShape shape = new CapsuleCollisionShape(2f, 3f);
- playerCharacter = new CharacterControl(shape, 0.05f);
- playerCharacter.setJumpSpeed(jump_speed);
-
-
-
- //Node playerNode = (Node) assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");
-
-
- /**
- * Position the player
- */
- playerNode.setLocalTranslation(vt);
- //playerNode.setLocalScale(0.05f);
- //playerGeo.rotate(0f, 1f, 0f);
-
- rootNode.attachChild(playerNode);
-
-
-
- playerNode.addControl(playerCharacter);
- bulletAppState.getPhysicsSpace().add(playerCharacter);
- Vector3f walkVelocity = Vector3f.UNIT_X.multLocal(run_speed);
-
- playerCharacter.setWalkDirection(walkVelocity);
- return playerNode;
-
- }
-
- @Override
- public void simpleUpdate(float tpf) {
- if (player.getWorldTranslation().getX()
- > 2 * level * platforms_per_level * platform_length) {
- level++;
-
- }
- }
-
- @Override
- public void simpleRender(RenderManager rm) {
- //TODO: add render code
- }
-
- /**
- * Setup the input. Spacebar jumps the character.
- */
- private void initInputs() {
- /*
- inputManager.addMapping("left",
- new KeyTrigger(KeyInput.KEY_A));
- inputManager.addMapping("right",
- new KeyTrigger(KeyInput.KEY_D));
- */
- inputManager.addMapping("light",
- new KeyTrigger(KeyInput.KEY_L));
- inputManager.addMapping("jump",
- new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
- inputManager.addListener(this, /*"right", "left",*/ "jump", "light");
- }
-
- public void onAction(String binding, boolean value, float tpf) {
-
- if (binding.equals("jump")) {
- playerCharacter.jump();
- }
- if (binding.equals("light")) {
- if (light) {
- rootNode.removeLight(sun);
-
- } else {
- rootNode.addLight(sun);
- }
- light = !light;
- }
- }
-}
34 Kandidat33MobileGame/src/mygame/PlatformPosition.java
View
@@ -1,34 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package mygame;
-
-/**
- *
- * @author jonatankilhamn
- */
-public class PlatformPosition {
-
- private float x;
- private float y;
- private int level;
-
- public PlatformPosition(int level, float x, float y) {
- this.x = x;
- this.y = y;
- this.level = level;
- }
-
- public float getX() {
- return x;
- }
-
- public float getY() {
- return y;
- }
-
- public int getLevel() {
- return level;
- }
-}
Please sign in to comment.
Something went wrong with that request. Please try again.