How to Code a Platformer?

How do i code a platformer that has scrolling and enemies and health bars and animations @noobfield can u help? or any @moderators can help?

There are many engines for that, but you just need to fake gravity.

this.grav = 0;
this.gravStep = 1/20;
this.gravCur = 0;
this.onEvent('update',function() {
  if(!this.hits(ground)) {
    if (this.gravCur < 1) this.gravCur += this.gravStep;
    if (this.grav < 3) this.grav += this.gravCur;
    this.y += this.grav;
  }
});
2 Likes