Space Junkies is a two player party game for tablets.
The goal of the game is to create a rocket made of space junk by dragging parts orbiting around the moon in the center onto your base.
You can also fling junk at your opponent to destroy parts of their rocket, but beware, they follow the laws of orbital mechanics and will come back at you if you miss!
Whoever manages to complete their rocket first can launch it and gets to engulf the enemy base in a huge fireball!
This game was created in a 48 hour period, it is not polished!
Since this was a game Jam I had my hands on most parts of the game, but I focused on implementing the rocket and item interactions. The following segment will explain the parts of the game I created.
The Rocket is a node tree hierachy made from the spacejunk parts, with an engine as the root of the structure.
Parts use polymorphism, every part type has different meshes, node lists and stats.
Nodes are in between elements with pointers to two pieces of space junk, they point to a parent and a child part, have a radius and a facing direction.
Drag and drop system
When a piece of space junk that is orbiting the moon is pressed, it is removed from the orbit and starts following the cursor until it is released.
During the dragging period all available nodes on the rocket and the nodes of the junk piece are displayed as a mesh.
If the player lets go without attaching the part or their turn is over the part dissolves.
During the dragging period it starts recursively checking if any of its nodes are overlapping with the nodes in the rocket of the current player. When any of the nodes are overlapping it may be attached according to a set of attachment rules:
- The node on the rocket is not used
- The nodes that are overlapping facing each other. (An up facing node can be attached to a down facing node, left facing to right facing etc). This makes sure the rocket is built in an aligned manner
- Payloads cannot be attached to engines, there needs to be a fuel tank in between
The rocket root calculates if it meets the requirements based on the parts it has by recursively checking the stats of the parts currently in the hierachy.
When all the requirements are met it is determined as "ready for liftoff".
We tried using a more complex system that calculates a thrust to weight ratio with a minimum requirement of payloads in order to punish players for building to heavy rockets, but we found out that it was too punishing for a simple party game.
Flicking Space Junk
There was always a plan for a mechanic that allows people to sabbotage the opponent. The original idea was to weigh down their rocket by dragging useless parts onto it, but when we switched to the part count system for the rocket stats, we repurposed those weight parts in a more explosive fashion.
When a spacejunk part is grabbed, a direction is determined over a short "flicking distance", after which it goes into a new flying state using 2D gravity calculations. The beauty of it is that if you miss your opponent, there is a good chance of the junk coming back towards you and hitting yourself.
When striking the rocket, the part it touches will be destroyed and every part that is attached to the deleted part.