Lavos Posted April 19, 2011 Author Share Posted April 19, 2011 Alright for the past 5 days I've been trying to figure this out and ended up with my face on the desk.I've tried countless methods and still couldn't get it right so I need help.What I'm trying to do is to get a number value to count so that the anim can move to the next number, I'm not sure if its clever but, Here is what it looks like now.```' Check for attacking animation If Player(Index).AttackTimer + (attackspeed / 2) > GetTickCount Then If Player(Index).Attacking = 1 Then For n = 4 To 7 Anim = n DoEvents Next n```Basically when cntl key is press the anim displays only 7. Link to comment Share on other sites More sharing options...
Lavos Posted April 20, 2011 Author Share Posted April 20, 2011 bump Link to comment Share on other sites More sharing options...
BoDu Posted April 28, 2011 Share Posted April 28, 2011 You could try this, its made for 2 frames but it playes them to fast so it don't look that great. If Player(Index).Attacking = 1 Then n = Rand(4, 5) Anim = n - 1 End If It playes me frame 3 and 4 but a way to fast :P Btw frames counting from 0 to 4 that mean 5 frames per line, 4 walking 1 attacking. And it will play the last walking frame + attack frame. And you also have to change this so it will read corectly your sprite:> .Left = Anim * (DDSD_Character(Sprite).lWidth / 5)> .Right = .Left + (DDSD_Character(Sprite).lWidth / 5)> End With> > ' Calculate the X> x = GetPlayerX(Index) * PIC_X + Player(Index).XOffset - ((DDSD_Character(Sprite).lWidth / 5 - 32) / 2) Anyway there should be a better way to this, well absolutely there its a better way becouse this one sucks :P Hope Robin give us a hint :P Link to comment Share on other sites More sharing options...
Yxxe Posted April 28, 2011 Share Posted April 28, 2011 @Lavos:> Basically when cntl key is press the anim displays only 7.That's because it's looping so fast you only see animation 7\. Look at the attacking animation procedures and how GetTickCount is used to interchange between animations if you hold Ctrl down. Link to comment Share on other sites More sharing options...
BoDu Posted April 29, 2011 Share Posted April 29, 2011 @Lightning:> That's because it's looping so fast you only see animation 7\. Look at the attacking animation procedures and how GetTickCount is used to interchange between animations if you hold Ctrl down.Your comment was truly helpfull.Here its the code with witch i got it working with 3 frames attack animation.Just add your frames 5 and 6 and make another elseif for frame 7 and it will work.``` If Player(Index).AttackTimer + (attackspeed / 4) > GetTickCount Then If Player(Index).Attacking = 1 Then Anim = 4 End If ElseIf Player(Index).AttackTimer + (attackspeed / 3) + 100 > GetTickCount And Player(Index).Attacking = 1 Then Anim = 3 ElseIf Player(Index).AttackTimer + (attackspeed / 2) + 200 > GetTickCount And Player(Index).Attacking = 1 Then Anim = 1 Else``` Link to comment Share on other sites More sharing options...
Lavos Posted April 29, 2011 Author Share Posted April 29, 2011 Awsome! Thank you so much for the help! i managed to get it to work now with a 4 attack frames. =) I'm going to run more tests on it and see what else i could do with it. Link to comment Share on other sites More sharing options...
BoDu Posted April 29, 2011 Share Posted April 29, 2011 @Lavos:> Awsome! Thank you so much for the help! i managed to get it to work now with a 4 attack frames. =) I'm going to run more tests on it and see what else i could do with it.Np i'm glad i could help you and i could helped me too. Play with it becouse you can set the frames time slower of faster, or one of them faster the others. Kinda awsome :P Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now