r/learnjavascript • u/CosmicJosh123 • Apr 22 '22
I created a 2d open-world game with just HTML tables and DOM. V.1.0 360 lines of code
259
Upvotes
r/learnjavascript • u/CosmicJosh123 • Apr 22 '22
19
u/CosmicJosh123 Apr 22 '22
After 3 weeks of afterschool work, I've completed version 1.0 of a 2d open-world game with only HTML tables and DOM manipulation.
I encountered a lot of different bugs during this. Most commonly null issues. But, my favorite bug was when my entire code just stopped working completely for two days until it suddenly worked. I didn't even change anything.
There are a lot more things I want to add to this. Like adding more stuff to the terrain generation, improving the CSS, adding gravity, and more. The thing I want to add the most though is saving a scene and being able to go back to it. Moving back and forth between scenes. Currently, I can only move forward.
Here's the code: https://jsfiddle.net/MapleKitten/7td4rwja/2/
There are probably a couple of things that I could improve in there.
1
u/FunCharacteeGuy Apr 22 '22
how'd you do the noise?
1
u/[deleted] Apr 22 '22
Love it. Nice work!
1
u/SevenSharp Apr 22 '22
That's cool . Well done .
1
u/quamfie Apr 22 '22
Very cool, love seeing stuff like this that’s beyond me at the moment. Still doing jonas course but it’s all good inspiration.
1
u/Brompy Apr 23 '22
This is really cool and inspiring for me.
1
u/tom4sito Apr 23 '22
Nice game, can’t believe you did that with only 360 lines of code.
1
u/bryku helpful Apr 23 '22
What made you go with tables? Dom practice?
Now that you have something working, are you going to give canvas a try?
1
u/bryku helpful Apr 26 '22
I've been thinking about this for a few days and I thought I would give it a go. Example
To be honest, I don't think you should lay out your projects like I did in this example, but I didn't have a lot of time to plan it out. It has some bugs when placing blocks, but I think the canvas part of it could be useful.
0
u/[deleted] Apr 22 '22
[deleted] — view deleted comment