Submit templates for here.

← Back to all posts
👌🎮 Platformer video game template 🎮👌

This template will give you the simple yet important starting point for a platformer game. It will include smooth physics, movement, and a collision detection function.

IMPORTANT things to know:

  • To add walls and other objects make sure that the element has "object" as its class
  • The player element HAS TO have player as its id

What you can do with this template:

Link to that demo project: click me

(Link to demo 3: click me)

Platformer attributes:

  • {"y":STARTING_POINT_X, "x":STARTING_POINT_Y} - this will be the spawn point coordinates


  • collision(element1, element2); - detects collision between two elements
  • remove_px(str) - removes the "px" part of a string

Methods of Platformer:

  • check_death - detects if a player is below the screen's view
  • respawn - teleports you back to the spawn point
  • touching_platform - detects if the player is touching a platform
  • check_key - does some action with what keys are being pressed
  • jump - makes the player jump
  • left - makes the player move left
  • right - makes the player move right

UPDATES since 5/19/2020:

  • If you have a div with the class lava it will automatically recognize that as lava. And, If the player touches the lava, the game will respawn the player.
  • The gravity is more realistic! The longer you stay in the air going down, the more acceleration you get.

Contact me:

If you're having any issues please feel free to contact me at [email protected] and I will try to respond within the next 5 hours.


Looks cool, definitely worth trying it in my opinion. The add-on is nice, I don't like the default font as well, and was looking for something to replace it. The UI is an important part of the game, because if you don't like it, or it's not convenient for you, then it affects your gaming performance and the gameplay experience entirely. I did try to use an add-on for LoL to change the font, but I got banned for this. Thanks to lolfinity that I could get a new account fast, because I was preparing with my friends for a local mini-tournament, and I wouldn't be able to play.


Super cool. Probably I will use it in the future. I don't code JS, but I plan on learning it in the future. Thanks for sharing


The movement is a bit jittery and not very natural. Otherwise, good job!


@lukechu10 Thanks 😁! I noticed that you didn't upvote...




@Zuhdi28 If you want to try using it, I can help you. Also, thanks for upvoting!


@PowerCoder no i don't need help


@PowerCoder also you can visit my post
you'll enjoy it


@Zuhdi28 I upvoted it. Nice knight:


Very Nice, will sure use!
There is a glitch were if you go off the edge and then back to the middle again the cube gets impaled in with the platform and doesn't die (and can still move around) this would be a cool feature for a game but how do you fix it lol


@xolyon Yeah. My tester(my brother) figured that out. I was going to do it. (And I know how to.) But, I thought that it would confuse a lot of people. Plus, it makes there be more work for whoever is using my template. But, since you brought it up, I will start trying to fix that. And, I will try to find a more efficient way than what I had in mind before.


@PowerCoder I kinda like the glitch tho (i know how to fix it too just people using it won't) so maybe leave it to code somewhere also could you add scroll or scenes?




mobile support much