/shootcraft

Little demo of Minecraft if you could shoot blocks from a gun

Primary LanguageJavaScript

ShootCraft

Summary

A simple Minecraft-like builder game where you can build with either mouse clicks or a projectile cube shooter.

This project uses Three.js and builds from the Three.js voxelpainter demo.

Instructions

Clone this repo and open Projects/index.html in your browser.

Locomotion

  • W: forward
  • S: back
  • A: left
  • D: right

When cubes are placed, player will automatically climb when stepping forward onto a cube one level higher than where the player is at. If cubes ahead of player are two or more cube-heights higher than player's current position, it will be treated as an obstacle the player cannot pass.

Look Around

Left mouse drag to look around. (Eye icon in upper left when left mouse button is down will indicate you are in 'look' mode.) In a full VR setup, this would be done with head movement.

Pick a Color To Build With

Hit tab to cycle through which color block you have "chambered". (Appears in second icon in upper left.) When you next place a block, it will be this color.

Build/Destroy

You are in mouse 'build' mode when you hold shift down. Left mouse clicking will add a cube to the closest grid space to your mouse click.

And the fun part - you can build by shooting a cube with the spacebar (you do not have to hold down shift, this works in any mode). The cube will be shot in the direction your camera is facing, and will snap into the nearest grid space when it runs into another cube or the ground plane.

Note that the cubes act as if magnetic, it will snap onto the side of another cube as well as the top, if that is the closest surface it collides with.

You are in mouse 'destroy' mode when you hold ctrl down. Left mouse clicking will remove any cube you click on.

Future Improvements

Some features to add:

  • More interesting block textures
  • Variable initial shooting force (player can control with a dial)
  • Aim gun with hand/arm controls (Kinect?) separate from head movement
  • Multiplayer (build cooperatively)
  • Physics (allow player to knock down existing blocks by shooting other blocks)