Creating Combat Sequences(5) 摘要: One of the coolest functions is
get_char_at, which scans through the list of characters
and determines which one is positioned at the specified display coordinates.
Although doing this might be as easy as performing a bounding check on the
character’s
display coordinates, go the extra mile and make the selection work on a
polygon face level:
Creating Combat Sequences(4) 摘要: The cApp::frame function is a
little crowded in its current incarnation. Here, Frame has
the job of collecting and processing player input. The only input used is
that of the
mouse; the left mouse button selects a target character, a spell to cast, or
an attack to
perform. The right mouse button closes the spell selection window if it is
currently
open. Once a target and an action are picked, the appropriate action is
performed.
Creating Combat Sequences(3) 摘要: The application class uses three
global variables to contain the data about the character
and spell meshes, and the character animation information:
Creating Combat Sequences(2) 摘要: The arena is represented by a
single mesh, as are the characters and the spells. In
fact, the character and spell controllers are perfect for the
combat sequences here. You need to tweak only a few things to make those
controllers
work for you.
Creating Combat Sequences(1) 摘要: With swords swinging and magic
blasting, you manage to wade through wave
after wave of demonic creatures. With every victory, you feel yourself
growing
stronger; new spells are learned, and stronger weapons are usable. The enemy
is beginning to lose ground, and here you are standing tall on the mountain
you
created.