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 / Comparing DBPro Code to DarkGDK - What am I doing wrong?

Author
Message
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 25th Feb 2008 15:01 Edited at: 25th Feb 2008 16:39
I am trying to teach myself to code with DarkDGK. It is the first time I've used any non-BASIC language so it is an uphill struggle. I thought the best method would be to write some code in DBPro and then try to replicate it in C++ (DarkGDK) but I am having problems.

Perhaps someone would be good enough to point out what the problem is with these bit of code?

DBP:


The same thing in DarkDGK:


As far as I can tell, they should perform the same function, which is to apply a small amount of thrust to the Physics object Ship.oNum when the left mouse button is clicked. However, in the DarkGDK version the thrust is applied constantly. Any suggestions?


Later in the code I have this:

DBP:


DarkGDK:


Again, I think it should perform the same function but the ship remains stationary, completely unaffected by gravity or thrust unless I comment out the line that constrains the 2D angle.

This C++ stuff isn't proving easy ... any help is always appreciated.

Thanks

[Edit] Perhaps I should point out that the DBP code works perfectly.

[Edit 2]I've worked the first one out!
It's those bloody semi-colons! I hade one in the wrong place, it should be:


Still no idea about the other one though



Kurt
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location:
Posted: 25th Feb 2008 17:32
try



This works for me!

Login to post a reply

Server time is: 2024-11-20 03:35:22
Your offset time is: 2024-11-20 03:35:22