Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Architecture / JavaScript HTML5 Game on: October 26, 2012, 07:24:48
Hello All,

I have been creeping on this forum for the past couple weeks. I'm not a beginner to PureMVC, but I still have some more learning to do. Before I go into my questions, I should probably explain where I am coming from.

Over the past few six months or so i have been gradually iterating my side project, a HTML5 mobile game with PhoneGap. When I first setup the project, the NativeJS port wasn't available and it wasn't Multicore. I ended up using the PrototypeJS port since I was already familiar with classes and inheritance in PrototypeJS. Right now, my project is nearly at BETA. It utilizes the Canvas API in HTML5 and runs very nicely at 60 FPS.

I am looking to do some refactoring and utilize the Multicore NativeJS, and possibly a framework that supports namespacing. I have used Multicore in AS3, but not in Javascript. I also only have experience with using interfaces for Multicore communication, not pipes. OK on to the questions!

#1 - Should I abstract the view rendering of the application to a stand alone core so that I can switch it out as needed (for ex: different rendering cores for different platforms)? For this project my current target is iOS with future support for Android. Since I was using a single core, I ended up doing some dynamic view component loading. Basically I have a ViewProxy that will load in JS files dynamically as needed. For Android targets, I will provide different view components based upon the device resolution. With this approach I could create high-res iPad versions of the app as well that have a completely different layout than other versions.

#2 - Should I also move my game engine to a separate core? I envision this core containing all of the game simulation data and accepting input and other data from the user and pushing events to the display core. Currently the game display objects hold references to the game objects that they need to render and update the location every frame. I am not really using an Entity/Component based system and the scope of this game doesn't really necessitate it. However, if I WERE to use one down the road, I would hope that it would be fairly easy to plug it in when the game is encapsulated from the rest of the system. How the game simulation behaves internally should be of no consequence to the rest of the app.

I know I have more questions but I need to review my code to refresh my memory, so for now these will suffice. Thanks!
Pages: [1]