xobust / Project-Broban

ProjInda15 project
5 stars 2 forks source link

Architecture and code design #4

Closed xobust closed 8 years ago

xobust commented 8 years ago

Lets discuss our design approach regarding the architecture of the project

iRobsc commented 8 years ago

http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/ How we could use composition

iRobsc commented 8 years ago

Understanding it https://social.msdn.microsoft.com/Forums/en-US/0b6677dc-3eb6-4eae-9c8f-c042ccbfefb3/what-is-composition-in-c-?forum=csharplanguage

xobust commented 8 years ago

Well this is what I think about when you say that we use composition. dead link removed

iRobsc commented 8 years ago

@macaullyjames

macaullyjames commented 8 years ago

The image link is dead :( If you just drag images into the comment box GH will upload them for you automagically 👍

macaullyjames commented 8 years ago

Ah, found it: composition

iRobsc commented 8 years ago

What do you think?

macaullyjames commented 8 years ago

My advice would be to have a clearer picture of your MVP before thinking about how you're going to implement it, otherwise you're going to do a lot of unnecessary work :) It's hard to tell whether or not it's good design when I don't know what you're designing ^^

macaullyjames commented 8 years ago

Also, make sure your design is firmly rooted in the framework (MonoGame, right?). You can't design the game without taking that into account :)

xobust commented 8 years ago

Well the design problem that I have the hardest time figuring out is how to have the different entities interact in a good way.

Since it is a game you want the player to be able to interact with the state of the world i.e hit a enemy or leave a room. However you don't want to expose the state of the world to the games entities. I have thought about two ways to solve to solve this problem:

macaullyjames commented 8 years ago

It feels like there should be a "standard" way of doing this in MonoGame, what have other people done? :)

xobust commented 8 years ago

This was the only example project I found http://gamedevelopment.tutsplus.com/tutorials/make-a-neon-vector-shooter-in-xna-basic-gameplay--gamedev-9859

xobust commented 8 years ago

Robert and i discussed how we should implement movement of enemies. My idea is that we solve this by using a controller, similar to how we are going to use a controller to detect collisions.

Here is a short explanation about how the controller will work.

So for example the enemy movement controller checks the possition of the GameManager.Player and moves the enemies towards him