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 / Difficulty with animating sprite

Author
Message
Ezra Stone
9
Years of Service
User Offline
Joined: 24th Jul 2015
Location:
Posted: 24th Jul 2015 06:11
Hi guys,

I recently took onboard AppGameKit Basic and am enjoying it a lot. Using Spriter Pro, I made a man who has an idle standing animation, and can run in all 4 directions. At first I was working with the skeleton import, but then I went to using sprite sheets because I couldn't figure out how to make collisions between skeletons and normal sprites.

My issue is that when i go to animate the sprite using the sprite sheet, the values for the width and height do not seem to appropriate register on the image.
I've added the code below. This is assuming I have already loaded the images and given them an ID, as well as labelled them as global.



The product is shown below. I am definitely sure the size of the davestanding image is 289x608. Definite. But it still produces this:



Two options for help involve:
1. Finding a way to make the skeleton from spriter being able to interact well with other sprites.
2. Animating it properly.

Thanks a lot
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 24th Jul 2015 07:50
Quote: " I am definitely sure the size of the davestanding image is 289x608. Definite. But it still produces this"


"SetSpriteAnimation" takes the size of a single frame of the sprite. So if your image size was something like 320x224 and each frame was 32x32 you use "SetSpriteAnimation(dave, 32, 32, 16)".



Sean

hapeyron
9
Years of Service
User Offline
Joined: 4th Aug 2015
Location:
Posted: 11th Aug 2015 05:14
I didn't tested, but isn't there a way to attach a sprite in the bones for dealing with collisions? Using GetSkeleton2DBoneCurrX, GetSkeleton2DBoneCurrY and GetSkeleton2DBoneCurrAngle with invisible sprites might do the trick. It's a guess, I did something similar in another engine to deal with collisions. I'm still learning AppGameKit, so, I'm using multiple images for animating sprites, but I intend to incorporate Spriter Pro soon in my workflow with AGK.

Login to post a reply

Server time is: 2024-11-16 20:08:21
Your offset time is: 2024-11-16 20:08:21