Created
November 25, 2014 17:27
-
-
Save DjPale/16d448f2199f8f0d45d2 to your computer and use it in GitHub Desktop.
luxe engine Particle System bug - check Web and Native target for different behavior
This file contains hidden or 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
| // luxe engine Particle System bug - check Web and Native target for different behavior | |
| import luxe.Input; | |
| import luxe.Particles; | |
| import luxe.Color; | |
| import luxe.Vector; | |
| class Main extends luxe.Game { | |
| var particles : ParticleSystem; | |
| var part_tex : phoenix.Texture; | |
| override function ready() { | |
| part_tex = Luxe.loadTexture('assets/particle_star.png'); | |
| part_tex.onload = setup; | |
| } //ready | |
| function setup(_) { | |
| particles = new ParticleSystem({name: 'p'}); | |
| particles.add_emitter({ | |
| particle_image: part_tex, | |
| rotation_random: 360, | |
| speed_random: 1.0, | |
| pos_random: new Vector(-20, 20), | |
| gravity: new luxe.Vector(0, 90), | |
| life: 2, | |
| emit_count: 2, | |
| emit_time: 0.1, | |
| start_color: new Color(1, 1, 0, 1), | |
| end_color: new Color(1, 1, 0, 0), | |
| }); | |
| particles.pos = Luxe.screen.mid; | |
| } //setup | |
| override function onkeyup( e:KeyEvent ) { | |
| if(e.keycode == Key.escape) { | |
| Luxe.shutdown(); | |
| } | |
| } //onkeyup | |
| override function onmouseup(e:luxe.MouseEvent) | |
| { | |
| } //onmouseup | |
| override function update(dt:Float) { | |
| } //update | |
| } //Main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment