Skip to content

Instantly share code, notes, and snippets.

@EduardoLopes
Last active October 5, 2017 15:56
Show Gist options
  • Select an option

  • Save EduardoLopes/2d0e9e21a52a1a65efe08cd0b38a2057 to your computer and use it in GitHub Desktop.

Select an option

Save EduardoLopes/2d0e9e21a52a1a65efe08cd0b38a2057 to your computer and use it in GitHub Desktop.
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 {
var sprite_1 : Sprite1;
override function config(config:GameConfig) {
config.window.title = 'luxe game';
config.window.width = 960;
config.window.height = 640;
config.window.fullscreen = false;
return config;
} //config
override function ready() {
sprite_1 = new Sprite1({
name: "sprite_1"
});
} //ready
override public function ondestroy() {
super.ondestroy();
//sprite_1.destroy();
}
override function onkeyup(event:KeyEvent) {
if(event.keycode == Key.escape) {
sprite_1.destroy();
Luxe.shutdown();
}
} //onkeyup
} //Main
class Sprite1 extends Sprite{
var not_child_sprite : Sprite;
override public function init(){
not_child_sprite = new Sprite({
name: 'NOT_child_sprite'
});
}
override public function ondestroy(){
super.ondestroy();
not_child_sprite.destroy();
not_child_sprite = null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment