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 / Problem with a header file

Author
Message
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 14th Jun 2008 03:09
I am trying to create a header file that makes it so you can use gravity much easier. I have this so far-


When I left click on BGravity in the while loop, and then go to define, it says it was never defined. It was though, up at the top...

This worked when in the game program, so I don't know what is wrong with it.

Also, any suggestions on what to add to this, I am going to add jumping, so that you can set which key will make the character jump.

Thanks!

Your signature has been erased by a mod - 120 high maximum please
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 14th Jun 2008 04:38
As far as WhileLoops() is concerned, you never set a value for BGravity. If you were to enter WhileLoops() before you entered Collision() BGravity would have a random value so you couldn't guarantee that a true or false value was set when you performed the loop test. Try setting BGravity and BGround to either true or false on declaration depending on what's appropriate.

Two things to mention:

1. If BGravity is a bool all you need to do si

while (BGravity) { }

and not test it for equality.

2. You never change the value of BGravity inside the loop, unless dbMoveObjectDown() changes it. That means that if BGravity is true going into the loop, the loop will keep running and never exit for the rect of the function to execute.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 14th Jun 2008 14:01 Edited at: 14th Jun 2008 14:02
Quote: "2. You never change the value of BGravity inside the loop, unless dbMoveObjectDown() changes it. That means that if BGravity is true going into the loop, the loop will keep running and never exit for the rect of the function to execute.
"


Yes, i know that, but It is still not done, it still needs a couple of things in it.

Thanks for the rest of it though, it was helpful. NOw to try it out.

Your signature has been erased by a mod - 120 high maximum please
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 14th Jun 2008 16:01
Ok, i changed around the header file a bit.


Now, I am going to make another header file that includes this one and the new header file I want it to be something like sparky's, where it is like

SC_SetupObject ( int Obj, int Group, int Shape );

I want to do

JG_StaticObject ( int GroundID );
JG_Object ( int ObjectID );
JG_Gravity ();

How would I do that?

Your signature has been erased by a mod - 120 high maximum please

Login to post a reply

Server time is: 2024-09-29 23:32:10
Your offset time is: 2024-09-29 23:32:10