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.

Newcomers AppGameKit Corner / New Here: Sprite Animation

Author
Message
Kirkkaf13
6
Years of Service
User Offline
Joined: 9th Jul 2013
Location: Nottingham, England
Posted: 15th Apr 2019 16:51 Edited at: 15th Apr 2019 17:31
Hello,

Although I have owned a copy of AppGameKit since it's release on Steam I have yet to put it to use. The last few hours I have been playing around with various functions and am extremely impressed with the easy of use and the documentation seems pretty solid too.

I am got to the point where I wanted to create a 2 frame animated sprite. I placed both images in the media folder and ran the following;



I am unable to get my sprite to animate through the 2 frames, upon loading frame 2 is showing which made me think it did get to frame 2 but didn't look. Looking at the docs looping is default.

What am I doing wrong here?
Bengismo
1
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 15th Apr 2019 17:20
Make sure to add your first frame too??

So:

bunny = CreateSprite(bunny1)
AddSpriteAnimationFrame(bunny, bunny1) // <-this needs adding i think
AddSpriteAnimationFrame(bunny, bunny2)

PlaySprite(bunny,0.2, 1)

Ive not tried it but I seem to remember having to do that.
Kirkkaf13
6
Years of Service
User Offline
Joined: 9th Jul 2013
Location: Nottingham, England
Posted: 15th Apr 2019 17:36
Unfortunately that makes no difference at all.

Bengismo
1
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 15th Apr 2019 20:18
There is no playsprite command that takes 4 arguments....its 2,3 or 5 so not sure how your getting that ^^ to compile at all??


this code works for me and animates the 2 frames fine
Kirkkaf13
6
Years of Service
User Offline
Joined: 9th Jul 2013
Location: Nottingham, England
Posted: 15th Apr 2019 21:46
Ok, I didn't copy and paste that, it was a typo. I see the issue now, I assumed the first image used when the sprite was created would automatically be added as an animation frame.

Login to post a reply

Server time is: 2019-09-16 12:16:20
Your offset time is: 2019-09-16 12:16:20