Originally published at: http://www.sitepoint.com/create-tetromino-puzzle-game-using-swift-gameplay/
Create a Tetromino Puzzle Game Using Swift
- Create a Tetromino Puzzle Game Using Swift – Getting Started
- Create a Tetromino Puzzle Game Using Swift – Drawing Objects
- Create a Tetromino Puzzle Game Using Swift – Gameplay
With only the simplest of mechanics, our game will be able to offer engaging gameplay with high replay value. Looking at the game animation in the Introduction once again, we can easily identify most of these rules. The most obvious of which include the rules on falling, movement and collisions. We also have rules on clearing lines, scoring and levelling up. Let’s implement all of them now starting with the falling rule.
Dropping Tetrominoes
Our game’s world utilizes its own unique gravity. It is significantly different from the typical gravity simulation in other games which produces a smooth, accelerating falling effect. In our game, tetrominoes fall one row at a time with constant speed which increases only when the level increases. This means we can’t rely on SpriteKit’s default physics engine to simulate gravity for us so we have to manually control and time every tetromino drop.