XNA Game Development Forums
2012/05/21 19:24:37 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: HMObject design question  (Read 1268 times)
jdowling
Newbie
*
Offline Offline

Posts: 3


View Profile
« on: 2007/05/08 11:10:35 »

So, I've been doing a good bit of reading about game engine designs and specifically one area was the design of the "game object".

Basically I was wondering why the base object was deisgned how it is in this instance rather than just having one object class that contained a number of component objects.

So instead of having a new object type that is a child of HMObject and implements IRenderable why not just have one object (Just HMObject) that has a Renderer as a component.  Logic that depends on if the object is renderable or not could instead check if the Components hash of the object in question contained a Renderer or (depending on implementation) if thisParticularObject.Renderer == null or what not?

EDIT: or alternatively why not make the Model object a new object that contains a "Renderer" object and a "Material" object as well as a "Position" object (position object containing rotation, position, scaling) that kind of thing.
« Last Edit: 2007/05/08 11:22:10 by jdowling » Logged
Tiago
Newbie
*
Offline Offline

Posts: 42


View Profile
« Reply #1 on: 2007/05/11 23:05:38 »

as far as i know its just a design desition, i woulnt do it the way you would tho but our code usually reflects the way we abstract a design in our minds so it woulnt be based on the fact that its better to do it one way or the other but rather on how you designed the inner working of the engine in your head.

there are, of course, some ways of doing things that are better than others based on some criteria. your code might be (a little bit) faster, or more readable, or more component based, but since this particular engine is just for learning purposes it doesnt really matter that much. so, in the end, its just a design desition based on the hazy HazyMind's inner workings.

hope that helps
Logged
Pages: [1]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Question about Getting 2D screen coordinates General Discussion DaphydTheBard 6 2463 Last post 2007/02/27 03:23:36
by DaphydTheBard
Question: Texturing Terrain General Discussion Ashe 1 2340 Last post 2007/03/17 10:28:36
by DaphydTheBard
Array Question General Discussion LucianX 11 3352 Last post 2007/04/13 04:51:19
by Nemo Krad
Tutorial 3 help... new question i believe Hazy Mind XNA Engine hansonc 9 3127 Last post 2007/05/15 01:32:01
by BackwardsBoxers
Question about loading textures General Discussion nicknz 2 1962 Last post 2007/04/23 05:36:17
by EclipsE
tutorial 3 sprite question Hazy Mind 3D Engine precious roy 2 2733 Last post 2009/10/18 08:53:11
by Wekbaite73
FPS question General Discussion XNASorcerer 2 1471 Last post 2007/04/28 15:23:19
by XNASorcerer
game design first General Discussion thecorpament 3 2203 Last post 2007/08/13 23:57:38
by mikeschuld
Thanks And A question Hazy Mind XNA Engine zachaller 3 1567 Last post 2007/06/19 03:36:22
by Nemo Krad
Powered by MySQL Powered by PHP Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.092 seconds with 18 queries.