- Notifications
You must be signed in to change notification settings - Fork176
Augmented Reality Tetris made with ARKit and SceneKit
License
NotificationsYou must be signed in to change notification settings
exyte/ARTetris
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
App crashes when running on iPhone 6, iPhone 5s, iPad Air, etc.
ARKit only works on devices with A9 chip or greater. So you need at least iPhone 6S or iPad with such a chip.
App runs, but nothing happens.
To play the game you need to find some horizontal surface: floor, table top, etc. Point you camera to a plane and move your device a little bit in different directions to force ARKit to find bounds of the plane. Once it will be found, you will see Tetris well on this plane.
- ViewController
- Initialize andconfigure ARKit
- Detect horizontal plane andinitialize Tetris game engine on this plane
- Addgesture recognizers andprocess gestures
- Tetromino: describe all tetrominos and their rotations
- TetrisConfig: width and height of the well
- TetrisState: tetris game state - current tetromino and its position in the well
- TetrisWell: well model describing filled cells
- TetrisEngine: tetris game engine
- Start game loop
- Handle gestures and change game state
- Handle animation: stop game loop, execute animation, start game loop
- TetrisScene