Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1057070 Posts in 42936 Topics- by 34883 Members - Latest Member: PTlGhOsT

October 24, 2014, 06:47:45 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)[Java] Object/Class Design for Games?
Pages: [1]
Print
Author Topic: [Java] Object/Class Design for Games?  (Read 337 times)
Player Ʒ
Level 10
*****


"Flagrant Errors" is my middle name.


View Profile
« on: May 02, 2013, 07:47:43 PM »

Long story short, I'm trying to figure out what classes I would need to properly keep track of the game.
For example, picking an airplane dogfighting game, using the following classes:

  • Plane - Contains data such as position, rotation, graphic, et cetera.
  • Enemy (extends Plane) - Contains data such as AI and parameters, et cetera.
  • Player (extends Plane) - Contains data such as controls functions, score, et cetera.

Probably a good start on the data itself.
Would there generally be anything else important, like certain rendering classes, sprite loading classes, audio classes, and so on needed?
Logged

Impmaster
Level 10
*****


Scary, isn't it?


View Profile WWW Email
« Reply #1 on: May 02, 2013, 07:53:10 PM »

States, so that you can have a menu, and not have the gameplay code mucking it up.
Logged

Do I need a signature?
soryy708
Level 3
***


Where is my tea?


View Profile Email
« Reply #2 on: May 03, 2013, 04:18:11 AM »

You'd probably require an events polling class, events handling classes (like Input registration), a game logic class (doing all the game mechanics), a renderer (duh), perhaps a scenegraph, a physics thingy, rules class, UI class, state class... You'll need aLOt of classes.
Logged

Portfolio:
  • Cacto Loco! - 'Additional Tunes' (Composer)
  • To be continued...
Maud'Dib Atreides
Level 4
****


Obsessed with space


View Profile WWW Email
« Reply #3 on: May 03, 2013, 05:47:40 PM »

Player 3, you should have collection classes for your more numerous instance objects that will use class states such as >-Hypothetical> SpriteCollection for SpriteClass.

This is useful for record keeping, searching and sorting, selecting, and general management.
Logged

Guy: Give me all of your money.
Chap: You can't talk to me that way, I'M BRITISH!
Guy: Well, You can't talk to me that way, I'm brutish.
Chap: Somebody help me, I'm about to lose 300 pounds!
Guy: Why's that a bad thing?
Chap: I'M BRITISH.
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic