W
W
WOSNE2021-03-13 16:43:59
C++ / C#
WOSNE, 2021-03-13 16:43:59

How to remember actions, with their launch by a button?

Hello.
You need to specify the path with arrows, for example in this situation: up, right, up. But so that the actions (movements) are not performed immediately, but remembered and performed, all in turn, only after pressing the button.

It is necessary that the arrows remember their sequence and begin to play on the start button.
If you chose the wrong route, then there will be no return :) The movement itself is fixed.

Please tell me how this can be implemented) By what methods, or in a super primitive form, write an example of this script) I will be extremely grateful

604cc03d8ba43365162152.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2021-03-14
@WOSNE

Keep it, just your case
https://refactoring.guru/en/design-patterns/command

F
freeExec, 2021-03-13
@freeExec

1) Add to the list of commands;
2) After the start, start processing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question