Pixel Pub Devlog #1

Starting off this blog will be my current project, Pixel Pub, that I’ve decided to develop and publish.  This first post will be about the project itself as well as a few things I’ve learned starting out.

Elevator Pitch

Someone once said that in order to make sure you have the core idea of your game, you should have an elevator pitch.


Pixel Pub is a 2D, pixel styled, memory matching game that allows players to continuously play the better they do.


Pow! Consider yourself pitched.

Why This Project?

I worked as a server for a long time and memorizing orders from multiple tables is a vital part of the job. In a way it is a kind of game that you play. You either do very well and get amazing tips or you do terribly and the customer will crap into your soul leaving you scarred for years. I’ll be honest, I’ve looked at the memory games on the Play Store and I wasn’t too impressed. A bunch of them follow the familiar mechanic of having a grid of cards that you have to match until all of the cards are gone. One truly inspired me called Unbox. It looks great, follows the convention of moving the field goal posts until eventual loss and is different from the other typical card matching memory games. This is exactly the right amount of spicy I’m looking for when making a memory game. . So I’ve decided to mash together my past serving experience with a matching game.

Core Game Logic

Since I’m new to game development, I want to keep the scope small. The game flow will begin with four different pub patrons asking to match them with the food on the table. As the player matches more correct items without messing up, the difficulty will increase and two more additional pub patrons will be added. Players are also awarded additional time and a score multiplier for consecutive correct matches.

What I’ve Done So Far

I’m a pretty visual person, but I’m also not an artist (not yet, at least). I bought a Humble Bundle a while back that gave me some solid sprite sheets and there is a terrific set of Pixel Food sprites that can be found here. This was enough art to start prototyping.

Tile Mapping

This is one way to get 2D graphics into your game. It allows you to turn art assets into tiles that fit together like puzzle pieces. You can then use these tiles to paint out a scene. Essentially you follow these steps to import Tile Sets in Unity.

Importing Tiles Sets

  1. Import a Tile Set (These can be found on websites like the Unity Store or opengameart.org)
  2. Select your Tile Set and determine its Sprite Mode (Single if the sprite represents a single tile or Multiple if is represents multiple tiles)
  3. Set Pixel Per Unit based on the Tile Set (When you downloaded the Tile Set it should tell you if it is 8/16/32/64 in the description)
  4. Set your Filter Mode to Point (All I know is it makes it so your pixel art doesn’t look like blurry doo doo butter)
  5. Select the Sprite Editor located in the Tile Set Inspector and Select Slice, Switch Type to Grid By Cell Size and Set Pixel Size of the Grids (Again, 8/16/32/64 depending on what your Tile Set says)
  6. Press Slice and you are done.

After importing your Tile Set, you can then add a TileMap element to your Scene (GameObject->2D Object -> TileMap). This is will act like a UI Canvas that you can paint tiles onto. You can also add multiple TileMaps to create layering. I would go into greater detail on how to use this feature, but I think Brackeys does an amazing job explaining it here.

Behold the power of the TileMap!!! With zero artistic skill, you too can create a masterpiece (With the massive help of free assets. Big shout out to all the artists who help provide these great assets)


Now that I had some art, it was time to get some things spawning.

Spawning Food

What does it even mean to spawn food in Unity? I needed something that could spawn multiple versions of itself and be interactive. I achieved this by creating a Prefab out of an Empty Game Object and slapping Sprite Render on it.

#Genius

Now to tackle spawning. I want the at least four food per table to spawn at specific locations. To do this I created another Prefab called SpawnFoodTable out of an Empty Game Object and then created a grid out of four more Empty Game Objects and attaching them SpawnFoodTable.

With a Spawn Area created, I could now add a Script to the SpawnFoodTable that I created. Below is the simple snippet of code I came up with to have food spawn.

public class Spawner : MonoBehaviour
{
    public Object objToSpawn;
    public GameObject spawnLocation;
    public int spawnNumber;
    void Start()
    {
        Spawn();
    }
    private void Spawn()
    {
        for (int i = 0; i < spawnNumber; i++)
        {
        Instantiate(objToSpawn,spawnLocation.transform.GetChild(i).position, Quaternion.identity);
        }
    }

Keep in mind that if you use code like this, you need to make sure and attach all the public items in the Inspector for the script to use. Once that is done, I got something like this!

Viola! Spawning Food.

Wrapping Up

It's not much, but it's a start. I still have a long way to go with this project, but I'm excited for the potential. Next I'll be diving into having a thought bubbles spawn that will act as bar patrons and a Game Manager that will be in charge of the basic game loop.