Skip to content

Instantly share code, notes, and snippets.

@Hasufel
Hasufel / Main.hx
Created September 7, 2016 01:15
Gamepad double analog test for PS Vita -- openfl
package;
import openfl.display.Sprite;
import openfl.events.Event;
import openfl.Lib;
import lime.ui.Gamepad;
import lime.ui.GamepadAxis;
import lime.ui.GamepadButton;
@Hasufel
Hasufel / Main.hx
Last active June 20, 2022 18:14
OpenFL/Lime Gamepad implementation example
package;
import openfl.display.Sprite;
import openfl.events.Event;
import lime.ui.Gamepad;
import lime.ui.GamepadAxis;
import lime.ui.GamepadButton;
class Main extends Sprite {
@Hasufel
Hasufel / Main.hx
Last active August 29, 2015 14:27
Mini Shooter sample
package;
import openfl.display.Sprite;
import openfl.events.Event;
import openfl.Lib;
import lime.ui.Gamepad;
import lime.ui.GamepadAxis;
import lime.ui.GamepadButton;
@Hasufel
Hasufel / Main.hx
Last active August 29, 2015 14:27
Gamepad handling with multiple ships moving example
package;
import openfl.display.Sprite;
import openfl.events.Event;
import openfl.Lib;
import lime.ui.Gamepad;
import lime.ui.GamepadAxis;
import lime.ui.GamepadButton;
@Hasufel
Hasufel / Main.hx
Last active August 29, 2015 14:27
Gamepad handling in openfl next with the help of lime (without polling need)
package;
import openfl.display.Sprite;
import openfl.Lib;
import lime.ui.Gamepad;
import lime.ui.GamepadAxis;
import lime.ui.GamepadButton;
class Main extends Sprite {
@Hasufel
Hasufel / gist:1b0fb9ae83974fb0644e
Created June 11, 2015 12:54
Bouncing squares example
package;
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.events.Event;
import flash.Lib;
class Main extends Sprite {
@Hasufel
Hasufel / haxeside
Created April 27, 2014 00:30
getting controllers
private function getControllers():Void {
var a = JNI.createStaticMethod ("org.haxe.lime.MainView", "getControllersList", "()Ljava/lang/String;", true);
var b:String = a();
var c:Array<String> = b.split(';');
_controllers = new Array<Array<String>>();
var i:Int = 0;
while(i < c.length) {
if (Std.parseInt(c[i])!=null) {
_controllers.push([c[i], c[i+1]]);
}
@Hasufel
Hasufel / gist:8918386
Created February 10, 2014 15:57
Openfl multithreading sound crash on Android 4.3 (Nvidia Shield)
I/OpenAL_alSource.c( 1827): Skipping starting source 1604208888 due to lack of CPU time.
I/OpenAL_alSource.c( 1827): Skipping starting source 1604209304 due to lack of CPU time.
I/OpenAL_alSource.c( 1827): Skipping starting source 1604674736 due to lack of CPU time.
I/OpenAL_alSource.c( 1827): Skipping starting source 1604675152 due to lack of CPU time.
I/OpenAL_alSource.c( 1827): Skipping starting source 1606821360 due to lack of CPU time.
I/OpenAL_alSource.c( 1827): Skipping starting source 1606817744 due to lack of CPU time.
I/OpenAL_alSource.c( 1827): Skipping starting source 1606818264 due to lack of CPU time.
I/OpenAL_alSource.c( 1827): Skipping starting source 1606820096 due to lack of CPU time.
I/OpenAL_alSource.c( 1827): Skipping starting source 1636756072 due to lack of CPU time.
E/lime::System( 1827): GetEnv: not attached
@Hasufel
Hasufel / gist:8905008
Last active August 29, 2015 13:56
Openfl sound multithreading test crash report, Android 4.3 Vanilla (Nvidia Shield)
Simple testcase, crashed after 25 minutes.
Crash report from -debug:
E/lime::System(15213): GetEnv: not attached
E/lime::System(15213): GetEnv: not attached
E/dalvikvm(15213): threadid=17: native thread exited without detaching
E/dalvikvm(15213): VM aborting
F/libc (15213): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 23640 (Thread-928)
E/InputDispatcher( 497): channel '420cd330 com.puzzl.yummycircus/com.puzzl.yummycircus.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
@Hasufel
Hasufel / gist:8900530
Created February 9, 2014 15:19
Openfl Android audio NO multithreading crash
E/lime::System( 7449): GetEnv: not attached
D/dalvikvm( 7449): threadid=17: thread exiting, not yet detached (count=0)
D/dalvikvm( 7449): threadid=17: thread exiting, not yet detached (count=1)
E/dalvikvm( 7449): threadid=17: native thread exited without detaching
E/dalvikvm( 7449): VM aborting
F/libc ( 7449): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 13498 (Thread-820)
I/DEBUG ( 153): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 153): Build fingerprint: 'nvidia/thor/roth:4.3/JSS15J/01.00.14422_298.5067:user/release-keys'
I/DEBUG ( 153): Revision: '2'
I/DEBUG ( 153): pid: 7449, tid: 13498, name: Thread-820 >>> com.puzzl.yummycircus <<<