Bad Guys: Week 2 of #8WeekGameDev. FlipTiles:Runner

posted in AntHillPlan
Published February 21, 2019
Advertisement

Latest iOS beta version link on TestFlight https://testflight.apple.com/join/IJDl9FXC

This is the second of a weekly series on about a casual mobile game I will try to develop from start to release in #8WeekGameDev. This weeks PC browser demo is up on Kongregate here and a youtube version of the blog here. This week I added obstacles and three separate play modes to the game.

FlipTilesV0.2.thumb.png.a78a37ada7ebc05c5ed722f63191ef74.png

Bad guys: There are three types of obstacles added.
1) Enemies that move along the track and when they hit you, you both bounce off each other. The basic code was straight forward. Some checking for what direction a pawn (player or enemy) is hit from. If hit from behind it does not affect the pawns movement. Also, there some working sizing colliders and checking to make sure pawns passing each other on two arcs on the same track do not collider. I did not make the enemies kill players as that would be a sudden death, which not the play feel I am going for. I am going more for a Tetris feel, where if you make a mistake you can recover if you don't panic and it is early enough in the game.
2) Walls are enemies that don't move. Very simple subclasses and setting speed to zero.
3) Empty tiles are tile without paths on them. no special code was needed for this, which was nice.

For the obstacle generation I use random selection based on the idea of putting chits in a bag and choosing one. I put the chits back in the bag after each draw. For example, in slow mode, the bag starts with 6 chits for "none", and nothing else. So when I draw a chit for the first row I always get "none" and there are no obstacles. Then each time a new row is added I add chits to the bag.
 0.1 wall chits
 0.2 enemy chits
 0.01 empty chits
So for the second row of added tiles, none is still the most common chit but there a chance of an obstacle being placed on a tile. By the time the  10th is row added about 1 wall will appear in each row. By row 20 half the tiles will have enemies. The bag would contain
4 - none chits
2 - wall chits
4 - enemy chits
0.2 empty chits
This basic list of outcomes with the chance for each (FreqPair) is code from an old project so did not take much work.
I made the class serializable so I can change it in the inspector.

[System.Serializable]
public class FreqPair{
        public string name; // e.g. wall
        public float freq; // e.g. 2
}

I also made some extra code the limits the number of empty tile in one row, or else you could have all empty tiles and there would be no way past that row.

Judging difficulty and playability is a difficult problem. So decided to put off the decision. I made three modes of play.
1) Fast - Fast movement but obstacle frequency increases slowly.
2) Slow - Slow movement but the frequency of obstacles increases quickly.
3) Strategy - each time a button is pressed the game advances one turn. During the turn the tile flips and the player and enemies move for a set amount of time then stop. All buttons are disabled when the turn is running. Also, cooldown counters for buttons were changed to advance one unit each turn. I added the 8th symmetric transformation (identity) which does nothing but does cause a turn to run. My inner mathematician was happy to see all 8 members of the group of symmetric transforms on a square represented.

For each mode of play there is a  GameSettings object and obstacle generator object. This lets me set the player's, start speed, acceleration, max speed. The cooldown time of buttons. Also to set frequencies of obstacle separately for each mode in the inspector.

I add the mode being played in each game to the analytics. Also, I added separate high scores for each mode to the Kongregate version. This should give me an idea of the popularity and difficulty of each mode. I enjoy the slow mode the most, it is busy enough that I have to stay focused and plan ahead, but not so fast that I panic. Fast is too fast for me but in general, I suck at this type of game, so I wanted to set the difficulty level too hard for me.  I think I may have screwed up the strategy turn length and made it too difficult.

I added a green outline on the tile you are on so you know which tile is going to flip even when you are near an edge. I found out it was frustrating trying to judge which tile you are on. The green outline made the game much more enjoyable for me to play.

I added a new avatar and made enemies. Now you can see why I buy artwork instead of making it. This avatar and enemies are just enough to let me see that they are turning to follow the tracks on the tiles. So I know if my code is working.

Please try out the game on Kongregate here, feedback is always welcome.
 

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement