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 / DBP-DarkGDK Problem

Author
Message
XFS Illusion
18
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 13th Dec 2007 21:02
I took some code directly from DBP and converted the basics of it to DarkGDK, so I thought. I'm getting some build errors, and my ship just sits there with no control(Arrows supposed to move it). I'm new to the GDK, i'm probably not using the variables right since that seems to be a major change from DBP.

Here is my code:




And here is my build:


Any suggestions?

Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 14th Dec 2007 02:47
you don't need to keep "initializing" your variables



these changes clean up your build but the program does not seem to do anything

Codger

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th Dec 2007 19:28
Yup Codger cleaned up the code a bit.

I'd also add this: move the declaration for this code above the while loop:



like this:



And just have this in the while loop:


that's the first thing I saw outta place - kinda - at least I'd do it differently. Then I took off - Next person to improve this some more - your turn

XFS Illusion
18
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 14th Dec 2007 19:33
Thanks guys. I actually read the C++ manual last night and realized i was re-initializing too much. Like i said, i'm a noobe to this language, not my first silly mistake, probably not my last. Thanks, i'll give this a shot.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th Dec 2007 20:20
I'm glad you took the plunge! Hair Pulling at times it is - but once you start writing fairly "Tight" efficient code - you'll see that DarkGDK does pack a punch in performance.

(Until you start getting into the deeper things for complex worlds) and then all the same issues in DBPro are there - but I think when conquered in DarkGDK - the result is STILL Faster the DBPro by a long Shot

XFS Illusion
18
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 15th Dec 2007 18:02 Edited at: 15th Dec 2007 18:27
Ya, its a headache, thats for sure. Main reason I chose to jump into C++ is not just for speed, but the fact that though I can use the GDK for a great number of things, there are a huge amount of C++ libraries out there that I can use to do alot of things that DBP simply can't do on it's own. BTW, the suggestions with the variables worked, aside from this one issue, which is a headache.

When I say headaches, here's an example. Below is part of the same code I posted in this thread. The dbLeftKey() functions work just fine, but when I use the dbUpKey and dbDownKey functions in nearly the exact same type of expressions...I wont work. I just don't get it, i've tried it in several configurations. I noticed that the same syntax for the up and down key statements work fine in the default 3D game wizard example, but can't get it to work in this code...i'm stomped on this one(and literally got a headache). So I can get my ship to move side to side, but not up and down, when the method shouldn't be totally that different. If anyone has any idea why it's not working, i'm open to a pain reliever. See my code below to see what I mean.




XFS Illusion
18
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 15th Dec 2007 18:26
Look at the code, it has the case right(dbUpKey), but the compiler lists it as dbUpkey...i noticed this, not sure why it's dropping the K to lower case in the error.

I tried the
if (dbUpKey() == 1) ...

method, it didn't work either.

XFS Illusion
18
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 15th Dec 2007 18:30
Nevermind, it magically works now...though i'm almost positive I had the case right. Oh well, thanks.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 15th Dec 2007 18:42
hehehe - that's kinda funny. I know a guy one time (this is off topic and not in reference to XFS Illusion but.... This guy was making demands - and basically aiming some major anger toward us forum readers - you could tell - un grateful etc etc. So I got a little piturbed and ask that he treat people with a little more respect and not make demands - then he said I misconstrued everything - and when I scrolled up - he changed every one of his posts to look "much nicer" - making my post look silly. Bahhh!




@XFS Illusion - regardless of how - I will say you might consider grabbing the scancode list and using dbKeyState(???) instead. I'm not sure if dbUpkey etc work with simulataneous pressing - but if they work fine - fine.

another thing - I DEFINATELY know a MAJOR Weirdness. In one of my classes I made a function Named LoadImage... Sounds reasonable enough.

Now - in Intellisense - and in the code where I call it - it says: LoadImageW - BUT the original Source code/declaration etc - still say LoadImage and you know what? It freaking runs!

My GUESS is that the compiler is trying to make up for a LoadImage somewhere is something I'm linked to - but I have no clue - it runs. Weird Huh?

Login to post a reply

Server time is: 2024-11-17 00:50:30
Your offset time is: 2024-11-17 00:50:30