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 / And the issues keep arising...

Author
Message
Scarface
17
Years of Service
User Offline
Joined: 21st Oct 2006
Location:
Posted: 23rd Aug 2007 01:56
Here is what I have so far:



The problem is, nothing shoots out at all, the window just closes (I assume a crash).

- Scarface
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Aug 2007 02:05
Your main loop should be:



or



The DarkGDK requires the call to 'LoopGDK' to execute properly. The 'LoopGDK' will exit when the escape key is pressed, unless you disable it. Since you aren't calling that function, the program pretty much ends immediately.

Cheers,
Ancient Lady
Scarface
17
Years of Service
User Offline
Joined: 21st Oct 2006
Location:
Posted: 23rd Aug 2007 02:24
I still get the same result, it just ends the application when space is pressed.

- Scarface
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Aug 2007 02:32
I just noticed that you are using fYPos in the while loop before you initialise it.

Try this:


Cheers,
Ancient Lady
Scarface
17
Years of Service
User Offline
Joined: 21st Oct 2006
Location:
Posted: 23rd Aug 2007 02:47
Nice catch, doesn't crash anymore however it still doesn't shoot

- Scarface
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Aug 2007 03:03
That's because (I think) the entire action takes place between one dbSync call and the next.

You need to set up something a bit more complex:
1. the space bar initiates shoot and sets the start position and set a flag to indicate shooting.
2. each dbSync cycle after, check the object's position, if not at end, move it. if at end, clear flag to check status.

Cheers,
Ancient Lady
Scarface
17
Years of Service
User Offline
Joined: 21st Oct 2006
Location:
Posted: 23rd Aug 2007 10:53
Ok thanks, i'll give that a try this morning

- Scarface

Login to post a reply

Server time is: 2024-09-29 01:23:41
Your offset time is: 2024-09-29 01:23:41