how to encapsulation the "action"

Started by
2 comments, last by Waterlimon 10 years, 12 months ago
there are a lot of "action"s in a game.
some are simple,e.g. the disappearance of a buttom.
and some are complicated.e.g.the disappearance of a button array.
Is there a way to abstract the "action", making it the reuse and modification easy?
e.g.The convergence of the interface elements .Combination of elements of the game action , if the package is suitable , you can make the action more delicate and rich .
Advertisement

Do you mean a library for making GUI's?

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.
Well, not just GUI, can also be some game elements.
Of course, if GUI can also.For all the elements interact with
the user in the game are far-fetched called UI ? ^.^
Then taking GUI as an example to illustrate the problem.
For example a calculator (this is just an example), there are a lot of button.
If the calculator can "switch" between the common and scientific type,
and can "minimize", "maximize"......and so on.
What I mean by "Action" is used to describe the process of these changes.
Of course you can through some simple variables to describe the action,
but when these movements became a lot,
Variable to describe becomes very messy.

I think you need a state machine of some sort.

For example the calculator state would be in "basic math" mode or in "fancy math" mode.

The state machine will have "states" which will deal with their functionality along with initializing/destroying themselves.

So google that.

o3o

This topic is closed to new replies.

Advertisement