K
K
karsak2015-11-25 15:50:12
Mathematics
karsak, 2015-11-25 15:50:12

How to implement an algorithm for a mobile game?

It is necessary to develop a game similar to this https://play.google.com/store/apps/details?id=com....
In this game, the user answers questions about why the plot changes. There are a lot of options for the development of an event, do you really have to implement all this with if else conditional statements. Are there any algorithms or examples of solving such a problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin Kitmanov, 2015-11-25
@k12th

There is no link. But the description is similar to IF , there are a lot of engines (a short list at the link).
PS In a general sense, this is a finite state machine called: a graph with transition conditions between vertices.

S
Saboteur, 2015-11-25
@saboteur_kiev

One if and one else, and a loop.
All questions are in the database. The column has the text of the question, and two indexes to other questions that will jump to if yes or no.
It is possible in an array.
You can complicate it, make a variant with three answers and exit the cycle of victory / defeat.
nothing complicated.

D
Duha666, 2015-11-25
@Duha666

You can think of each question as a vertex of a graph. The answer is a transition to a certain state.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question