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 / How do i create a model and move it?

Author
Message
Lil JJ
16
Years of Service
User Offline
Joined: 30th Aug 2008
Location:
Posted: 31st Aug 2008 05:43
Im using the game level sample tutorial that came with GDK, but I screwed up my 3D object one, so I don't know how to create 3D objects, so can anyone help me? oh, and i also would like to know to the move the object with WASD instead of the arrow keys, and move the object instead of the screen view, ill try to make it look in the direction of the object. and how do i make it shoot?

PS I'm sorry I sound like a 9-year old, but I'm kinda in a rush


Sincerely,
Lil JJ
Mr Mike
16
Years of Service
User Offline
Joined: 8th Jul 2008
Location:
Posted: 31st Aug 2008 16:47 Edited at: 31st Aug 2008 17:02
You can make a cube as your player with this
dbMakeObjectCube(1,2);

Put these next commands in your mainloop for WASD movement:
if (dbKeyState(17)) // W Move Forward
dbMoveObject (1,1);
if (dbKeyState(30)) // A turn left
dbTurnObjectLeft(1,1);
if (dbKeyState(32)) // D Turn Right
dbTurnObjectRight(1,1);
if (dbKeyState(31)) // S Move Back
dbMoveObject(1,-1);

For a 3rd person view camera put these next commands in your main loop too:

dbPositionCamera(dbObjectPositionX(1),dbObjectPositionY(1) + 2,dbObjectPositionZ(1)); dbRotateCamera(dbObjectAngleX(1),dbObjectAngleY(1),dbObjectAngleZ(1));
dbMoveCamera( -15 );

Sometimes the camera kinda flickers I'm gona see if I can fix that

As for shooting I don't know anything about that

HEYYYY YYYOOUUUUU GUUUYYYYSSSS
Skull breaker
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location:
Posted: 1st Sep 2008 20:21
and also if your screen is moving instead of the object, then that means that the object you specified to move, isn`t right and you need to change it.

This is a signiture

Login to post a reply

Server time is: 2024-09-30 05:19:09
Your offset time is: 2024-09-30 05:19:09