Search the Community

Showing results for tags 'mvc'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 8 results

  1. Hello! In the age of flash there was a well-known MVC frameworks. A lot of small and big, 2d, event-based games, portals, apps are built upon it. And now flash is almost dead. But the people and companies still has the same needs from that kind of content (games, engines, portals, ..). Our team found a very similar solution PIXI + custom MVC + Typescript. PIXI is so web and we have to maintain PIXI - a problem. 1. What framework should be used to create an event-based game today? Phaser - no. It's big for games without any physics and no onFrameUpdate needs ? 2. Is there out any new framework/approach to build and structure that kind of applications ? 3. Do you have some good ideas at whole? Give more ideas, solutions, best practices on web and etc. Thanks !
  2. I'm looking to continue my 12 year off and on hobby of game development. I'm a professional web developer now, but I have yet to make a web game. I'd like to make things a bit more modular and isolated than my previous work. I think MVC will help. I'd like to have the Model (the game simulation with all game logic, physics, etc.) in it's own web worker. The View would get a feed of basic state information out of it for rendering, camera, audio, etc. The Controller would react to the user and send information back to the Model. The View would have no information to send to the Model. I'm planning strategy games more than twitchy action games, so I think having the Model in a separate web worker, will actually be better for performance. A bit of input lag is more acceptable than a low frame-rate. If the Model -> View communication includes velocities, the frame-rate of the view can even be decoupled from the frame-rate of the Model. Plus if I move to start working on multi-player networking, the Model -> View communication can just be more or less duplicated for Server -> Client My favourite language has always been Python, and I used to loath JavaScript, but the newer ECMAScripts are correcting my biggest gripes, and ultimately I'd really like to work more with Typescript. Finally, I think I'm going for 2D because I'm not working with any 3D animators and my game play ideas are not really enhanced with by a third dimension. So I have a few concerns It seems there's a lot of poor opinions about MVC in games around here, but it seems perfect for strategy games to me. Is my approach really ill founded? I might find myself working against a broader framework like Phaser or Kiwi. Should I just stick Pixi in the View and a physics engine in my Model, or would a broader framework solve more problems than they create for me? It seems like Phaser is the popular choice, but I wonder if perhaps my use of Typescript and MVC might make Kiwi or something else the better choice?
  3. Hello, I've tried a couple different event listeners, to no avail. In a "simple" (i.e. non-ASP.NET) page, it works just fine, engine starts, I can build a scene, no problem. However, when I embed my canvas in an ASP.NET MVC partial, then try and start the engine, I get "WebGL not supported". The script is in the body, renders along with the other partials to Html. Nothing special about that. window.addEventListener('DOMContentLoaded', function() { // get the canvas DOM element var canvas = $("#wizardCanvas"); // load the 3D engine var engine = new BABYLON.Engine(canvas, true); var createScene = function() { // create a basic BJS Scene object var s = new BABYLON.Scene(engine); // connect with partial-provided scene handler (buildScene || (function() {}))(s); return s; }; var scene = createScene(); // run the render loop engine.runRenderLoop(function() { scene.render(); }); // the canvas/window resize event handler window.onresize(function() { engine.resize(); }); }); I've also tried connecting with the onload event. No difference. window.onload(function() { // ... }); Here are my script references, via MVC script "bundles". <script src="/Scripts/jquery-1.10.2.js"></script> <script src="/Scripts/bootstrap.js"></script> <script src="/Scripts/respond.js"></script> <script src="/Scripts/jquery-ui-1.11.4.js"></script> <script src="/Scripts/ExtensionsJS/str-1.0.3.js"></script> <script src="/Scripts/ExtensionsJS/arr-1.0.1.js"></script> <script src="/Scripts/Oimo.js"></script> <script src="/Scripts/babylon.js"></script> <script src="/Scripts/poly2tri.js"></script> <script src="/Scripts/modernizr-2.6.2.js"></script> Is there something about the server-side MVC rendering that is causing problems? And how else would I know that, per se? Actually, I wonder if it is because my script references are in the incorrect order. I'll try that next. Regards, Michael Powell
  4. Probably I could come up with my own solution. Just wanted to know how other Phaser developers solve this problem, i.e separate your game logic from your visual parts in a given Phaser.State? I have this GameScreen which is Phaser.State where the actual game is played. So I add several buttons, background and stuff in create() but at the same time I have to keep track of the game data and logic, what goes where, etc... Are there some code templates for this? Let me know your thoughs.
  5. Hi, I was wondering if anyone had any tips as to how I would go about creating a Single Page Application that could switch out different games. I need to allow the user to play a certain number of rounds of a game of mine, and then switch out to another game after they have played all the rounds. Each game will have 1 file for each state of the game. Generally, Boot, Preloader, MainMenu, Game. I am looking to build it in Angular. I just have a few questions... How should I manage all of the files for each game? I have looked into Require.js. Do I need to load in every file for each game at the beginning or should I load in each game at a time, one after another? How should I manipulate the DOM? When I switch out the games, should I be destroying the canvas element and the pixi instance and whatnot or should I be switching views or something within Angular? Any help is much appreciated. Also, if you're looking to make some money, I'll pay someone to help.
  6. Hello, I have been creating simple online 2d apps for the last few years. I started out in flash and now find myself doing only HTML5 canvas development. Because of my background I am using the createjs library which has really seem so many improvements over the last year and makes the transition to js quite seemless. Phaser is a good looking framework but not all of my projects suit it. I have also been implementing my own MVC design pattern which I had been using in flash. It basically sets up a model and controller as singletons and dispatches events via an eventDispatcher. There are a few things that I am still unsure about starting out a project and I hope to find some of the answers here. By using my MVC approach I have to spend quite a lot of time setting up my project and I am looking at other built frameworks that might help speed this process up. What is the best approach when doing a canvas app? Should all assets be part of the canvas like game overlay screens or should those screen be divs in the HTML that exist above the canvas? I have implemented projects both ways but don't see which is better. Even when implementing my MVC pattern I find that my projects can start to fall over when they get bigger so I have been looking at Backbone and Angular but not sure which framework is better for canvas development. I guess that it the game overlay screens mentioned above are divs then Angular could work. Anyone been there done that? Any and all feedback is welcome, Thanks.
  7. My question:Do you use a plain (but heavily branched) game loop or do you split your game by a principal like MVC or MVP ? Yes I know, I know.. this classical question is related to programming, not to gaming itself. I think I established a really nice and well working architecture in my flash/flex projects. Those projects were something between an App and and a Game as I'm cerating a lot of short termed, microsite like apps und pages (10 to 30 working days) for advertising agencies and there customers. I still create flash projects. But in the past year I've seen myself doing more and more Javascript only projects and as somebody with a flash background of 15 years it was inevitable that I will join the HTML5 gaming community A typical flex project nowadays looks like this:Robotlegs as my application framework Finite state machine (FSM) to carefully manage my transitions between my content screens. Service and Models classes to retrieve and manage any data. Communicate with events between my mediator and my views, and use Signals and Commands to trigger actions in a mediator or a data fetching service class. Four years ago I used PureMVC instead of Robotlegs and before then I used Cairngorm MVC.It always was a battle to organize my code and establish a solid communication between all elements. My flash projects are now fine. It absolutely works for me. But I still battle the code with each new project as the app flow is never the same. I sometimes re-adjust my FSM, sometimes I need no FSM and control everyhting myself in a global 'big daddy' controller. I created so many many many projects with flash & flex. I love JS and I always use Backbone Views & Router to manage my HTML Frontend. I'm programming well tested backends in Rails for two years now. The whole ecosystem I work with is a pleasure. It's fun. Now I dived deep into HTML5 (or more to say JS with Canvas/WebGL) aaaand welcome back in 1999. It's not that I'm struggling with it. But there is a large battle in my mind. Should I use a plain game loop or do it the fancy and OOP'ish way I know from Flash, Rails and my Frontend JS. Of course, I decided to do it the fancy way. And it totally feels like over-engineering my code.I'm currently building a small advertising game. It will run on Facebook and standalone. Nothing complex you and I would say. It's a Whac-A-Mole clone with a totally not mole related story overlayed.There is a Timer, some Levels adjusting the speed and difficulty, some messages presented as an overlay.There is a qualification round, and all the game levels itself. You get a penalty when you miss to hit a mole. Then penalty is shown in an overlay, the timer is paused. At the end you have a highscore in form of a duration you survived before missing too many moles. Easy isn't it ? I can clearly see you guys programming this within hours or days with a simple branching game loop. And what did I ? I havea state machine with 4 states (introduction, qualification, qualification results, competition & results)a bloated game modela levelmanager model (LevelConfig, LevelItem, LevelManager)a player modelan isolated class to manage to the gameplay logic itself (Mole, Whacker, Referee)an overlay controllera view and presenter/mediator for each stageAdditionally to the FMS big daddy controller, where I init my game models(player, game, levelmanager), initializing my mediators with my views, expose some global APIS like (stopGame, restartGame, playMusic) and listening to the FSM to trigger an overlay or change a state in my fat game model.No clear way of communication. Sometimes I listen for changes in my game model,Sometimes I call something via a global saved instance of my bid daddy controler, sometimes I use my global command bus (which is: a globally available event bus) sometimes I listen for a change in my game model. Yeah i's working! It's not finished but in a good progress and I feel good about the result itself. I used Phaser and I'm feeling really happy with it.But can you see it? This is over-engineered!! I hate it! It's like I'm knowing to much about architecture and that I messed it all up. I do not want to do it again in this manner. I can't do it the easy way and switch over to a game loop. My brain is not able to think in a single game loop. I grew up with MVC, with decoupling & events. And that's the reason why I'm asking here you pros: What's the architecture of your small or large games ? Sorry for that long story telling. Thanks for any comment, advice or question!Regards George By the way, my game loop looks like this://a state of Phaser JScreate: function(){ this.whackAMole = new Game.WhackAMoleGame( //init big daddy controller this.whackAMole.start()}update: function(){ //nothing.. phaser is doing all the game loop stuff, my game is totally event based}