Notifications
Article
Elemental Breakout
Updated 4 months ago
117
0
Intro
Go on an adventure with an aspiring Elementalist! Break bricks to collect essence in a hexagonal brick break game. Level up your paddles with skills in order to win stages quickly and defeat the bosses. Will you keep the essence for yourself or help the Elementalist pass her university courses?
This game was built with Unity’s new 2D Tilemaps features. Using the grid and a scriptable prefab brush we were able to create interesting levels quickly while allowing for easy editing. Many of the in-game effects rely on the coordinate system of the grid to find tiles at specific locations.

Team

Benjamin Gordon - Team lead, programmer, artist John Lonai - Programmer Matt Sichenze - Game design, level design AnnaMarie Forza - Artist

Concept

Our team was aiming to make a breakout game with skills from an RPG system. We chose Unity for the new 2D features. In testing, the Tilemaps were definitely the way to go. We then found a video for making a prefab brush here - https://www.youtube.com/watch?v=UqhK6GpCgrM This allowed us a large amount of flexibility that we were confident could allow us to make our vision.

Level Editor

The biggest benefit of using the new 2D tools was definitely in level design. We were able to draw levels out really easily.

Spotlight - Boss levels

These are some of the more interesting designs. They are drawn out like normal but are animated using a script. This is a fun departure from the static levels of many breakout games. The elemental hexes also shoot stunning blasts. This can all be activated by ticking the "Is boss level" and selecting the movement.

Hexes

In our concept we focused on six unique biomes with their own feel. To do this we use a mixture of basic blocks and elemental blocks. The elemental blocks release essence which is the currency to purchase skills. The elemental blocks also do special effects such as fire which explodes nearby blocks and shadow which envelops the level in darkness.

Spotlight - Elemental blocks

To make the fire explosion we use the following code. Since this is a hex based grid we have to account for offsets in the columns.
Grid grid = gridInstance.GetComponent<Grid>(); void fireDeath() { // get this tile's location in tilemap Vector3Int cellPos = grid.LocalToCell(transform.localPosition); // check for colliders surrounding this tile List<Vector3> cellsToExplode = getHexRingInWorldPos(cellPos, 1); // Iterate through positions and damage hex if it exists foreach (Vector3 cell in cellsToExplode) { ExplodeCell(cell); } } private List<Vector3> getHexRingInWorldPos() { // Positions in world space List<Vector3> returnableList = new List<Vector3>(); // Positions in grid space List<Vector3Int> hexes = new List<Vector3Int>(); // Get list of surrounding positions based on odd or even row if(cellPos.y % 2 == 0) { hexes.Add(cellPos + new Vector3Int(-1, 1, 0)); hexes.Add(cellPos + new Vector3Int(0, 1, 0)); hexes.Add(cellPos + new Vector3Int(-1, 0, 0)); hexes.Add(cellPos + new Vector3Int(1, 0, 0)); hexes.Add(cellPos + new Vector3Int(-1, -1, 0)); hexes.Add(cellPos + new Vector3Int(0, -1, 0)); } else { hexes.Add(cellPos + new Vector3Int(0, 1, 0)); // top left hexes.Add(cellPos + new Vector3Int(1, 1, 0)); // top right hexes.Add(cellPos + new Vector3Int(-1, 0, 0)); // left hexes.Add(cellPos + new Vector3Int(1, 0, 0)); // right hexes.Add(cellPos + new Vector3Int(0, -1, 0)); // bot left hexes.Add(cellPos + new Vector3Int(1, -1, 0)); // bot right } // Get the world space coordinates of each hex foreach (Vector3Int cell in hexes) { returnableList.Add(grid.CellToWorld(cell)); } return returnableList; } void ExplodeCell(Vector3 worldPos) { Hex hex = getHexAt(worldPos); if(hex != null) { hex.removeHealth(1); } } Hex getHexAt(Vector3 worldPos) { // Raycast into screen at the world position RaycastHit2D hits = Physics2D.Raycast(worldPos, Vector2.zero); // If a raycast hit something and it is a Hex return the Hex if(hits.collider != null && hits.collider.tag == "Hex") { return hits.collider.gameObject.GetComponent<Hex>(); } return null; }
TLDR - get cell position of this hex, get world positions of all surrounding hexes, Physics2D.Raycast all those positions, remove health from the hex if it exists

Skills

When you have collected enough essence you can purchase skills. There are 54 skills you can purchase to help you complete levels quicker or easier.
Some of the skills are familiar to breakout players such as Fire Blast. Fire Blast will shoot a projectile that damages any hex it hits. We also created skills that are unique to our gameplay system. When earth hexes are destroyed they fall and stun the paddle if they hit it. Below is a gif that shows a skill called Earth Bounce which allows the earth hex to bounce off the paddle.
This skill switches the next hex the ball hits into a fire element which can then be hit to explode nearby blocks.
We are working hard to finish this game and will be releasing within the next week!

Benjamin Gordon
Nomadjackalope Games - Programmer
1
Contributors
AnnaMarie Forza
Artist - Artist
Comments