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

Login with username, password and session length
 
   Home   Help Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Game Logic  (Read 1561 times)
listentorick
Newbie
*
Offline Offline

Posts: 6


View Profile
« on: 2007/06/04 07:32:58 »

Where are you guys placing you game logic for controlling the rotation/position of your models?

Does anybody have an example class I could take a look at?

I'm really stuck with this!

Are you overriding the renderChildren method?

I would really appreciate any help - I'm not getting anywhere at the moment!
Logged
listentorick
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #1 on: 2007/06/04 07:39:20 »

I'm considering adding the following events:

PreRender
PreRenderChildren
Rendered

So that I can do the following

public class Planet {
private _model;

public Planet (IModel model) {

this._model = model;
//register the Model with the scene

//Add event Handler

this._model.Prerender+= etc etc


}

}

Thoughts?

Note that I've created interfaces for the original HMModel so that I can use Inversion of Control.
Logged
Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« Reply #2 on: 2007/06/06 00:26:55 »

Generally you keep a reference to the player's object, thats the only one you keep a reference to, then you can manipulate that in your base update method, or you could create a special player object which has got a different update method to your other objects that then interprets the controller info, since any class can get that information. Remember, the simpler the thing is, often the more optimised it is and the easier it is to debug. (This does not include calling some super method, that itself has to be optimised to be good)
Logged

Pages: [1]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
how could i create a game engine? General Discussion saAction 7 3810 Last post 2006/08/25 01:45:22
by Kolo
XNA Game Development General Discussion mikeschuld 0 1672 Last post 2006/08/22 10:28:40
by mikeschuld
MOVED: XNA Tutorials :: Game Engine and Game Development :: Tutorial 1 Hazy Mind 3D Engine mikeschuld 0 2365 Last post 2006/10/30 21:35:32
by mikeschuld
New XNA Game General Discussion YellowShadow 5 2325 Last post 2007/04/25 22:10:09
by XNASorcerer
Old but greate game General Discussion parc 1 1460 Last post 2007/03/27 05:25:08
by DaphydTheBard
My first 3D game - Good Vs. Evil Show Off Board EclipsE 6 3356 Last post 2007/03/29 07:00:17
by EclipsE
Old game review General Discussion sempre 1 1380 Last post 2007/05/18 05:38:17
by Nemo Krad
game design first General Discussion thecorpament 3 2204 Last post 2007/08/13 23:57:38
by mikeschuld
WOW GAME General Discussion priya 2 2564 Last post 2008/06/26 12:36:43
by h4rdc0m
Game Audio Forum Requests beatle-jan 1 2418 Last post 2011/04/30 10:06:09
by gunther6616
Can you use a Card Layout on Game Panels? General Discussion nicky123 1 1801 Last post 2009/06/02 11:44:45
by mikeschuld
C# Mobile Game Development General Discussion nicky123 0 1627 Last post 2009/06/01 01:54:58
by nicky123
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.357 seconds with 19 queries.