|
| 18 Dec 2013 06:26 AM |
Before I begin I want to mention that I am ENET and I bought a name change- just so some of you will know who I am. I have been inactive a lot here lately, but after playing some call of duty and realizing there isn't a game that is real similar to it on roblox yet, I decided I would make my own PvP shoot 'em up game.
One thing when deciding to build my game is how to have all the scripts run together without having to write a script communication center or having to make a way for global and client scripts communicate or having the server trying to tell every client what to do. So what I decided to do after reading what MVC really is, was to try to utilize it in my game.
There is a model in the game representing all game data. This data consists of a bunch of int values and bool values representing the game map, mode, can guns be shot, game messages to display, etc...
I particularly find that the layout I had chosen was superior to any other way I could have done it because it has made it so easy creating guis that just display the data from the server.
If anyone else could discuss what they like about the MVC layout of programming please let me know...
* MVC - Model View Controller |
|
|
| Report Abuse |
|
|
Charl3s7
|
  |
| Joined: 07 Dec 2007 |
| Total Posts: 4146 |
|
|
| 18 Dec 2013 06:33 AM |
I use MVC formats for all the frameworks I make for the web. Views are templates, controllers process the pages, and models for each object that is used throughout the website, such as a database connection.
The way I set up my urls would be like: domain.com/Controller/Argument/Argument/Argument/...
So index.php would load Controller and pass in all the arguments to it.
class Index extends Template { public function __construct($args) { $this->load('top'); $this->write('hello world ' . implode("\n", $arg)); $this->load('bottom'); } }
(Template would be a model) It's a nice way to have organized code.
I've never tried it for a game so I'm not sure how much any input from me would help. |
|
|
| Report Abuse |
|
|
|
| 19 Dec 2013 07:36 AM |
| I'm not really asking for input, as much as I am on discussing how you individually per person make a game interact locally, server-wide, and server-client. |
|
|
| Report Abuse |
|
|