[NOTE] If video is not loading properly, it may be found in Arcanoid/media/
Simple implementation of very popular game Arcanoid. Two game modes multiplayer
and singleplayer
allow to play with friends and break your records. Video of both modes are avaible in multiplayer singleplayer
Each user register his nickname in database. Registration is automatical, it does mean that first login stores nickname in database ( if nickname is available).
When user want to play with friends he need to join or create a room. Each room contains Game configuration (rows, columns, mode(EASY,HARD,MEDIUM)). Room may be created by every user and configured as only he wish. Lobby is a list of rooms that are open at the moment. By clicking list item player joins as a guest and contest begin. The one who first destroys all the bricks wins.
multiplayer.mp4
Communication is owed to the firebase. Players listening opponents score and communicating in real time in such way.
When user playing singleplayer mode he just beat next stages and local room
database stores his achievements ( records ).
singleplayer.mp4
private fun addScoreListener() {
messageReference.addValueEventListener(object : ValueEventListener {
override fun onDataChange(snapshot: DataSnapshot) {
if (snapshot.getValue(String::class.java) != null) {
game_view.pauseThread()
basicAlert(snapshot.getValue(String::class.java))
closeRoom()
}
}
override fun onCancelled(error: DatabaseError) {
messageReference.setValue(message)
}
})
}