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 / Possible bug with PlaySprite() and ResumeSprite()

Author
Message
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 23rd Aug 2015 22:35
This is pseudocode to describe the problem:



What will happen there is after the jump is complete all frames from 10 to 35 will play and when 35 is reached it will start over on 30 again. However if the walking frames were below 10 (the jumping frame) it works as it should.

I've tested this and the only thing I changed was where the walking-frames were and then it works, with them higher than the jumping frame all frames between the jumping frame and the walk-frames will play. Weird innit.

Hopefully I'm just doing something wrong

My hovercraft is full of eels
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 23rd Aug 2015 22:55 Edited at: 23rd Aug 2015 22:59
because your flag you do the same again and again
i think this ResumeSprite should called only once.

AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 23rd Aug 2015 22:58
You're saying because the animation is set to repeat that is why it shows all the frames from 10 to 35? Seems like a bug in of itself then

My hovercraft is full of eels
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 23rd Aug 2015 23:03 Edited at: 23rd Aug 2015 23:07
ths docu say this about ResumeSprite
Quote: "Continues from the current frame rather than starting again at the first frame. "


it would be easier to understand with a full example.

AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 23rd Aug 2015 23:09 Edited at: 23rd Aug 2015 23:15
So what is happening when the frame in the PlaySprite() is lower than 10? it doesn't play every frame from 10 to 35 then.

I also assumed that meant from the beginning of the playsprite, if you had to always recall playsprite to set the right frame what would be the point.

I have 54 frames and everything works with freezing frames for certain maneuvers until the playsprite is a higher number than the frozen frame used. Just seems odd


Edit: I moved the jumping frames to the last position in the atlas image and now it works like I expect it would. So that is a workaround to either a bug or to what is a design flaw in my humble opinion.

My hovercraft is full of eels
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 23rd Aug 2015 23:17 Edited at: 23rd Aug 2015 23:23
I'm not going to make an example, suffice to say is, if you have PlaySprite() setup with frames 10-15 then StopSprite() and display a frame with a LOWER number than 10-15, when you then ResumeSprite() every frames from the frozen frame will play until 15 is reached.

Which doesn't happen if the frozen frame is a higher number than 10-15.

If it's supposed to be this way I'll use the workaround


Edit: I guess it could be meant to be this way, I assumed ResumeSprite() used the same frames as PlaySprite() was setup with. Never had an issue before in all these years so that must have been chance

My hovercraft is full of eels
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 23rd Aug 2015 23:34 Edited at: 23rd Aug 2015 23:37
hmm, i understand
if you set a animation with loop flag, from 10 to 15 frame, stop it
set a frame 20 and the resume did not start from 10.
that would be a bug.
i think u need to set the start frame before resume as workaround.

i would also expect after stop/resume the start frame is used.
stop - resume is the wrong order.
start - pause - resume - stop.
can't see a anim pause command.

AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 23rd Aug 2015 23:36 Edited at: 23rd Aug 2015 23:37
in your example it did start with 10 correctly, if you set the freeze to lower than 10 it would play every frame up until 15 then restart at 10

which again, might not be a bug, just not the way I understood ResumeSprite to work, which I thought worked with the frames you set up with PlaySprite.

Thanks Markus

My hovercraft is full of eels
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 23rd Aug 2015 23:39 Edited at: 23rd Aug 2015 23:41
emm, you mean it continues from the current frame forward
to the values min,max.

i think the logic is similar a tape recorder.

AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 24th Aug 2015 16:23
Just felt odd. ResumeSprite obviously uses the frames set up with PlaySprite except for if the current frame is lower than the frames in PlaySprite.

I must always have avoided this issue by pure chance in the past.


Wasn't the case in DBPro that you called PlaySprite in every game loop and that worked like ResumeSprite? I seem to recall

My hovercraft is full of eels

Login to post a reply

Server time is: 2024-04-25 21:44:04
Your offset time is: 2024-04-25 21:44:04