Devblog part #7 – Building and designing the levels.

As I mentioned before in devblog part 4, I am building the game and designing the levels around a 32×32 tilemap,
this makes it much easier to build the levels and place the platforms, on some levels I went down to a 16×16 grid and there are some occasions where I place the objects outside the grid, usually when they are not rendered in power of 2, like the door for example or the key if I want to place it on the floor.

screen1

screen2

screen3

In this level you can see an example for the pushing fan, the yellow box represents the affected area, I have 2 variables on each of these boxes, pushX and pushY so I can push the player in all possible directions, this obviously happens only when the player overlaps the box area.

screen4

 

Devblog part #6 – Swimming – New game mechanic added.

Here is another new addition to the game mechanics, swimming, swim up with the jump button and swim down with the down arrow and of course move left/right also works.

The swimming emulation was done by manipulating the player’s gravity factor when overlapping the water tile.
The water is just a solid blue color tile with 40% opacity and a cool webgl water effect on it.

Devblog part #5 – Bash Drop – New game mechanic and platform type added.

Here is a new addition to the game mechanics, Bash Drop, while jumping/falling holding down the DOWN arrow and pressing the JUMP button will drop you down faster to the ground, this can be used to avoid mid air obstacles and to break through a new type of breakable platform, there should be a breaking animation, but that comes later.

Devblog part #4 – Working with tiles and memory management.

I think the biggest lesson I learned about making a game, is memory management, especially if you are designing for mobile, keep your asset small, in powers of 2, use tiles!, work with low number of animation frames.

Most mobile devices uses a very weak graphical processor, which has many limitation, so first of all try not going over 1024×1024 on mobile, always take power of 2 in consideration, for example a 129×129 image will use the memory of a 256×256 image, I found that rendering a lower image than scaling it up a little back doesn’t look that bad on most cases, so if I need a sprite to be 160px big, I will probably render the image in 128×128 and scale it up.

Background objects for example can be rendered in a very low resolution and then stretched back, it will make them really blurry which will give you the extra effect of distance and will save you tons of memory.

Back to Bad Pad, this time around I had a little more experience with level design and working with tiles, so first of I decided to work around a 32×32 tileset, that means most of my graphics will be designed and rendered at this resolution, that goes for backgrounds, platforms, obstacles and characters, of course there will be exceptions here and there.

Working with tiles also makes it easier to build levels, especially if your working with platforms, you know the exact distance the player can jump or move on the X axis while jumping, so you can design your levels around those parameters even on a math paper and save a lot of time testing every thing.

For the platforms and the background wall I used tiled images and 9 patched images.

Tiling an images, is a very efficient a way of building a level and saving memory, instead of loading a bunch of separated sprites and instances you just load one and spread it out in a given area.

tileEx2

tileEx1

tileEx3

tileEx4

9 patch is very similar to tile, but with the option of frame border, so if I’ll take a 32×32 image and set it to a 9 patch tile with 4px border (left, right, top and bottom), i will get 28×28 spread tile on the inside and a 4×4 tile as a border, both can be set to tile or stretch, I usually use tile for the inside and stretch for the border.

9patchEx1

9patchEx2

Stay tuned for first playable alpha version releasing early next week!

Devblog part #3 – Interaction with the scene – Obstacles… and some more platforms.

Here are some of the obstacles and a few more types of platforms I have set up for now:

1. Spikes – fixed place.

2. Rotating spikes – comes in many sizes, can be fixed in place or moving in a sine, on this one I added a nice little little feature, I have 8 image points defined, one for each spike and on collision i pick the closest one to the player and pin him to it, pretty straightforward but cool nonetheless.

3. Metal weights – hanging from a chain and rotating, on collision I throw the player to the other direction to simulate impact.

4. Flying Bee-Bats, can fly in any direction, but usually in preset sine movement.

5. Following enemies – they will follow you if you get close enough.

6. Teleporters.

7. Fans – player can use the UP/DOWN buttons for extra control while diving.

8. Gates and Levers.

9. Electric lines – functions like a jump/fall through platform with an electric current running up and down it.

10. Conveyor belt – standing on this platform will push the player left or right in a predefined speed.