Re: Object Orientation And Game Programming Question

  • From: "E.J. Zufelt" <lists@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Mon, 27 Sep 2010 13:47:40 -0400

Let me add my 2 cents, because I love objects and am procrastinating.

1. A field should be able to contain players.

2. A player should have location as a state.

3. A player's location will need to be a region (field, bench, etc).

4. If player is on field then they need to be in one of the locations of the 
field (field object should provide its bounds to user object)

5. When user attempts to move to new location on field it must ask field for 
permission to move to make sure it is possible (not occupied).

6. If location on field is occupied (have fun figuring out who gets to win the 
battle for the location)



Everett Zufelt
http://zufelt.ca

Follow me on Twitter
http://twitter.com/ezufelt

View my LinkedIn Profile
http://www.linkedin.com/in/ezufelt



On 2010-09-27, at 1:32 PM, QuentinC wrote:

> Hello,
> I think you should do it as logical and as similar to the real life as 
> possible.
> IN the real life, the player knows only where he is
> In a player perspective, if he want to get informations about other players, 
> he should ask his environment. IN this case, the field.
>  
> In its side, a field should know who are on it, to be able to give 
> information to the players.
>  
> You have a bidirectionnal association.
> One side of the association may be useless, depending on the situation, it's 
> impossible to tell you without a more precise example. It depends on what a 
> player can do with the field, and what the field can do with the players. IN 
> the football example, the field would probably be just a container which can 
> only let players enter and exit and allow to iterate through the players who 
> are in game.
>  

Other related posts: