Small coding update: what I’ve done with Unity

A while ago I said I wanted to get back into coding.  I’ve only been doing an hour a week or so but I do have some successes.  Here’s what I’ve got and here’s what I still want to do:

I’ve got a few dispensers that I have labeled “gunpowder,” “nitroglycerin” and “TNT”.   Each dispenser will dispense particles corresponding to their name.  Gunpowder is set to explode with low force, nitroglycerin explodes with medium force and TNT explodes with high force.  I have a button which dispenses particles from whichever dispenser I choose, then another button makes all the particles “explode.”  If only a little gunpowder is dispensed, the explosion is kind of small.  If a large amount of nitroglycerin and TNT is dispensed, it’s a big impressive explosion.  Then I have a button to erase all the particles and dispense new ones.

What I still want to do are some things I think are much harder.  I want a way for the player in-game to create entirely new explosive particles with more or less explosive force.  What if I want them to invent C4, which explodes even better?  I also want a way to “centralize” the explosion.  Currently every particle moves in an entirely random direction, but actually they should all explode outward from whatever point in space the explosion began at.  Once I can centralize the explosion I can make explosions that have multiple starting points, and from there I want parts of the game to allow the player to learn how to use explosive shape to perform certain tasks, and thereby gain the resources to build better explosives to perform new tasks.  Also eventually I’d like to be able to put in some amount of “control” by which certain explosives (like gunpowder) explode easily even when you don’t want them to while others (like C4) are very stable and don’t explode unless you really make them.

So all that’s to say I still have a long way to go.

Coming soon (hopefully): More programming

So a while ago I discussed a tiny tiny Unity programming project that I wanted to work on.  I wanted to make it so I could create little boxes using a button, then have those boxes all explode outward depending on how many boxes were on screen.  I am proud to say I successfully did it, and am now looking to expand my Unity knowledge.

The most immediate desire would be to make these boxes act more like particles of explosive material, IE they should explode in directions that are away from the densest cluster of themselves.  Then I’d like to see if I can make the explosion start in a particular place and travel along the length of the material until all the material has been exploded.  I’m not sure at all how these would work, but they’re part of an idea for a game I’ve been having for a while now.

Update: I’m learning Unity

I’ve always enjoyed video games and wanted to create my own.  I may never actually make one but at least this is a way to exercise my creative side.  My wish is to make a game called something like “Build the Biggest Boom.”  It would be a game all about the chemistry of fire and explosions.  It would start by teaching the player how explosions work, how they can be shaped to send their force in a specific way, and why some compounds explode while others don’t.  There would also be an element of simple engineering to create the devices which would how explosive charge and to detonate.  The game would proceed similarly to Kerbal Space Program where instead of trying to build rocket ships to go to the moon, you build bombs to create the biggest boom.  You do simple research which teaches you the basic chemistry of explosions and then put parts and molecules together in such a way to create bigger and bigger booms, both by creating better explosive materials (for instance nitroglycerin instead of gunpowder) or by making things explode more effectively (ex the shape of the bomb).  There could also be an element of designing explosives to fulfill a specific purpose, such as proximity fuses to only explode when near something or waterproof fuses to explode underwater.

That’s all well and good, but so far I’ve done only the following:

-Make a cube that goes up when space bar is pressed

-Make a box that creates cubes when return is pressed

-Spawn a bunch of going-up cubes with return, then send them up with space bar

-Created a ceiling to stop things from going up too far.  Turns out that to create a ceiling, you have to create a floor upside down.  Who knew

So I want each “cube that goes up” to eventually be a particle in an explosive reaction.  Instead of just going “up” I want them to gain a force proportional to all the other particles near them (as an analogy for every molecule releasing explosive energy) and therefore “explode” outward when the space bar is pressed.  From there I can do the stuff of having different particles have different explosive energies, and having shape charges and stuff.