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 / Another OOP

Author
Message
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 6th Aug 2008 21:41
Yehaaa.... now my code is readable



I still have a looong way to have all OOP'ed, but Im learning

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 7th Aug 2008 03:27
I really dont understand the point behind OOP for GDK. Oh well thats just me though.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 7th Aug 2008 05:27
Quote: "I really dont understand the point behind OOP for GDK. Oh well thats just me though."


And I see every reason for it. OOP allows you to better organize the data for sprites and 3D objects. If you have dozens of objects on the screen would you like to maintain several arrays to handle the various attributes or one container per object to keep things straight? And when you develop classes to handle what the objects can do it's reusable and extensible (by inheritance.)

I've developed classes for Sprites, Images, Bitmaps, Mouse and Sound. I haven't released them because they're not completely tested, but for me they're usable and after having developed them for one game I'm working on (sporatically) they made it easier to get started on yet another game which is progressing a a reasonable clip. The Mouse class in particular has really made it easy to handle transitional states and work around some of the failings inherent in the GDK functions.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 7th Aug 2008 08:42
Neat.

You don't have to do this though:


Just this will do:



And I agree with Lilith.

Don't you just hate that Zotoaster guy?
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 7th Aug 2008 09:32
Zotoaster - Nice... thanks

david - The idea about an OOP is that the code is more readable and its also faster for you to type. Its impossible to remember all commands and then its more easy to use objects.

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.

Login to post a reply

Server time is: 2024-09-30 03:32:49
Your offset time is: 2024-09-30 03:32:49