Jump to content

Search the Community

Showing results for tags 'mediators'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. 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(this.game) //init big daddy controller this.whackAMole.start()}update: function(){ //nothing.. phaser is doing all the game loop stuff, my game is totally event based}
×
×
  • Create New...