Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Best way to handle animations?

Author
Message
timd35b
User Offline
Joined: 5th Oct 2020
Location:
Posted: 5th Dec 2020 20:06
I have several(6 or 7) different animations I want to use in a game. Will it be better to make and call a scene for each one or put them all in the same scene? I am thinking that a scene for each would be better so I can call them at will in different scenes and levels? But I am new to AppGameKit and learning how it handles various things.

Thanks in advance for any help.
Cybermind
Valued Member
18
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 8th Dec 2020 11:47
I don't think AppGameKit uses scenes, but only what you define yourself (although I haven't used Studio much yet, this could have changed since Classic), so you could store the animations, and if they're fullscreen, pause the other parts of the code, call up the animation and play it in front of everything else, when done resume other code
13/0
jd_zoo
3
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 11th Dec 2020 20:40 Edited at: 11th Dec 2020 20:43
Hi timd35b, each animation I use I store only as an image. Every time I want to use that animation, I create a sprite from that image and set up the animation.

So I have this when I load up all my graphics:


Then each time I want to use it I set it up manually:


I'm not aware of any way to save an animation as a datatype. Can pre-create the sprite and set to invisible or move offscreen as well. Not sure if this is any help or not but good luck!
timd35b
User Offline
Joined: 5th Oct 2020
Location:
Posted: 15th Dec 2020 06:54
@Cybermind, it is all scenes in studio. I think I have figured out what I need to do though.
@jd_zoo, that is close to what I want.

Thanks to you both for pointing me in the right direction.



Xaby
FPSC Reloaded TGC Backer
14
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 15th Dec 2020 19:17
I would do it with game states.

You have your main loop and depending on your game_state (a variable with an integer in it) you would deside which animation you are playing.
You could look into "skeleton2Danimation" (Spriter, Spine also supporting flip-book animations and bigger scenes, Spriter is free. You need to create bones)
and for easier animations, you could code them with "tweens"
Tweens and Skeleton2DAnimations also have IsPlaying ... commands.
integer GetSkeleton2DIsAnimating( iSkeleton )
integer GetTweenSpritePlaying( tweenID, spriteID )
Tweens also could be stick together and make an animation chain.

Login to post a reply

Server time is: 2021-09-19 21:57:33
Your offset time is: 2021-09-19 21:57:33