如何给科特林的每个玩家指定时间

时间:2018-11-22 13:42:02

标签: android kotlin

fun action(optionNumber: Int, btnselected: Button) {
    if (playingplayer == PLAYINGPLAYER.FIRST_PLAYER) {
        btnselected.setBackgroundResource(R.drawable.button_game_green)
        buttonClicked.add(optionNumber)
        playerOneLastClicked = true
        btnselected.isEnabled = false
        playingplayer = PLAYINGPLAYER.SECOND_PLAYER
    } else if (playingplayer == PLAYINGPLAYER.SECOND_PLAYER) {
        btnselected.setBackgroundResource(R.drawable.button_game_red)
        buttonClicked.add(optionNumber)
        playerOneLastClicked = false
        btnselected.isEnabled = false
        playingplayer = PLAYINGPLAYER.FIRST_PLAYER
    }
    imagebtnState()
}

我有一个包含2个玩家的游戏,我希望每个玩家在30秒钟内没有单击时,单击按钮转到另一个玩家

0 个答案:

没有答案