Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing the movement sequencing.
#1
Ok So ive created my own system for the movement, Way more sprites. Now I have to add them. I understand how the move system works, Sort Of.
------------------------------------------------------------------------------------------------
I learned from using advocates system and replacing a part in Sub BltPlayer with;
[spoiler]
Quote:
' Check for animation
Anim = 0
If Player(Index).Attacking = 0 Then
Select Case GetPlayerDir(Index)
Case DIR_UP
Anim = 0
If (Player(Index).YOffset < PIC_Y / 3) Then
Anim = 1
ElseIf (Player(Index).YOffset > PIC_Y / 3) And ((Player(Index).YOffset > PIC_Y / 3 * 2)) Then
Anim = 2
End If
Case DIR_DOWN
Anim = 1
If (Player(Index).YOffset < PIC_X / 6 * -1) Then Anim = 0
If (Player(Index).YOffset < PIC_X / 4 * -1) Then Anim = 2
Case DIR_LEFT
Anim = 0
If (Player(Index).XOffset < PIC_Y / 3) Then
Anim = 1
ElseIf (Player(Index).XOffset > PIC_Y / 3) And ((Player(Index).XOffset > PIC_Y / 3 * 2)) Then
Anim = 2
End If
Case DIR_RIGHT
Anim = 0
If (Player(Index).XOffset < PIC_Y / 4 * -1) Then Anim = 1
If (Player(Index).XOffset < PIC_Y / 2 * -1) Then Anim = 2
End Select
Else
If Player(Index).AttackTimer + 500 > GetTickCount Then
Anim = 2
End If
End If
[/spoiler]
------------------------------------------------------------------------------------------------
Now the thing I need to know is, How do I change how many sprites there are for each direction?
Like when you 1st use MS there are 3 Backward, 3 Forward, 3 Left and 3 Right.

Well I need to change it so;
There are 7 Backward, 7 Forward, 9 Left and 9 Right.

Any Ideas on what to do?
Reply
#2
Dave Wrote:Basically, Anim is set to a number representing the frame. From left to right for each sprite, they are 0, 1, 2, 3...

So basically, you need to do a check and set Anim to the correct number when the time is appropriate

Yeah. Thats what I was looking at. But is there a defualt Anim? Or could I just throw the new one in and it start on the correct "0" for each direction?
Reply
#3
Code:
rec.Left = (GetPlayerDir(Index) * 3 + Anim) * PIC_X

Change that 3 to the amount of frames you want per direction.

It's near the bottom of BltPlayer.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)