mercredi 1 mai 2019

Pattern for game design

I have exam in Java principles and patterns and i have this question for practicing. Could you please help me to understand patterns better. The question is :

Consider the design of a multi-player, interactive, real-time, video network game. In this game, each player can view his or her immediate surroundings in the game’s virtual world, see summary information on the opposing players in the game, and make moves in the game based on this knowledge. If an opposing player enters the field of view, this will be shown visually on the player’s screen. Players can join or depart at any time during the game.As players join, depart, and make moves in the game, the resulting game information must be updated for all current players.

Your job is to design the coordination portion of the game.

1)Select at least TWO design patterns you would apply to solve this problem? Why are they appropriate?

For the updating player i am thinking about Observer pattern since it can notify you when change occurs and i am not shure if it can be used to update player surroundings.Second pattern would be Component for example player actions.

2)Given your choice, provide a class diagram showing the structure and the relationships among the various classes.

Since i am not shure what patterns would i use i don't know what class or sequene diagram would i use

3)Provide a relevant subset of the methods in each class that will convince me that you understand how the pattern applies to this problem.

updatePlayerSurroundings() 
updateEnemyPlayerInformation()
moveForward()
jump()

ect...

4)Give a sequence diagram with two players and whatever other objects are necessary to show what happens when Player#1 makes a move and, as a result, becomes visible to Player#2.

If i am not mistaken this should be updated using observer?

Aucun commentaire:

Enregistrer un commentaire