Skip to content

Instantly share code, notes, and snippets.

View EduardoLopes's full-sized avatar

Eduardo Lopes EduardoLopes

View GitHub Profile
package;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.util.FlxRandom;
class Cloud extends FlxSprite
{
public static var COUNT:Int = 0;
@EduardoLopes
EduardoLopes / FlxGroupBug.md
Last active August 29, 2015 14:20
FlxGroup and FlxTypedGroup '-dce full' "bug"!

Nape only works if we enable -dce full! i guess this is a linux only issue! openfl/openfl#158

-dce full affect all the classes used in the project, if you don't want some class to be affected, you need to use the keep method!

What was happening is: the class i wanted to use with FlxTypedGroup was not being instantiated with new! so, i guess, the 'dce' thought that it was not being used and remove it, passing a null type to the FlxTypedGroup recycle method!

I fixed it adding the class i want to use with FlxTypedGroup to the keep method!

Yeah, a lot of time to figure out this!

<!DOCTYPE html public "html5 rocks">
<html>
<head>
<meta charset="utf-8">
<title>Animation - Post Fixes</title>
<style>
.mover {
@EduardoLopes
EduardoLopes / debug.md
Last active November 18, 2015 18:46
luxe empty project debug - compiled with hxcpp 3.2.193
(gdb) run
Starting program: /var/www/empty/bin/linux/luxe_empty 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/i386-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
[New Thread 0xb75bdb40 (LWP 18915)]
@EduardoLopes
EduardoLopes / main.hx
Created December 10, 2015 14:21
Luxe Pixel Perfect camera scale
override function onwindowsized( e:WindowEvent ):Void {
zoomRatio.x = Math.floor(Luxe.screen.w / gameResolution.x);
zoomRatio.y = Math.floor(Luxe.screen.h / gameResolution.y);
//get the smallest zoom ratio between zoomRatio.x and zoomRatio.y, and limit it to be greater or equal 1
zoom = Math.floor(Math.max(1, Math.min(zoomRatio.x, zoomRatio.y)));
var width = gameResolution.x * zoom;
var height = gameResolution.y * zoom;

Debug info got from commit 1c1283c6316be915e211c600fd5eb79e2f710e60 on debug mode

(gdb) run
Starting program: /var/www/empty/bin/linux/luxe_empty 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/i386-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
@EduardoLopes
EduardoLopes / gist:6b9850a7af6fc9babb2f
Last active December 18, 2015 17:21
luxe empty project debug - compiled with hxcpp commit history on 0872fd15501c15f99aa136ba14d859e0cb9aa97a
(gdb) bt
#0  0x08714fa8 in hx::MarkAllocUnchecked (inPtr=0x8932324 <hx::__res_0+4>, __inCtx=0x896be28)
    at /media/160/.haxelib/hxcpp/git/src/hx/gc/Immix.cpp:1307
#1  0x0806d562 in hx::MarkAlloc (inPtr=0x8932324 <hx::__res_0+4>, __inCtx=0x896be28)
    at /media/160/.haxelib/hxcpp/git/include/hx/GC.h:284
#2  0x0807e5fb in hx::MarkMember<String> (outT=..., __inCtx=0x896be28)
    at /media/160/.haxelib/hxcpp/git/include/hx/GcTypeInference.h:36
#3  0x0831ddc7 in phoenix::Shader_obj::__Mark (this=0xb7be433c, __inCtx=0x896be28) at ./src/phoenix/Shader.cpp:1971
#4  0x0871517a in hx::MarkObjectAllocUnchecked (inPtr=0xb7be433c, __inCtx=0x896be28)
@EduardoLopes
EduardoLopes / debug.md
Created December 20, 2015 02:54
luxe empty project debug - compiled with hxcpp 3.2.203 official package
$ gdb luxe_empty
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
Type "show configuration" for configuration details.
@EduardoLopes
EduardoLopes / randompaper
Created September 22, 2016 15:21
Phyton script to randomly change wallpaper on lubuntu picking the wallpaper form a folder
#!/usr/bin/env python
import os,random
wallpapers_dir = '/media/100/Wallpapers/';
wallpaper = random.choice(os.listdir(wallpapers_dir))
os.system("pcmanfm --set-wallpaper="+wallpapers_dir+wallpaper)
@EduardoLopes
EduardoLopes / Main.hx
Last active October 5, 2017 15:56
Luxe shutdown bug - test case
/** TEST 4 **/
/** It tries to destroy NOT_child_sprite even when destroy is called from where Luxe.shutdown is being called **/
import luxe.GameConfig;
import luxe.Input;
import luxe.Sprite;
class Main extends luxe.Game {