Mirage Source http://www.miragesource.net/forums/ |
|
Constantly Animated Sprites http://www.miragesource.net/forums/viewtopic.php?f=210&t=2254 |
Page 1 of 2 |
Author: | Robin [ Mon Jul 09, 2007 12:32 am ] |
Post subject: | Constantly Animated Sprites |
This will make it so certain player and npc sprites are constantly animated. My game has the attack frame as a standing still frame, and the frames on either side as stepping frames. Adjust according to your source Here's the function where you set what sprites are constantly animated. Edit it according to your sprite sheet. You could also save them to a file. Code: Public Function IsConstAnim(ByVal sprite As Long) As Boolean Select Case sprite Case 1 IsConstAnim = True Exit Function IsConstAnim = False End Function In my source, I set a quick if statement to sort out the actual blting, but you can do other wise. Code: If IsConstAnim(GetPlayerSprite(Index)) = False Then Is what I had before the animation is set for the normal walking, then after that is decided I added this: Code: Else With Player(Index) If GetTickCount > .animtimer + 100 Then Select Case .anim Case 0 .animtype = 1 .anim = 1 Case 1 If .animtype = 0 Then .anim = 0 ElseIf .animtype = 1 Then .anim = 2 End If Case 2 .animtype = 0 .anim = 1 End Select .animtimer = GetTickCount End If anim = .anim End With End If Add the required data to the playerrec as a long and byte respectively. For NPCS just change: Code: With Player(Index) to: Code: With MapNpc(MapNpcNum) and the IsConstAnim call to: Code: If IsConstAnim(Npc(MapNpc(MapNpcNum).Num).sprite) = False Then Enjoy. |
Author: | Braydok [ Tue Aug 14, 2007 1:33 am ] |
Post subject: | Re: Constantly Animated Sprites |
Last time I checked, I thought that you needed to dim a variable before you used it. I do believe that you did not dim animtimer and animtype. Also, you need to add a end select to the function. EDIT: I tried this tutorial out, and I had to completely revamp it to get the 1st sprite to anim, and none of the others worked, so there is obviously something wrong with this tutorial. Sorry, Robin. |
Author: | Robin [ Tue Aug 14, 2007 10:53 am ] |
Post subject: | Re: Constantly Animated Sprites |
This isn't a copy and paste tutorial, and I didn't give you everything so people couldn't just leach. It takes basic programming knowledge to make it work. |
Author: | Braydok [ Tue Aug 14, 2007 11:22 am ] |
Post subject: | Re: Constantly Animated Sprites |
I should have thought of that... Well, you might want to post that somewhere, so people don't get confuzled. |
Author: | Robin [ Tue Aug 14, 2007 11:25 am ] |
Post subject: | Re: Constantly Animated Sprites |
It's now in the third post down. |
Author: | Braydok [ Tue Aug 14, 2007 11:46 am ] |
Post subject: | Re: Constantly Animated Sprites |
Nicely done. |
Author: | Matt [ Thu Aug 16, 2007 1:39 pm ] |
Post subject: | Re: Constantly Animated Sprites |
I got it working easy. I just added constanim as byte to the npc rec and saved the value of a checkbox to it and then checked that in the bltnpc/top subs. Works perfectly! ^_^ |
Author: | William [ Thu Aug 16, 2007 2:24 pm ] |
Post subject: | Re: Constantly Animated Sprites |
MIght be cool to make the players eyes close and open. |
Author: | Rezeyu [ Thu Aug 16, 2007 6:13 pm ] |
Post subject: | Re: Constantly Animated Sprites |
Idle animations ftw. |
Author: | William [ Thu Aug 16, 2007 6:34 pm ] |
Post subject: | Re: Constantly Animated Sprites |
Rezeyu wrote: Idle animations ftw. Almost impossible if you have paperdoll. |
Author: | Rezeyu [ Thu Aug 16, 2007 6:43 pm ] |
Post subject: | Re: Constantly Animated Sprites |
I had idle animations on my paperdoll. =/ |
Author: | William [ Thu Aug 16, 2007 6:44 pm ] |
Post subject: | Re: Constantly Animated Sprites |
But you'll have to pixel the animation if its not just for the eyes. |
Author: | Matt [ Thu Aug 16, 2007 6:49 pm ] |
Post subject: | Re: Constantly Animated Sprites |
I only use it for flying creatures. |
Author: | Robin [ Fri Aug 17, 2007 12:58 pm ] |
Post subject: | Re: Constantly Animated Sprites |
Perfekt wrote: I only use it for flying creatures. Same. I remember bringing it up ages ago with DarkAngel. |
Author: | Soyokaze [ Mon May 05, 2008 6:38 pm ] |
Post subject: | Re: Constantly Animated Sprites |
EDIT: Nevermind! I got it working finally, just had to save to a text box instead! ^_^; This is so awesome! |
Page 1 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |