Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import haxepunk.Entity;
- import haxepunk.HXP;
- import haxepunk.Scene;
- import haxepunk.graphics.Image;
- import haxepunk.graphics.Graphiclist;
- import haxepunk.graphics.emitter.StaticEmitter;
- import haxepunk.utils.Ease;
- class MainScene extends Scene
- {
- private var se:StaticEmitter;
- private var e:Entity;
- override public function begin()
- {
- e = new Entity();
- se = new StaticEmitter("graphics/particle.png");
- se.newType("tell");
- se.setMotion("tell", 0, 50, 0.2, 360, 10, 0.1, Ease.sineIn, true);
- var i = Image.createRect(100, 50, 0xff0000);
- i.centerOrigin();
- var g = new Graphiclist();
- g.add(i);
- g.add(se);
- e.graphic = g;
- add(e);
- }
- override public function update()
- {
- super.update();
- se.emit("tell");
- e.x = Math.cos(haxe.Timer.stamp()) * 100 + HXP.halfWidth;
- e.y = Math.sin(haxe.Timer.stamp()) * 100 + HXP.halfHeight;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement