开发者

Comments on my design v3

Well, after taking into consideration all the helpful comments I got on v1 and v2 of my class diagram for the space invader game, I updated my class diagram once again to implement all the changes.

With no further ado, I present v3:

Comments on my design v3

The Move and Update methods in the abstract Bullet class are doing nothing, the implementations of the methods are in the concrete classes that inherit from bullet. Each of these concrete classes will also inherit the Speed property from the IMovable interface, and each will have their own speed set. The whole abstract Bullet class and their concrete class derivatives is the strategy pattern.

Some things I want to ask: The Ship and Invader class can only have one bullet at a time - but the Invader class can also have no bullets. This is e.g. when all the rows of aliens are still intact, then only the first row of aliens can fire bullets. The rows above them are not able to shoot. But how would I implem开发者_Python百科ent this in the Invader class? Should the bullet variable in the Invader class of the invaders who are not able to shoot be set or left to null? Or is there a better option?

I hope I am getting closer and closer to getting the right design, all your comments are welcome!


Looks like the whole design could be collapsed to the following abstraction:

Comments on my design v3

I'm not sure if it's enough to reason about your game implementation. Duke Nukem 3D is also collection of sprites with some kind of composition relationship between them. Does it mean you have the same design as Duke Nukem 3D? I personally feel the diagram lacks completion and clarity. What about "game board"? How does it interact with Sprites? What about physics engine?

Just leaving you with some food for thought. Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜