A
A
Aleks Ivanov @Aleks2015-08-02 23:05:46
Java
Aleks Ivanov @Aleks, 2015-08-02 23:05:46

How to write turn switching logic for players in Java?

There is a small game
. The choice of participants from 2 to 5.
The player's move consists only in scoring points and displaying information about who exactly walks. moves should switch in turn depending on the selected number of players. Initially
there are two buttons. "Yes and no". For "Yes" 1 point is awarded to the walking player, for "No" - not awarded
There is a TextView in which the name of the player who is walking should be displayed
The number of players from the start activity is transferred to the game activity by the PutExtra method as 'int'
You can simply link to manuals and relevant articles on developer.android.com
, I just don’t know what exactly and how to look for
. I read one book on java for dummies, I didn’t find any advice from it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
abs0lut, 2015-08-03
@abs0lut

Store a list/array of players and iterate over it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question