You are browsing as a guest. Sign up (or log in) to start making projects!

FlatCraft

  • 23 Devlogs
  • 113 Total hours

dig make https://flatcraft.blxm.me ROADMAP:https://github.com/users/BlxCode/projects/5

Ship #1 Pending review

FlatCraft

Basic Info

FlatCraft is an open source, MIT licensed 2d Minecraft inspired game. It uses LittleJS for the rendering, and vanilla HTML/CSS/JavaScript for the UI. All the rest was written by me.

Challenges:

One of the biggest challenge was world generation. The idea was to use simplex noise to make terrain, but there was one problem: It’s uncontrolability. I wanted real biomes, but that coudn’t happen because I didn’t know how to control simplex noise. Nor did I know how to make mountains. I solved it by realizing that this is just a silly 2d Minecraft game for a program designed to get teens to make something, not for teens to make some complex minecraft like game, so I decided to bite the bullet and to just make an array for each biome, and have that array contain the y level of the highest block, and use that array to make the terrain. It’s basically like [1,1,2,2,3,3]. Nothing complicated, and if you played this game long enough you’ll see that each biomes are litterally the same.

Most Proud of:

I’m actually most proud of the custom skins part of flatcraft. It’s really not that complex, but it took a mesruable amount of time to get it working. I had to learn node.js, finally had a use for a server! and used my old chromebook as my server. I made the precaution of adding a ratelimiter just in case someone tried to take it down or whatever, but yeah. That’s what I’m most proud of.

What I learned:

  • Making classes in js
  • NodeJS
  • LittleJS engine

Stuff that didnt make it into the game:

Game music
Mobs

Credits

Art:

Me, mostly me, My little brother
Inspired by https://www.planetminecraft.com/texture-pack/digs-simple-pack-1-15-100-complete/, and https://bloxd.io

Programming:

Me

Libraries used:

  • LittleJS
  • 23 devlogs
  • 113h
Try project → See source code →
Open comments for this post

5h 39m 48s logged

Sprinting

this will be my last ever devlog!

New Features:

FULL Random world generation:

It works like this:

Seeds:

Seeds are not that important, though they do play a part for terrain generation.

Terrain:

The terrain is basically just a huge array with preset Y levels depending on the terrain type, ie: mountianus, hilly, flat.

Ores:

Ores are truly random. It dosn’t depend on the seed.

Trees:

Trees are also truly random

Sprinting:

Double press the key in the direction you want to go to sprint

that’s it! plz rate it well :yay-67-55:

0
0
37
Open comments for this post

6h 12m 1s logged

Saving worlds… I hope

Honsetly, school has been removing litterally half of the day I would have used to do flatcraft, so… yeah. im also writing this at school cuz i needed to sleep. dont tell anyone lol

New Features:

Saving

It’s quite simple actually. Just saving an object with some world data to local storage. Honestly, that’s it.

Flower

flower. very cool

Terrain generation

Terrain generation, no ore generation lol

0
0
23
Open comments for this post

5h 58m 9s logged

Tools Update!!!!111 3 more hard gh issues to go! yay

it’s like 2:30 on a friday. not bad, but considering school is back, not good either. Honestly, i swear Idk if i can actually finish this before sep 20th, so if i can’t i’ll actually do 100 pushups. and it WILL be on a devlog. so uhh… yeh. idk why but you can see me do 100 pushups.
defenatly not in a row tho my arms are actually twigs bro. ok enough yapping, let’s actually get into this.

New Features: Tools!!111

tools. the final implementaiton was quite simple actually. I just added tools to the textures, and added them to the metadata, added a few bits of code for the speeding up of breaking blocks and boom! tools.

Changes & Bugfixes:

  • Compleated Metadata
  • Drops now produce 80% less lag (by making sure that only 1 shadow per x coord can exist)
0
0
26
Open comments for this post

8h 33m 13s logged

Lighting & Dropping stuff

i’ve been slacking off recently, and I mean it. I’ve coded less, and played more games due to the uhhh looming school season starting again but like… i’ve still managed to make things like lighting, dropping stuff, and shuffeling stuff in ur inventory by using the number keys.

Features

Lighting

At first, this was one of the reasons why I decided to switch to little js, but like their system is not designed for 2d minecraft use, so I had to improvise. The lighting system consists of two basic things. One is the ambient lighting, which basically fills the whole screen with light / filling the whole screen without light, and the second thing is like “light objects” by that, I mean like point lights, which are like round lightbulbs per say, and they emit light. Those would be used for stuff like torches.

Q

Dropping things with q didn’t exist in the 2 part drops update, cuz i was too lazy to implement that. But now, I added that. It’s simple really, it just creates a new droppped item every time u press q. and if u press q with control, then it drops everything in the hotbar slot hovered, and u can drop things in ur inven by hovering over it.

Moving things around in ur inventory with the top number keys

I added that cuz im just used to that in uhhh…. bloxd.io so yeah, i just added that.

Attack anim

press mouse button 0 to attack. currently just attack animation for now

Changes & Bug fixes

  • Random tick events for stuff like grass turning into dirt or vice versa
    *greijodkmgrfd idk, it was in my commits smth to do with promises
0
0
27
Open comments for this post

8h 49m 48s logged

Inventory

Ok so i’ve basically just coded the inventory system. uhhh

New Features

Inventory System

Ok so this is how it works:

  • There is an object that has all the invetory data
  • There is a function that renders it
    it works like that so u dont render the inventory every frame. that would cause SOO MUCH LAG

Place blocks

Uhhh… place blocks
and it also checks if the block u placed collides with any blocks or players and if it is next to a block

Changes & Bug Fixes

  • Fixed some weird crouching behavior that I cant really explain cuz it’s like weird.

Dont mind the fact that the game bugged out… it’s cuz i forgot to add metadata to the pine logs and rickroll block thingy

0
0
7
Open comments for this post

8h 18m 31s logged

Drops Part 2

Last devlog, I finished the drop part of drops! This time, I finished the pickup part of drops, and the hold part, though I feel like I do need to tweak the values, I just don’t know by how much.

New Features

Pick up:

The pickup part of drops is basically just an if statement that runs like every frame to see whether or not the player is near enough to a dropped item for them to pick it up. It’s quite simple.

Hotbar:

I feel like I finished the hotbar, not the inventory system yet, just the hotbar. I finished the “rendering” part, by that I mean like viewing the inventory object and rendering the stuff that is on the hotbar.

Changes:

  • Renamed the id of the Inventory div to the Hotbar
  • Readded the FPS counter, and gave it an overhaul
  • The lower arm animation actually plays now
0
0
72
Open comments for this post

8h 53m 5s logged

Drops Part 1

Drops! Though… you can’t pick them up yet… uhhh, and I’m nearing the 10-hour mark, so… yeah. I also completely rewrote the movement code and tweaked the values in collision detection, so that’s like half of the time. Also, it turns out I am not an engineer, as I rewrote my own drops code TWICE in the span of TWO HOURS because of chatgippity roasting me and me roasting myself, respectively. (Also, new dev log format, yay!)

New Features

Drops (partially)

Drops were annoying to implement, partially because I’m a skill issue, and also because I had to learn new things like making classes and stuff like that.

Changes & Bug Fixes

Collision system revamp

The old system was weird and also sometimes inconsistent, so I rewrote the movement system and tweaked the collision system.
Overall, a bit of a smaller update if you ask me, and its ONE AND ONLY FEATURE wasn’t complete. Oh well… looks like we’re going to get the next dev log soon.

0
0
82
Open comments for this post

8h 4m 52s logged

Block Breaking and Particles!

half of the time was spent fixing bugs

uhh… ignore that youtube video…

New Features:

  • Shadow
  • Particles when touching ground after falling, walking, and after breaking a block
  • Block Breaking

Changes & Fixes:

  • Added more things to the block metadata object
  • Fixed collisions not colliding
0
0
34
Open comments for this post

16m 58s logged

Bug Fix:

I didn’t include the no falling if you are crouching in the last update so i just quickly added an if statement to include that feature.

0
0
18
Open comments for this post

1h 43m 53s logged

Players!

Players are finally out. After what? 2 progress updates? Wow, that was harder than I imagined. Especially the physics. I had to think creatively and outside of the box for this. Also, this devlog continues from the last one. Just pretend that the progress updates like didn’t exist or just aren’t canon.

Finished Features:

Players:

  • Player Physics
  • Player Animations

Changes:

  • Slightly adjusted dirt texture
  • Increased label elements’ font size
  • Patched weird css border glitch
  • Deleted unnecessary assets (like the custom cursor that only existed for like 5 minutes, 2 months ago)

What’s Next (In order):

  • Crouching, and not falling ✅
  • Drawing tools (hardest one, btw) ✅
  • Breaking blocks with tools and fists
  • Custom Skins (it’s literally 90 % complete now, but my server is down due to some real life events so have to wait) ✅
  • Sandbox world
  • Mobs if i have time
  • ship

ps. if you are wondering why the screen recording has some static noise, it’s because i have a small desktop fan running like really close, because it’s kinda hot indoors. I don’t know why it’s making tha t sound, it dosnt make that sound irl to be clear. I think it’s because i accidently turned on my mic and my mic is currently my crappy very quiet laptop mic

0
0
18
Open comments for this post

8h 8m 20s logged

Progress Update #3

I’m too stupid to do physics. I should have made everything with Box2D. I’m currently fiddling with side collisions, as all other collisions (I hope) are done. I’ve also finished jumping and falling physics. Also, I’ve spent another 8 hours, and I want every minute to be for my new 3d printer.

Finished Features

Jumping

My Jumping physics thingy is like the poor and stupid man’s way to do it, but hey… at least it works. It kinda just has a jump multiplyer and it goes down every frame and every frame the player goes up something like 0.05 block units multiplied by the jump multiplier

Falling

Falling is basically the same as the jumping one.

i added sky

yes, its a sky :D only a gradient. ill add sun and moon soon prob hopefully idk if there will be night, idk if i can create a night in time.

Unfinished Features

Side collisions

This is stupidlly harder cuz my blocks’ x center is at 0, not 0.5. this means that a block spans from like -0.5 to 0.5. My brain cant handle this… thing.

0
0
22
Open comments for this post

10h 9m 34s logged

Progress Update #2:

Why, you may ask, do I do progress updates? It’s because only 10 hours MAX can be logged per dev log, and uhh… I think you get the picture. So, without further adieu, this is what I’ve been working on.

Unfinished Features:

Players (85% Complete)

That’s a huge jump from the last time I’ve updated you on the progress on players. Now the thing is, physics is annoying. And I’m not old enough to study calculus at my high school. Which is a shame, as I really like the idea of calculating values based off of differentiating values. I’ve literally just been playing around with the physics at 3 am!??!? Wow! It’s literally 3:30 in the morning. I should go get some sleep. The jumping and crouching are a bit finicky, but I’ll fix them sometime later.

Closing Remarks:

First of all, a lot of the 10 hours in this progress update have been miscellaneous things like bug fixes or just general tweaks. I’ve also been realizing that this project is big. But the end of the tunnel is still nowhere in sight. Yet, if I can stop sitting around and start sprinting towards, uhh… any direction, there will be light at the end of the tunnel. I hope I can finish this project before school starts. I’ll have to grind like a lot, and especially at night because my siblings are quite brain-rotted, annoying, and loud.

0
0
10
Open comments for this post

2h 35m 14s logged

Custom Skins!

After a lot of time getting the back-end setup (with some help from ChatGPT, I’d have to admit), custom skins are here! (Granted… players aren’t here yet so you can’t really try them out lol.)

New Features

Changes & Bug-Fixes

  • Grass Retexture
  • Dirt Retexture
0
0
6
Open comments for this post

8h 16m 52s logged

Progress report:

I have been grinding this, and I haven’t posted a dev log in a while because I haven’t really finished anything, so this will be a progress report.

Finished Features:

New dirt, and grass textures

The old textures suck, because in between blocks there would be like a small section where there is like no detail, so I added those details and recolored the grass bit of the grass texture because the old one was too “limy.”

Added bedrock

Self-explanatory; no interesting thing happened that I would want to yap about

Updated Game rendering

Last devlog, I ported my rendering side of the game to LittleJS, a browser game engine. Why? Because I realized that I wouldn’t have the time and effort to manually do advanced stuff like lighting and particles. Hence, I ported to LittleJS. Now, in the days after the port, I had to fix a lot of things and bugs. Originally, the game would render everything, even if it wasn’t on screen, so I fixed that. I made it so that if you couldn’t see the blocks in the camera, they wouldn’t be rendered.

Unfinished Features:

Flat Game Mode (90% Done):

I decided that tinkering with sandbox mode first would be stupid, as I would still have to make players, inventory system, etc. I feel like I’ve finished everything, but there is something missing. The sky. I still need to make the sky. I don’t know if it should be an image or something else.

Players (10% Done):

All I have done for players is literally a goffy ahh skin (which I should make better) and a player variable. I think you would be able to piece together what I want for this.

Custom skins (60% Done):

I want to make custom skins. I have completed the UI, the security part of the server-side (aka my old broken ahh Chromebook) code, and a simple UI for it. All I need to make now is server-side code to store the custom skin and deliver it to the client.

0
0
13
Open comments for this post

5h 40m 51s logged

The LittleJS Update

Yes, this doesn’t look like much, but it took 5 hours over the span of multiple days and a LOT of trial and error to get to this point! I had to learn so many things, like Promises, async and await, how to make new classes, and LittleJS. But why? Why go through so much trouble? That’s because I’ve realized that I would not, in my current state, be capable of making a full Minecraft clone using only the vanilla HTML Canvas. I chose littleJS because of the promise of fast and lean, and I had already tried it before but failed; I wanted to redeem myself.

New Features

  • The rendering part of the game is now done with LittleJS
  • Popups now have minimum width and heights
  • Create new world form now has placeholder text for those who are lazy to type stuff

Fixes

  • Renamed Ebony to Cedar because Ebony trees are not pine trees
  • Removed the useless pausing system
  • Removed all of the old rendering system

(NEXT UPDATE: Create worlds from seeds 😭 i need help with this)

0
0
6
Open comments for this post

4h 7m 58s logged

The Terrain Preparation Update

This is a BIG UI update, and in the next update I’ll add scripting to most of the world menu UI, which has not yet been scripted.

New Features:

  • Play Button (shows after the loading screen is finished (in order to get the main menu audio to play))
  • Main menu music (from opengameart.org)
  • World Menus UI
  • World Creation UI
  • Temporary Gradient Background (To be replaced by game screenshots)
  • Scrollable Credits

Fixes

  • Fixed some spelling mistakes in the code
0
0
4
Open comments for this post

2h 59m 20s logged

The Loading Screen Update

  • Added a loading screen which goes to 90% and then waits for the CrazyGames SDK.

  • Removed all NPM dependancies and replaced them with CDNs

  • Added a squeeze in animation when closing Loading screen and Main Menu

  • And much more!

(NEXT UPDATE: Create worlds frm seeds with basic terrein 😭 i need help with this)

0
0
6
Open comments for this post

1h 20m 38s logged

The Backdrop Update

  • Added Backdrops to all popups
  • Added a “pausing” system (just disabling keyboard input for now)
  • Added Animations like popup to the main menu elements
  • Added some NPM packages
0
0
3
Open comments for this post

27m 2s logged

re-done block rendering, adding a function instead of just drawing it onto the canvas, added more textures (gems in block form) and redid dirt texture. Also added movement (only canvas movemnt)

0
0
3

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…