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 / KeyState Issues

Author
Message
Malo
15
Years of Service
User Offline
Joined: 15th Jan 2009
Location:
Posted: 22nd Jan 2009 22:04
First off let me thank you all in advance for any help I may receive!

ok so I am making this 2D game where you are a sprite in front of a background image. You can move left or right.
I want to make it so if you are at a certain location and press the enter key you get "jumped" to another screen to play a mini game. This is the code i am trying to use:

but what seems to be happening is that it only clears the screen while the enter button is pressed. When I let go of the enter key either the background pops back up or the program freezes and shuts down. Currently
I have the background image dbPasteImage() in the main loop.
Once the function is done I want it to go back to the main loop so you can move back and forth between rooms essentially.
Sorry right now for lack of full code. I am away from my project right now and can't get to the code until later. But any ideas how to fix this or how I can even do this.
If I am to vague please let me know.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 23rd Jan 2009 00:56
Why not just use "dbReturnKey()==1"??

That would check for if the enter key was being pressed.


The one and only,


puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 23rd Jan 2009 01:00 Edited at: 23rd Jan 2009 01:04
Oh, I'd do something like

There may be a faster way, but I don't know it.
Malo
15
Years of Service
User Offline
Joined: 15th Jan 2009
Location:
Posted: 23rd Jan 2009 17:56
Sweet! Thank you puppy of kosh this totally worked! Thank you very much.
I just have one more question for now.
If I call a function after I clear the screen to bring up the next room, can I call the loopGDK() main loop at the end of the funtion to restart the beginning room?

Login to post a reply

Server time is: 2024-09-30 15:23:16
Your offset time is: 2024-09-30 15:23:16