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 / Move Object in C++

Author
Message
DarkDISCUSSION
8
Years of Service
User Offline
Joined: 6th Jul 2011
Location: Ft Madison, IA
Posted: 28th May 2012 01:35
Hello,

How can I move an object in GDK? If and Then statements do not work. I have this 'small' code but I want to make the cube move when i press down on a key. How can I do this?

Please Help Me!

Code like an indie who is a brain sucking troll that even superman cannot step away from his code to save you!
Mr Bigglesworth
11
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 28th May 2012 01:50


That will move object 3 forward when you press and hold the W key.
DarkDISCUSSION
8
Years of Service
User Offline
Joined: 6th Jul 2011
Location: Ft Madison, IA
Posted: 28th May 2012 02:44 Edited at: 28th May 2012 03:51
doesn't look so difficult, Thanks for your help!

Okay now it's not so easy

What am I not doing?
Mr Bigglesworth
11
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 28th May 2012 05:32
What is not working?
DarkDISCUSSION
8
Years of Service
User Offline
Joined: 6th Jul 2011
Location: Ft Madison, IA
Posted: 29th May 2012 00:32 Edited at: 29th May 2012 00:33
Sorry, I am very new to C++ and have little to no experience with it. What I mean is that the code I had posted above doesn't compile. I think I should create one of those Void loop things. How can I do this? I am so confused with this but need the speed of C++.

Here is the code again
Mr Bigglesworth
11
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 29th May 2012 07:48
What is the error it says when it fails to compile. I reccomend working your way through these: http://www.cplusplus.com/doc/tutorial/
prasoc
11
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 29th May 2012 12:51 Edited at: 30th May 2012 18:24
Try replacing



With




DarkDISCUSSION
8
Years of Service
User Offline
Joined: 6th Jul 2011
Location: Ft Madison, IA
Posted: 29th May 2012 21:20
Great works now!
Many thanks prasoc!
Mr Bigglesworth
11
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 29th May 2012 23:51
Crap, I didn't remember that, me not using GDK for a while is starting to show

Login to post a reply

Server time is: 2019-11-17 20:35:51
Your offset time is: 2019-11-17 20:35:51