A simple extension for developing Tetris Game.
Designer Properties
BackgroundMusic | text |
Sets source of background music of game [Will be only played if Enable music is true]. |
---|---|---|
CurrentScore | number |
Sets a current score of Tetris Game. |
DbName | text |
Specifies custom name for shared preferences of Game's database [Can be also accessible using TinyDB component]. |
EnableMusic | boolean |
Sets if music must be played, [Default : true] |
GameOverMessage | text |
Specifies text for Game Over dialog's message [Note : Only Displayed if UseDefaultAlerts() is true. |
GameOverTitle | text |
Specifies text for Game Over dialog [Note : Only Displayed if UseDefaultAlerts() is true. |
TopScore | number |
Sets top score of game's database. |
TopScoreTagName | text |
Specifies custom name for shared preferences tag of Game's top score. |
TryAgainText | text |
Specifies text for Game Over dialog try again button [Note : Only Displayed if UseDefaultAlerts() is true. |
UseDefaultAlerts | boolean |
If enabled, default game dialogs will be displayed [Default Value : true]. |
ViewLayout | component |
Specifies a layout for Tetris Rendering View. |
Blocks
AddCellImage
Adds cell with the specified image and index
CreateRenderer
Creates an instance of Tetris View renderer.
DecreaseMusicVolume
Decreases game's background music by 10%.
DestroyInstance
Destroys and removes Tetris View from Layout [Note : Recall CreateRenderer() after using this or Error will be raised].
GetCurrentScore
Returns current score of game.
GetTopScore
Returns Top Score of Tetris Game.
IncreaseMusicVolume
Increases game's background music by 10%.
IsGameOver
Tells if the game is over.
IsRendererInitialized
Tells if Tetris Renderer is initialized.
MoveBlockToBottom
Moves the upcoming block to bottom, gets stacked on other blocks if any.
MoveBlockToLeft
Moves the upcoming block to left.
MoveBlockToRight
Moves the upcoming block to right.
MuteMusic
Mutes/Disables sound of games background music.
PauseGame
Pauses the instance of Tetris Game.
PauseMusic
Pauses background music of game.
Redraw
Redraws Tetris view.
ResetTopScores
Resets top score from game's database.
ResumeGame
Resumes the game [Note : Use only after calling PauseGame()].
ResumeMusic
Resumes background music of game [Note : Only use after calling PauseMusic()].
RotateBlock
Rotates the upcoming block clock wise.
StartGame
Starts the game.
StopMusic
Stops background music of game.
Properties
Event Blocks
Output
I didn't make a complex app for demo.
Credits: @anke for Activity lifecycle extension.
Demo Blocks
Designer
Blocks
Aia
TetrisDemoAi2.aia (538.7 KB)
Assets Pack
https://drive.google.com/file/d/1jFYdWGRPvYQv3XBHQp5PxZG1v9-c3fMi/view?usp=sharing
Aix
Tetris (23).aix (29.6 KB)