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 / Help to correct the code

Author
Message
Gary1234
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 25th Sep 2011 06:16
The following are the code to approximate the motion of falling object. However the Object does not move...

I have shown the "time" and the "distance" at the top right of the screen. The time is run, but the distance stop at 0....
Can anyone help me to correct it?
(i am using Visual Studio2008)



Thankyou@@!
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 25th Sep 2011 10:40 Edited at: 25th Sep 2011 10:44


Make that a float. If it's int, it's zero (the integer part of 0.98). So you are always multiplying with zero.

You should also correct the calculation of the first y coordinate to += not only = otherwise the box will stretch.

Gary1234
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 25th Sep 2011 13:31
Thinkyou again for you kindly help~!!!

Thankyou@@!
Gary1234
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 28th Sep 2011 07:53
I have changed a bit of the program...and ...it does not work again...Would you please have a look?

The objective of the programme change to approximate the motion of object with acceleration and deceleration.

The odject will accelerate until travelling distance = 300,
and change to deceleration at constant rate. The object will stop at velocity = 0.

I am not sure which part is wrong....



The system has the following output:

1>------ Build started: Project: Dark GDK - Moving Object with A D, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>Linking...
1>darksdk.lib(DarkSDK.obj) : error LNK2019: unresolved external symbol "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ) referenced in function _WinMain@16

1>Debug\Dark GDK - Moving Object with A D.exe : fatal error LNK1120: 1 unresolved externals

1>Build log was saved at "file://c:\Users\Win 7 User\Documents\Visual Studio 2008\Projects\Dark GDK - Moving Object with A D\Dark GDK - Moving Object with A D\Debug\BuildLog.htm"

1>Dark GDK - Moving Object with A D - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thankyou@@!
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 28th Sep 2011 16:26
Quote: "void DackGDK()"

You wrote your entry point wrong, it is misspelled.

Login to post a reply

Server time is: 2024-11-19 07:19:28
Your offset time is: 2024-11-19 07:19:28