Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Luminous's Spectral Light
#7
They have code in place to rotate sprites. I believe it was first used when they added the backflips for Pirates. It's just vector math and not that hard to do. They only need 1 set of animations for the skill. The same applies for most skills; for example they just flip sprites to get ones that face left and ones that face right, although flipping is much easier than rotating.

For the hitbox, it wouldn't be that hard to draw a rectangle at an angle and calculate whether it collides with another rectangle. Again, vector math. Another way they could have done it is to draw a ray from the character.

The animation is simple. Think of the .wz files as a bunch of folders that organize all the different data in the game. The animation for the skill is stored under a character animations folder, under the appropriate class, as an object which contains a series of images and data about how to display them. This data is incomplete; it knows the images it contains and the hitboxes for those images and it knows that if you use a skill at (X, Y), the animation should play at (X+200, Y), and it knows how long each frame lasts based on a speed S, but it doesn't know what those variables are. When the game wants to play an animation, it calls the parent object and provides it with the parameters on how it wants those images to be displayed. For example, it'll say, "I want frame 1 for skill number 00001234 to play at (400, 300) (where your character is) at angle 0 with speed 2." If it's not already in memory, it'll look up the appropriate object from the .wz file. Then the drawing engine will draw the appropriate sprites where they need to be at the right time, based on the general data provided by that object and the specific data provided by the game. If you're just holding down the skill and nothing's changing, the game will continue to ask for the animation to be played. If you change something, the game will say, "Okay, now draw frame 2 for skill number 00001234 at (400,300) at angle 15 with speed 2." So the game engine can feed information to the drawing engine on the fly and change whatever it wants at any time. The game animations aren't static things that have to play in their entirety every time.
Reply


Messages In This Thread
Luminous's Spectral Light - by Haseo - 2012-09-22, 01:59 AM
Luminous's Spectral Light - by 66alex66 - 2012-09-22, 04:24 AM
Luminous's Spectral Light - by hadriel - 2012-09-22, 10:33 AM
Luminous's Spectral Light - by Haseo - 2012-09-22, 12:13 PM
Luminous's Spectral Light - by Lozmaster - 2012-09-22, 06:03 PM
Luminous's Spectral Light - by hadriel - 2012-09-22, 10:21 PM
Luminous's Spectral Light - by Dusk - 2012-09-26, 04:49 PM
Luminous's Spectral Light - by JoeTang - 2012-09-26, 04:56 PM
Luminous's Spectral Light - by Stereo - 2012-09-30, 02:16 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)