Post by 06hypersonic60 on Apr 5, 2012 14:06:22 GMT -5
Yo guyz. Well you know that we don't have a big number of coders in the blitz sonic community. So, I decided to make some tutorials to encourage starting coding OR help you on some things.
All my tutorials will be here. And today I'll start with something simple:
How to make add a fall animation ( ACTION_FALL ) to your game
1- First thing to do is to set up the animation. You should go first to the "Game_Resources_Models.bb" file to add the animation frames.
What we need is
Just duplicate the last line and change the numbers so they match the frames numbers on the model
to get something like this ( just an example )
no save and go to the "player_Animation.bb" then find these
then add
P.S: the number of the animation depends on what you have added before. So if you did add another animation before the fall one the number will be 5.
Now find this
And add a case 4 like the others. And as U can see, there's a number that alwayq change:
Case 0 >>1
Case 1 >> and so on. Each time u add a case u add 1 to that number.
And the number that cames before it, ( 0.2 / 0.4 ) can be used to change the animation's speed.
Now the animation is added. You only need to code the action to make it play in game
REST OF THE CODE IN THE NEXT POST
Please if I'm making a tutorial and cought it into parts ( each one on a post ) please do not comment 'til it's finished.. Thanks =D
All my tutorials will be here. And today I'll start with something simple:
How to make add a fall animation ( ACTION_FALL ) to your game
1- First thing to do is to set up the animation. You should go first to the "Game_Resources_Models.bb" file to add the animation frames.
What we need is
RecursiveExtractAnimSeq(Mesh_Sonic, 0, 223) ; Idle RecursiveExtractAnimSeq(Mesh_Sonic, 225, 248) ; Walking
RecursiveExtractAnimSeq(Mesh_Sonic, 250, 258) ; Running
RecursiveExtractAnimSeq(Mesh_Sonic, 259, 266) ; Spinning
Just duplicate the last line and change the numbers so they match the frames numbers on the model
to get something like this ( just an example )
RecursiveExtractAnimSeq(Mesh_Sonic, 0, 223) ; Idle RecursiveExtractAnimSeq(Mesh_Sonic, 225, 248) ; Walking
RecursiveExtractAnimSeq(Mesh_Sonic, 250, 258) ; Running
RecursiveExtractAnimSeq(Mesh_Sonic, 259, 266) ; Spinning
RecursiveExtractAnimSeq(Mesh_Sonic, 266, 285) ; Falling
no save and go to the "player_Animation.bb" then find these
Case ACTION_JUMP
p\Animation\Animation = 3
Case ACTION_CROUCH
p\Animation\Animation = 1
Case ACTION_SPINDASH
p\Animation\Animation = 3
then add
Case ACTION_FALL
p\Animation\Animation = 4
P.S: the number of the animation depends on what you have added before. So if you did add another animation before the fall one the number will be 5.
Now find this
If (p\Animation\Animation<>p\Animation\PreviousAnimation) Then
Select p\Animation\Animation
Case 0
RecursiveAnimate(p\Objects\Mesh, 1, 0.2, 1, 8)
Case 1
RecursiveAnimate(p\Objects\Mesh, 1, 0.4, 2, 8)
p\Animation\Time# = 0.0
Case 2
RecursiveAnimate(p\Objects\Mesh, 1, 0.4, 3, 9)
p\Animation\Time# = 0.0
Case 3
RecursiveAnimate(p\Objects\Mesh, 1, 0.4, 4, 8)
And add a case 4 like the others. And as U can see, there's a number that alwayq change:
Case 0 >>1
Case 1 >> and so on. Each time u add a case u add 1 to that number.
And the number that cames before it, ( 0.2 / 0.4 ) can be used to change the animation's speed.
Now the animation is added. You only need to code the action to make it play in game
REST OF THE CODE IN THE NEXT POST
Please if I'm making a tutorial and cought it into parts ( each one on a post ) please do not comment 'til it's finished.. Thanks =D