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 / Game HELP!!! PART 3

Author
Message
Tylerman35
15
Years of Service
User Offline
Joined: 23rd Jul 2009
Location:
Posted: 1st Aug 2009 20:18
I need help for my game. How can i postion the camera behind colonel-x.x and the camera will stay there when ever i move him. Here is my code
-------------------------------------------------------------------

#include "DarkGDK.h"

void DarkGDK ( void )
{
dbSetCameraRange ( 1.0f, 30000.0f );
dbLoadObject ( "skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbScaleObject ( 2, 30000, 30000, 30000 );
dbPositionCamera ( 385, 23, 100 );
dbSetObjectTexture ( 2, 3, 1 );

dbLoadObject ( "Colonel-X.X", 1 );

while ( LoopGDK ( ) )
{
if(dbUpKey()){
dbMoveObject (1, -10);
}
if(dbDownKey()){
dbMoveObject (1, 10);
}
dbSync();
}
return;
}
Bubzy
15
Years of Service
User Offline
Joined: 29th Jun 2009
Location: somewhere
Posted: 1st Aug 2009 20:52 Edited at: 1st Aug 2009 20:58
you already have the dbPositionCamera command in there so i assume you know a little bit about the camera.

for really basic camera movement you can try something like

dbPositionCamera(385,23,dbObjectPositionZ(1)+100.0f);

otherwise look at the dark dungeon example game and use that code to get the result.
tip: you will need to use vectors

Also its probably best to start off as i did with basic 2d stuff. so that you get a feel for how the engine works, how to position and rotate objects, you will find it very slow progress if you are asking for help with little things like this (not having a go at you its just better to learn yourself) i learned 90% of what i knew about dark gdk from the help file its definately worth reading through.

void Void(void){(for i = 0; i < i+1; i++){cout<<"bubzy rules "}}
Tylerman35
15
Years of Service
User Offline
Joined: 23rd Jul 2009
Location:
Posted: 1st Aug 2009 21:16
i got an error on the code, well nice little tut but i need a working code, can someone give me a working code?
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 3rd Aug 2009 15:22 Edited at: 3rd Aug 2009 15:28
Put this in your loop:



Ive done this from memory so it might not be 100% correct, just check the documentation if it doesn't work.

The smooth parameter is pretty cool, have a mess around with different values.

Login to post a reply

Server time is: 2024-11-19 01:52:31
Your offset time is: 2024-11-19 01:52:31