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 / Flying game

Author
Message
Cas
14
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 12th Nov 2010 18:50
Hi, I'm currently trying to make a flying game for a uni module. I can get the plane to roll and move to the left and right but I need it to return to being flat when the key is released. I tried doing an else if statement but that failed.

I'm not sure how to go about it really and any help would be good =]

Here's the code I currently have to get it to do as I wish:

Dodga
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 13th Nov 2010 02:04

This is quick and dirty, and I'm not sure what axis your object is rolling on, but basically you need to record the angle of the object when it's flat, and then once you have no key presses return it to that angle
Cas
14
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 13th Nov 2010 17:15
The code worked great (thanks ) and with a few changes to how much the roll should be it looks good now. But I do have one more problem ...it seems that it doesn't want to roll when going left. I have tried changing some of the numbers but it doesn't do anything. If I comment out the RightKey commands, the plane does roll left but it doesn't want to move across the screen. I'm a little confused to say the least. Any more ideas would be cool and once again thanks very much for the initial help.
Cas
14
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 17th Nov 2010 18:00
Just wondering if anyone could help me at all? I don't really want to starta new thread. I really don't understand why it's happening and also, if I press left & right together my plane rises to the top of the screen.

If anyone can help me with this I could really get going on my game.
Dodga
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 17th Nov 2010 22:00
Can you include all your game media and I'll solve it?
Cas
14
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 18th Nov 2010 18:28
Here's the code that's used for making the plane move.
DeadTomGC
14
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 20th Nov 2010 22:53
I'll see what I can do.

[url="http://www.armchairempire.com/"][/url]
Cas
14
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 21st Nov 2010 13:19
Cheers
DeadTomGC
14
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 23rd Nov 2010 05:45 Edited at: 23rd Nov 2010 05:46
Well, I hope you think that it has been worth the wait. I am putting the finishing touches on the program setup now. I altered the program to fully control the airplane and 3rd person camera while always moving the plane forward. WILL POST CODE SOON.

uuhh... yah...
Cas
14
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 23rd Nov 2010 12:05
Sounds good to me ^_^

If there is something that I don't understand how you did it could I get in touch with you to ask how it was done?
DeadTomGC
14
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 23rd Nov 2010 19:21 Edited at: 23rd Nov 2010 19:32
Sure, every post on this thread goes to my mailback address.
Here is a program that uses the same object as the one you were using where all the code for the movement of the camera and the object are in a function. Note, to make my coding easier I used camera 0.

This code allows you to use an xbox 360 controller in the program.
I won't be able to connect to the internet for awhile so I won't be able put one up that uses the mouse and keys. However, You could modify the code to use the keys if you replace the dbjoystick comands with the arrow keys.

uuhh... yah...
DeadTomGC
14
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 24th Nov 2010 14:58
Here is more complete code that lets you use the mouse, keyboard, and xbox controller all at one time, and it lets you toggle between views,fixed or moving.


uuhh... yah...

Login to post a reply

Server time is: 2024-11-19 16:40:14
Your offset time is: 2024-11-19 16:40:14