Brown & Green Cubes
After playing Minecraft until 5am for the first time the weekend prior to YHack, I thought about building the basic features of Minecraft would be fun and challenging.
What it does
This is a single player game where the camera is controlled by WASD keys for planar movements and cursor for rotation. When looking at a clickable object, the camera rotation is prevented (different from the actual game). To "mine" the blocks, players must click on the block object multiple times until its "health" goes down (differs from actual game). Particle Systems (mini blocks that fly out) are then launched out of the block for interaction feedback. Once a block is "mined," a compact version drops, floats, and rotates above the ground.
How I built it
Using material assets from Unity's Tanks! tutorial and the cube self-rotation concept from Roll-A-Ball tutorial, I was able to create animations with simple assets.
Challenges I ran into
This was my first time learning and using Particle Systems and customizing the produced particles. Another challenge was the camera rotation using the cursor's position. The most difficult challenge (that I could not solve) was making the Particle System output the same material as the cube it is attached to. The goal was to be able to scale up the cubes with different materials without creating a separate particle system for each block type the map maker creates. Further investigation is needed here.
Accomplishments that I'm proud of
Having the Particle System in the game really saved time and unnecessary loading of new objects. It make made it look more like Minecraft which was a huge plus. I am really proud of finally knowing how to move the camera based off of arrow key inputs. Even though it the planar movement may be considered trivial, it was definitely a milestone in my books after many different Unity projects.
What I learned
I learned what is a Particle System and how to move/rotate the camera with arrow key inputs and cursor.
What's next for Minecraft - POC
Listing from highest priority to least:
- Make cubes scalable
- Add a weapon to simulate attacking
- Collecting cubes and having a storage
- Having a map maker (Bonus: environmental effects)