What I'm trying to do is have the main character and the main characters weapons as seperate sprites. Simple technique - the benefits are obvious and if you don't know what I'm talking about you probably can't think up a solution anyways.
So heres my problem. When the main character changes animations, the different weapons must change their animations to match that of the main character right? Well, this sometimes works but other times the animations are out of sync. In other words frame 1 of main character would play while fram 2 of weapon would be playing, frame 2 of main character playing, frame 3 of weapon playing etc.
I tried two versions of code. The first goes something like this:
Press SPACE
- Main character change animation to attack
- Weapon change animation to attack
The 2nd version uses fast loops:
Press SPACE
- Begin loop "anim attack"
On Loop "Anim attack"
- Main character change animation to attack
- Weapon change animation to attack
Both versions have frequent animation synchronization problems; and although you'd think the 2nd version would work better, its actually worse :S
Maybe try forcing the Weapon object's animation frame to match the Character object's when the weapon change animation is playing?
i.e.
User presses SPACE Change (Character) Animation to "Weapon Change"
Change (Weapon) Animation to "Weapon Change"
(Character) Animation "Weapon Change" is playing + (Weapon) Animation "Weapon Change" is playing:
(Weapon) Change Animation Frame > Use a calculation > Retrieve Data from Object > (Character) Animation > Current Frame.
Ooops sorry bout that . My eyes must have gone wrong for a sec.
Yes that SHOULD theoretically work but it doesn't . There's still a slight gap inbetween the sprites. I'll try to incorporate fast loop with your logic.
Good to know I'm not the only one thats got this problem.
I've tried AsparagusTrevor's idea along with fast loops and it seems to help. The synchronization is off by like a fraction of a millisecond but still noticable especially if your sprites are dark and they're against a light background. Guess I'll just have to live with it :S
MMF is strange - sometimes I just say:
Press SPACE
- Weapon play animation attack
- Player play animation attack