top of page

Melonjs Tutorial Instant

game.PlayerEntity = me.Entity.extend( init: function (x, y, settings) this._super(me.Entity, 'init', [x, y, settings]); // Add physics body this.body = new me.Body(this); this.body.addShape(new me.Rect(0, 0, 32, 32)); this.body.gravityScale = 1; // He falls! ,

Leo looked at the code, a grin spreading across his face. "Yeah. I extend me.Entity . I give it a body. I apply force. And I listen for the collision event." melonjs tutorial

// src/js/entities/Player.js import me from "melong-js"; game.PlayerEntity = me.Entity.extend( init: function (x

bottom of page