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:
if(x < 400 && x > 350)
{
if(dbKeyState(28) == 1)
{
//pseudocode commented
//clear the screen run a function that brings up next screen
dbCLS();
NextRoom();
}
}
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.