Minecraftish

By: Jonathan Tan

Fall 2017, CSC 471

The Project

This project is very similar to minecraft except the user can spawn blocks, and just create things such as buildings or trees.

The main controls are the WASD keys to move around, the space bar to jump, F to create a block, R to remove a block, X,Y,Z, to rotate about the x y and z axis respectively and T to cycle through the textures. The user can face a block and click it to select it and move it around. As the user moves around they can jump onto locked blocks so in the pictures they can climb up and down the pyramid.

The user can also select C to toggle free camera mode and explore the world instead of the first person camera as shown below.

There are two types of blocks in the image(togglable using L), blocks that are free to be placed wherever the user wants and blocks that snap onto the plane. (Free blocks are on the right and the locked blocks are snapped to the ground on the left side.) The free blocks have an attribute 'gravity' that is togglable via the button M. This can be seen in the image below with gravity turn on on the free blocks. The blocks also bounce a little bit when they impact the floor so there is a little bit of physics in this game by associating a velocity vector with each cube and redirecting the velocity upward when it hits the ground.

The blocks that snap automatically snap to the ground where the user put it and they are able to stack blocks up. This is modeled by using a 2D-Array and keeping counts on the highest positions and updating the y positions of those blocks. A cool feature is that in the stack, if a block is removed, the blocks on top drop down and update preserving the order that it was put on the stack.

Saving and Loading Files

The cool feature of this game is that the state of the world can be saved to a file and be reloaded in to preserve the state of the world by pressing P. When running the program, the user can specify an output file to write to. If nothing is given, the program won't do anything if the P button is pressed.

The pyramid in the pictures was actually generated by a python script that created the file to input. It loaded up the locked blocks and the program compensated and updated variables in the world to reflect the pyramid.