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 / Release key event and sprite problem

Author
Message
tezuka11
14
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 13th Feb 2010 11:33
Hey guys,
You know if there's any way to create some sort of release key event? Cause I use sprites that has animations for both standing and running left and right and I want it to show the standing left or right sprite after it's moved respectively.
Also, in terms of sprite animations, when I tell the game to play a different segment of the sprite, it finishes playing the sprites it was told to play before it changes over to the different sprites. Is there any way to instantly change the sprite (ie. stopping the sprite animation mid-way and changing into a different animation)
Thanks heaps.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 13th Feb 2010 17:05
1: I made an input class that can handle releasing keys and much more (including double click):
http://forum.thegamecreators.com/?m=forum_view&t=164488&b=22

2: Yes, it's possible. You should be able to specify what frames you want to play the sprite from/to.

3: Use dbSetSpriteFrame(SPRITE, FRAME);

Success = Determination * Mood;
tezuka11
14
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 14th Feb 2010 12:12
Hey man,
Thanks heaps for your input classes! Can you explain to me how to use them please? (I'm new to all this, lol)
Also, I've tried dbSetSpriteFrame but since I'm holding down the right key for example when I'm moving right, it'll lock the sprite frame to what I told it to set to and won't animate unless I release the key. Any other ideas?
Thanks heaps so far man.
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 15th Feb 2010 01:03
dbPlaySprite(iSPRITE, iSTARTFRAME, iENDFRAME, iDELAY)?

[url="http://neovance.com/"][/url]
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 15th Feb 2010 01:45 Edited at: 15th Feb 2010 01:47
Some pseudo code for you:



The input class comes with an example program to use.

PS: Maybe dbLoopSprite can also be a solution instead of using dbPlaySprite.

Success = Determination * Mood;
tezuka11
14
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 15th Feb 2010 09:22
Okay, I managed to incorporate the input class globally, however, I'm getting this error...

Quote: "1>c:\users\dood\documents\visual studio 2008\projects\utilities\utilities\utilities.h(5) : error C2871: 'System' : a namespace with this name does not exist
1>c:\users\dood\documents\visual studio 2008\projects\utilities\utilities\utilities.h(10) : error C2059: syntax error : 'public'
1>c:\users\dood\documents\visual studio 2008\projects\utilities\utilities\utilities.h(11) : error C2143: syntax error : missing ';' before '{'
1>c:\users\dood\documents\visual studio 2008\projects\utilities\utilities\utilities.h(11) : error C2447: '{' : missing function header (old-style formal list?)"


I do not know what I've done wrong... The funny thing is that the coding in utilities.h was written by the compiler itself so I have no idea why it's acting up on me now.

Login to post a reply

Server time is: 2024-11-20 03:25:04
Your offset time is: 2024-11-20 03:25:04