This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jons-Mac-mini:missile-designer jonrenner$ ./run-robo.sh robo | |
RoboVM/JavaC utility script v0.01 - by github.com/jrenner | |
RoboVM Compile Bash Script | |
Linking 2980 classes | |
Building executable /var/folders/42/gstp6b3n0b78990dfn5tf9x80000gn/T/robovm5767984756372582062.tmp/org.jrenner.superior.ios.RoboVMStarter | |
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o /var/folders/42/gstp6b3n0b78990dfn5tf9x80000gn/T/robovm5767984756372582062.tmp/org.jrenner.superior.ios.RoboVMStarter -g -arch i386 -Wl,-filelist,/var/folders/42/gstp6b3n0b78990dfn5tf9x80000gn/T/robovm5767984756372582062.tmp/objects -L /Users/jonrenner/robovm/lib/vm/ios/x86 -ObjC -exported_symbols_list /var/folders/42/gstp6b3n0b78990dfn5tf9x80000gn/T/robovm5767984756372582062.tmp/exported_symbols -Wl,-no_implicit_dylibs -Wl,-dead_strip -mios-simulator-version-min=5.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -lrobovm-bc -force_load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ROBO="/Users/jonrenner/robovm" | |
MISSILE="/Users/jonrenner/projects/missile-designer" | |
OUT="$MISSILE/out/production" | |
STARTER_CLASS_FILE="$MISSILE/ios/src/org/jrenner/superior/ios/RoboVMStarter.java" | |
IOS_LIBS="$MISSILE/ios/libs" | |
MAIN_LIBS="$MISSILE/main/libs" | |
EXT_LIBS="$IOS_LIBS/ios/libgdx.a:$IOS_LIBS/ios/libObjectAL.a:$IOS_LIBS/ios/libgdx-freetype.a" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Convenience method for generating a font, and then writing the fnt and png files. | |
* Writing a generated font to files allows the possibility of only generating the fonts when they are missing, otherwise | |
* loading from a previously generated file. | |
* @param fontFile | |
* @param fontSize | |
*/ | |
private static BitmapFont generateFontWriteFiles(String fontName, FileHandle fontFile, int fontSize, int pageWidth, int pageHeight) { | |
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(fontFile); | |
PixmapPacker packer = new PixmapPacker(pageWidth, pageHeight, Format.RGBA8888, 2, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void generateFonts() { | |
// if fonts are already generated, just load from file | |
Preferences fontPrefs = Gdx.app.getPreferences("org.jrenner.superior.font"); | |
int displayWidth = fontPrefs.getInteger("display-width", 0); | |
int displayHeight = fontPrefs.getInteger("display-height", 0); | |
boolean loaded = false; | |
if (displayWidth != Gdx.graphics.getWidth() || displayHeight != Gdx.graphics.getHeight()) { | |
Tools.log.debug("Screen size change detected, regenerating fonts"); | |
} else { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
val arr = array("cats", "dogs") | |
for (i in 0..10) { | |
println(arr.random()) | |
} | |
// this version works fine | |
fun <T> Array<T>.random() : T { | |
val rand = Random() | |
return this.get(rand.nextInt(this.size)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float frameTime = dt; | |
if (frameTime > 0.5f) { | |
frameTime = 0.5f; | |
} | |
accumulatedDT += frameTime; | |
while (accumulatedDT >= Physics.TIME_STEP) { | |
frame++; | |
tick(); | |
Physics.runPhysics(); | |
//System.out.printf("ran physics - accum: %.3f\n", accumulatedDT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.libgdx.skeleton; | |
import com.badlogic.gdx.ApplicationAdapter; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.Net; | |
import com.badlogic.gdx.math.MathUtils; | |
import com.badlogic.gdx.math.Vector2; | |
import com.badlogic.gdx.net.ServerSocket; | |
import com.badlogic.gdx.net.Socket; | |
import com.badlogic.gdx.physics.box2d.Body; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float frameTime = dt; | |
if (frameTime > 0.5f) { | |
frameTime = 0.5f; | |
} | |
accumulatedDT += frameTime; | |
while (accumulatedDT >= Physics.TIME_STEP) { | |
frame++; | |
tick(); | |
Physics.runPhysics(); | |
//System.out.printf("ran physics - accum: %.3f\n", accumulatedDT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.libgdx.skeleton; | |
import com.badlogic.gdx.ApplicationListener; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.graphics.GL10; | |
import com.badlogic.gdx.graphics.OrthographicCamera; | |
import com.badlogic.gdx.math.Matrix4; | |
import com.badlogic.gdx.math.Rectangle; | |
import com.badlogic.gdx.math.Vector2; | |
import com.badlogic.gdx.physics.box2d.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; | |
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; | |
public class DesktopStarter { | |
private static final short FULLSCREEN = 0; | |
private static final short GALAXY_S3 = 1; | |
private static final short NEXUS_ONE = 2; | |
private static final short EVO3D = 3; | |
private static final short BIG_WINDOW = 4; | |
private static final short SMALL_PHONE = 5; |