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.

Dark GDK / play then loop.

Author
Message
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 30th May 2008 01:12 Edited at: 30th May 2008 02:13
Ok wondering if anyone has any good thoughts for this.

I need a function to do this..

Start an animation object play then when it gets to the end start a loop at a different start frame..

so start playing 1 to 50, then go back to 30 and loop 30 to 50 over and over.

I want this via a single call, not a loop. So doThenLoop( T0_KNEEL, KNEEL );

I know I could make a animation loop in main but I'm trying to avoid that.

Seems while looping in GDK there is no access to the start and end frame after the dbLoopObject call. So I cant just change the start frame mid way in. Not sure if there is a interval function for c++, and dont want to multi thread. Any thoughts?

also tried dbloop 30 to 50 and then set a frame of 1, it just stops at 1. Since 1 is out side the loop.
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 31st May 2008 12:08
Cool! This sounds like fun! *Cracks knuckles* Gonna have to be completely untested code, though, I'm at work ='(

*Ahem*...So, I'm going to assume you are using a class to store all of the player's information like position, angle, animation state, etc. So here is a real basic player class I'll use(without all the jee-gaws like movement and such);



Now that we have that class with the kneel animation routine, we need some basic proto-code to go with it!



Like I said, the player class is not tested, but I think it will work. If not well, it should at least give you an idea of how it would be done. Using a switch statement and monitoring the objects animation frames, you should be able to switch to the appropriate frame even from inside the switch.

Cheers, hope that helps! Will test it when I get home lol


Tux is my guildmaster.
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 3rd Jun 2008 19:15
Hey thats not a bad idea, that would prevent the constant loop checking.... I may try that..
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 4th Jun 2008 01:17
Actually this would not work, its the same as what I'm doing..

I have my class and the function doThenLoop.

I'm using

doThenLoop( OUT_KNEEL, ATEASE, 100, 10 );

To run it and

checkLoop(); to check it.

If its finished I still am stuck doing the check (just one cycle).

I want to do this with out a check.

Like a call back to the function until its done, then no more call backs..

Login to post a reply

Server time is: 2024-10-07 21:25:21
Your offset time is: 2024-10-07 21:25:21