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 Classic Chat / [SOLVED] How do I create a sprite with multiple animation sequences?

Author
Message
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 25th Mar 2021 17:19
I have lately developed a fascination with the eat-and-dodge genre. Since Pacman is the original of this, I thought it would be fun to combine the the gameplay of Crystal Quest with the Pacman visuals.

So, I try to create a pacman which can turn in 32 directions, via 32 spritesheets.

Alas, replacing the sprite images and running SetSpriteAnimation ( puckSID, 13, 13, 5 ) every frame caused the sprites physics to go bonkers. No clue why. Also, I don't like having to calculate the spritesheet every frame.

I guess I could make the physics sprite invisible, and then have place one of the 32 sprites one on top of it. But is there a smarter way?

The author of this post has marked a post as an answer.

Go to answer

PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 25th Mar 2021 23:33
This post has been marked by the post author as the answer.
personally speaking I would pack them all into a single image but if that is not an option then go with your latter idea and have the physics sprite as the control sprite and use SetSpriteImage, SetSpriteFrame, DrawSprite to show the correct frame

or is it possible to have a single set of animations and adjust the sprite angle for its direction.
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 26th Mar 2021 00:23
A single image image of 160 frames sounded crazy, so I tried it, and it works! Thanks, wouldn't have thought that up!
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 26th Mar 2021 09:05
By the way, if you ever need a 32 direction pacman, here's the sprite!
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 26th Mar 2021 13:09
The old days of computing they would put a complete sprite list into one image

The addspritetoframe command is handy for what you are doing aswell

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 28th Mar 2021 11:39
The more images you can pack into a single image the better as there are less draw calls, also, thats a fairly simple animation, you could have just rotated/flipped the sprite for your directions.

Login to post a reply

Server time is: 2024-04-24 14:19:35
Your offset time is: 2024-04-24 14:19:35