Forums Register Login

Basic Java Game & "MVC"

+Pie Number of slices to send: Send
I have been assigned a task for a university course. I would ask the tutor such questions normally but in the UK we are suffering a bit of bad weather and I can't get in. It's also a new course so i'm unsure who to email. However, my problem.....

We have been asked to code a game, which I have done. I don't know what it's called but you have a grid of symbols (in this case coins four tall, four wide). When you click one coin, it is flipped along with those to the top, bottom, left and right. If anyone of familiar with the electronic toy "Lights out" from a few years back, its like that. The game ends when all the coins have been reversed

I am now required to code an undo function, detection of completion, the ability to chose "challenges" via a web service and keep record of all the previous moves. I can figure all this out. However it says to follow "MVC" closely? I searched for this and the only thing which fits in this case is "Model-View-Controller" which I have no experience with

Has anyone got any hints how to follow such guidelines with such a small project?

Many thanks in advance.
+Pie Number of slices to send: Send
In brief,

This is an architecture to follow while programming,

In an MVC app, the following 3 sections of app are kept seperate:

1. Model : Mainly data, how data is saved in the application. (eg: how you are saving the state of the coins true/false, etc.)
2. View: GUI/CUI how are you displaying it to the user. (eg: the drawing of your board, the coins, etc.)
3. Controller: Interaction with the user. (eg: Handling the user click over a coin, etc. )

you should ideally seperate these logics and not couple them together.
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3247 times.
Similar Threads
False Coin
Solve this puzzle.
Fourteen coins
Confusion between domain model and presentation model
The Machine Game
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:43:20.