How I Coded Doom in JavaScript (Beginner)
HTML-код
- Опубликовано: 12 май 2024
- Follow along by entering the code into the free online code editor at editor.p5js.org
My code: editor.p5js.org/moonloops/ske...
#p5js #3d #javascript #coding #codingtutorial #doom #javascriptgame - Наука
first time hearing of p5 ,and first timing trying to implement a game ,i had fun thank you for this great video .
Glad you enjoyed it! :D
greatttttttt🔥🔥🔥🔥🔥
this isn't doom, this is wolfenstein 3d. doom uses binary space partitioning (BSP) to make areas with different heights
yes, you're right. I considered calling it Wolfenstein 3d (which celebrated 32 years on the 5th of May) ... but I worried not many people would know what that was! (p.s. how good was Wolfenstein 3D!)
🐐🐐🐐🐐🐐🐐🔥🔥🔥🔥
Looks good, but you check collision with each wall, even the one on the other side of the map.
Yes, that's a good point. How would you improve on it? :)
@@moonloopsdev Make the character check if the move he is trying to complete is possible or not.
It’s a good idea. I’m just wondering though how we would know if a wall is close to us or not? Wouldn’t we still need to loop? (Maybe there is a better way to do it, I just can’t think of it right now.)
Never mind, a potential answer just came to me: maybe we could have a grid system? That way we’d only need to check walls in the same, or adjacent grids?
@@moonloopsdevthats it. A matrix will solve this issue.
amazing how you did it without using three.js
It’s p5.js - webgl is built in! Really easy and fun to play around
Is there anything that JavaScript can't do?
Haha, if only it could clean my wardrobe
it cannot install a system on your computer
Actually, it can! Have a look at www.electronjs.org/
@@moonloopsdev without electron, plain js
@pje_ haha, ok, you’ve got me there 🤣