Note
If you want to test out the command in the picture above, the last line should actually be "place a b c 1".
Inspiration
Commands in Minecraft allow for similar instantaneous spawning of blocks, but the structure is no way as versatile as a programming language, Unity also allows for cool physics simulations
What it does
You can write commands in a custom scripting language to spawn blocks into a flat world. Loops and variables allow cool structures to be created with a few lines of code. After creating your structure, you can detonate an explosive beside it and watch it all unfold.
How I built it
I originally didn't have a specific idea as to what I was going to build for the hackathon, but after playing around a bit in Unity, I built a third person controller that allowed grenades to be thrown by clicking. I started out by hardcoding in some test structures to blow up, but I realized that I could instead allow a player to do the same thing, writing code to create structures to blow up.
Challenges I ran into
Create the base for the game, like the first person controller and grenades, were fairly straightforward, but building the interpreter for the scripting language I designed was far more difficult. Particular challenges included parsing the user-entered script to ensure that it didn't have any syntax errors and processing and simplifying expressions that included variable names (like height = y * 3 / t + 180).
Accomplishments that I'm proud of
When I first started this project, I didn't expect that anything would actually come out of my experimentation with Unity, but after the full 24 hours, watching this game come together and actually become a cohesive unit was a great feeling.
What I learned
I came into this Hackathon not knowing at all how to use Unity, so one of the biggest things for me was learning how to use the program, which I'm sure I'll be using in the future again. Also, I realized that I didn't have to come into the hackathon with a specific idea, as it all came together in the end after all the playing around anyway.
What's next for Codeblox
While playing around with this project just as a sandbox game is pretty fun in itself, as watching things explode, especially things you've built yourself using code, is always satisfying. However, another potential use for this game is for educational purposes; a game like this could be used to teach people how to code, as gamification is often a very good tool to get people motivated to learn new things (who doesn't like learning when you're playing games).
Log in or sign up for Devpost to join the conversation.