123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|183|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Misc Languages -> quick prototype javascript platformer in 100 lines

Fri, 06 Jun 2025, 07:47
realtime

quick prototype javascript platformer in 100 lines


I challenge my self to create a quick prototype of platformer game in less than 100 lines.
Can only make the move mechanic, and it is already near 100 lines.

demo

source code available on the page, or this link
source code

keyboard only



-=-=-
me blog: fork-garden
Fri, 06 Jun 2025, 07:55
Jayenkai
Cool!
The fact you've counted the level data amongst the 100 lines makes it all the more difficult, so well done on that!!

-=-=-
''Load, Next List!''
Fri, 06 Jun 2025, 08:48
Kuron
Had to pop in and say this is one of the most impressive things I have seen in a long time. Very well done!
Fri, 06 Jun 2025, 20:22
Pixel_Outlaw
Hey that works pretty slick!

I'm not a JavaScript guy but would the following approach be possible to turn your left and right movement into a single calculation?
(This depends on subtraction of the two arrow keys creating a -1, 0, or 1)

Just wondering about how we can shrink it even further.
EDIT, you might need a double condition on that if that "sign" also not be 0.


Sat, 07 Jun 2025, 08:02
realtime
it works. thanks.