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 / Some help with passing to the next lv

Author
Message
Rnd
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location:
Posted: 4th Jan 2011 19:36
Hey, i got a problem to how delete some sprites and go to the next lv

Here's what i have


and when all sprites and images are deleted i wish to sprite appear saying 2nd lv or something and then when space key is pressed I'd like to make him disappear. So I made a function for it



Everything goes okay until the sprite comes out, it looks like i want and stuff but when I'm pressing space key the sprite just wont go away... any ideas ?
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 4th Jan 2011 22:05 Edited at: 4th Jan 2011 22:14
I think it's because you're deleting sprite 30, and so the collision doesn't take place, and the check for the space key is inside the if.
you could try something like this:

The check for the space key should be done in the main loop, where you check the input from the keyboard.
Rnd
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location:
Posted: 5th Jan 2011 14:20
thanks, but it still the same as it was :/ everything is going okay until the sprite appears saying level 2 but it doesn't react to hide or delete functions...
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 6th Jan 2011 16:20
You should have some kind of "wait". What's hapening is that you are calling Intro() and it's just passing through the if(dbSpaceKey()==1). Unless you press the spacekey at the moment it's checking, you will have the sprite permenently.
I'm assuming that if(dbSpriteCollision(1,30)==1) is the "end of level" condition.... Right? If that's the case, you need to go ahead with the "delete all the sprites" that you have, but you will have to change the Intro() function a bit:


The fastest code is the code never written.
Rnd
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location:
Posted: 6th Jan 2011 19:26
hmz... still the same, I think it has something with functions itself... if any1 could look at it i could send the code via e-mail or skype
Rnd
13
Years of Service
User Offline
Joined: 4th Jan 2011
Location:
Posted: 6th Jan 2011 19:41
thanks for help, the problem was like :
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 6th Jan 2011 19:52
Give more complete code and maybe we can see the problem.

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-11-19 14:52:15
Your offset time is: 2024-11-19 14:52:15