Creating the application model

Until now, we have been concerned with modeling specific components that make up tetromino blocks. Now it is time to concern ourselves with defining application logic. We will create an application model to implement the necessary Tetris gameplay logic, as well as to serve as an intermediary interface between views and the block components we have created.

A view will send a request for the performance to the application model, and the model will execute the action if it is valid and send feedback to the view. Similar to the models we have created so far, we need a separate class file for the application model. ...

Get Kotlin Programming By Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.