Wednesday, 26 February 2014

Tiles, tiles, tiles

2. Graphics processing and collisions

Game graphic is mostly based on 32x32 pixels tiles. By default size of first two levels are 32x24 blocks (1024x768) with Pixels to Units set to 32. The last two levels are 64x48 blocks (2048x1536). To make the game "lighter" all huge static surfaces like walls and floors was exported by Tiled Map Editor to PNG files. Tiled Map Editor is a very useful free software to build whole levels out of tiles. Program has few really useful options like layers and export to PNG which I needed the most. Created PNG file are used in 2D Unity Project as sprites, instead of surfaces build out of hundreds of small objects. Each object is traced by our CPU and if game will get bigger we can easily overload processor. To prepare the tiles I mostly used Photoshop and another really good free feature called Sprite Splitter but Paint.NET or Gimp are sufficient enough.
For collisions I used Box Colliders 2D drawing them around walls and other objects that I want to collide with.
Really important is to center camera and all sprites, put them on numbered layers and set values to them in order from bottom up. That allowed me to manipulate what will be drawn on top of what in easy way.
I strongly recommend using tools like Tiled Map Editor. I saved a lot of time producing whole levels graphics using this small program.

Example of PNG graphic representing walls of of my ground level building; assembled out of 32x32 small blocks using "Tiled" program:

Another PNG graphic for floors:

When you join then together:

The only thing you have to keep in mind is layers (what is displayed on top of what) and to add "Polygon collider 2D" for walls.

Sunday, 16 February 2014

Basic ideas

1. Ideas and some technical details

For my assignment I would like to do 2D shooting game using Unity. I believe that most challenging part are the good sprites, so it is worth to spend some time and prepare really good graphics. Unity it self is a very powerful tool combining elements of Photoshop and Visual Studio. Currently I am going over number of Unity tutorials and preparing my player sprites which are going to be animated.

Game functionality:
- 2D game
- controls: keyboard + mouse (recommended)
- single player
- two types of weapons (pistol and shotgun) - can be extended
- laser scope attached to guns
- three different types of enemies (can be extended) - randomly spawned
- four levels (ascending difficulty) - can be extended
- ammo
- player interface (image of player, health, ammo for pistol, ammo for shotgun, score)
- lift (move from ground to basement level)