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.

DarkBASIC Professional Discussion / I need help with my game "Space Dual"

Author
Message
C0braK1ng
16
Years of Service
User Offline
Joined: 18th May 2010
Location:
Posted: 24th Apr 2011 20:42 Edited at: 10th May 2011 01:57
Edit: Please Mods can you change the title to "Space Duel"?
Hi all! First of all I want you to know that I have never played Space Dual if there is a game called that out there. Second I'm having trouble with the controls. I'm trying to use vectors for my game so I can learn how to use them better. Also I'm very new to programming. Here's my code so you can help me figure out what's wrong:

Thanks for any help you can give!

{0br4|<!ng
C0braK1ng
16
Years of Service
User Offline
Joined: 18th May 2010
Location:
Posted: 24th Apr 2011 21:02
What I meant about trouble with controls is, controlling the ships. They just start flying around all by them selves. I followed the instructions from Hands On DBPro Vol 1 on how to program it. But still having trouble.

{0br4|<!ng
C0braK1ng
16
Years of Service
User Offline
Joined: 18th May 2010
Location:
Posted: 27th Apr 2011 00:28
Alright, I took a look at my code once more and viola! I had missed one letter in my HandleShip() function!! The "keyspressed" word was missing the s on the "keys" word in the functions parameters. So now my ships don't just start flying uncontrollably.

But I'm still curious as to why the right ship flies slower than the left?? Any ideas?

{0br4|<!ng
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 27th Apr 2011 09:55
kind of hard to test without being able to compile your code...

but, they do start out at different velocities,
probably not a good idea to use the shipid's as initial velocities.
C0braK1ng
16
Years of Service
User Offline
Joined: 18th May 2010
Location:
Posted: 29th Apr 2011 18:48 Edited at: 29th Apr 2011 19:10
Do you need the stuff for the sprites? I can attach it if that will help. Ohh! Duh, I didn't even realize that i was using different velocities because of using the ship's id.
Edit: But I tried changing that so they were the same but it didn't help, oh well. Actually I kind of like it just the way it is. Thanks for the tip.

{0br4|<!ng
Rich Dersheimer
AGK Developer
17
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 30th Apr 2011 05:31
Just a thought... is it a game about two spaces?

Dual means two. Duel means a fight between.

Probably not important.

BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 30th Apr 2011 13:14
Yep, any graphics so I can compile your code to track down the problem.
You can email it to me or post it here.
C0braK1ng
16
Years of Service
User Offline
Joined: 18th May 2010
Location:
Posted: 30th Apr 2011 21:59
Oops, typo! It's not about two spaces, its supposed to be Duel. Ok, I will attach the graphics, in multiple posts.

{0br4|<!ng
C0braK1ng
16
Years of Service
User Offline
Joined: 18th May 2010
Location:
Posted: 30th Apr 2011 22:08 Edited at: 30th Apr 2011 22:10
Actually, I'll just send you an email.

{0br4|<!ng
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 1st May 2011 08:55
I received the graphics you sent me, thanks, please send me the file splashduel.bmp, I used a placeholder graphic to get the code to compile.

I am having trouble getting your code to work,
what version DBPro are you using?
I am using the latest DBPro v77 beta with Windows 7 Home Premium 64bit.

So far, my ships don't move at all, still working on it.
C0braK1ng
16
Years of Service
User Offline
Joined: 18th May 2010
Location:
Posted: 3rd May 2011 04:20
I think I'm using version 76 DBPro, with Windows XP Home Edition SP3. Do you know what buttons to press? You might have to change the scancode to your keyboard(just a thought). I'll send splashduel.bmp over now.
P.S. Mods can you please change the title to: "Space Duel". Thanks!

{0br4|<!ng
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 6th May 2011 12:20
I haven't forgotten about you, I had to go out of town,
I will be back home in 1 more week,
but I will work on your code while I am away this time.
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 7th May 2011 08:52 Edited at: 7th May 2011 09:35
I'm getting all kinds of weird problems...
Does your 'C' key make both ships move?...mine does
And if they are moving up really slowly they stop at the top of the screen and don't wrap.

The left ship moves many times faster than the right ship

I know there are sometimes problems returning a UDT value from a function, us a regular variable as a return value

Also, you should update the .velocity variables to hold the current velocity value, they don't seem to do that at the moment.

Still working on it though...
C0braK1ng
16
Years of Service
User Offline
Joined: 18th May 2010
Location:
Posted: 10th May 2011 01:42 Edited at: 16th May 2011 22:50
What's a UDT? Anyway did you fix the above noted function problem? And thanks for your help and for still working on it! I'll see if I can figure out where to update the velocity values.

Please Note Mods! Plz change the title if possible to "Space Duel"!

Edit: UDT is User Defined Types. Duh! lol

{0br4|<!ng
C0braK1ng
16
Years of Service
User Offline
Joined: 18th May 2010
Location:
Posted: 10th May 2011 02:00
Yes my 'C' key does the same too. Yes they stop at top too and yes left ship moves faster than right ship. Got any idea where to update the velocity variable? Cause I don't know much of anything about them vectors.

{0br4|<!ng

Login to post a reply

Server time is: 2026-07-12 00:07:13
Your offset time is: 2026-07-12 00:07:13