draw(renderer) { renderer.setColor(this.color); renderer.fillRect(this.pos.x, this.pos.y, this.width, this.height); } }
Modify PlayerEntity.js:
import ScoreLabel from "../ui/ScoreLabel"; // Inside onResetEvent() const scoreUI = new ScoreLabel(); me.game.world.addChild(scoreUI); melonjs tutorial
Fork the boilerplate, replace the assets with your own, and start iterating. draw(renderer) { renderer
update(dt) { // ... existing movement code ... draw(renderer) { renderer.setColor(this.color)