-
Notifications
You must be signed in to change notification settings - Fork 2
Phaser methods with Infusion wrapper
Though these methods are very obvious if you understand how the project works. But I kept these for reference so as not to again and again look at the Phaser documentation. These are surely not all the methods from the library or used in Discovery Cat, but these are the ones that are used very much in the project.
obj.x = <value>;
obj.y = <value>;
that.add.sprite(x, y, "spriteName";)
that.<name>.addChild(that.add.sprite()2);
that.physics.arcade.enable(that.player);
that.player.body.immovable = true;
that.physics.arcade.overlap(that.sizeDoor, that.cat);
// lets overlap
that.physics.arcade.collide(that.ground, that.cat);
//creates seperation
that.load.image("image_name", "image address");
that.load.spritesheet("sprite_name", "sprite_address", x-dist, y-dist);
that.add.sprite(50, 50, "doorh");
that.cursors = that.input.keyboard.createCursorKeys();
then simply use that.cursors.left.isDown
and others.
that.enter = that.input.keyboard.addKey(Phaser.Keyboard.ENTER);
that.enter.isDown
that.enter.onDown.add
vs
that.enter.onDown.addOnce
that.add.button(x, y, "spriteSheet_name", callback, that, over, out, in);
that.obj.animations.add("<anim_name>"[0, 1, 2], 10, true<loop_bool>);
that.obj.play("<anim_name>");
that.add.tween(that.obj).to({ <values> }, <tween_time>, Phaser.Easing.Sinusoidal.InOut, true);