structuring code when targeting both mobile and Kinect devices - actionscript-3

Building several games using Starling and the AIRKinect framework targeting Windows Kinect sensors.
I'd like to package and refactor my classes in such a way that I can easily repurpose the bulk of the code and target mobile(primarily IOS) devices.
ie touch and multitouch support would replace any AIRKinect specific skeletal tracking code.
Although I 'm coding in Actionscript 3, I think the same general code structure should remain code agnostic.
What would be a good way to structure my classes?
Which design patterns come to mind?

Basically, you could create an interface, like IController and several platform-dependent classes that implement that interface, for example KinectController and TouchController. Then you could check system capabilities at runtime and create either KinectController or TouchController. The usage won`t depent on concrete class as both would implement IController.
That's a very basic answer but I just cannot answer more specifically as I don`t know anything more about your project.

Related

Is there a tool to convert wxWidgets XRC files to HTML?

I have an application with tons of windows (frames and dialogs) made with wxWidgets XRC. I'm preparing to convert all generated screens to HTML to make an web version, before doing it I would like to know if someone knows a tool for doing so, convert XRC resource to a bunch of DIVs, INPUTs, CHECKBOXes, TABLEs, etc., so I don't need to reinvent the wheel :)
To the best of my knowledge, no such tool exists and, to be honest, I have trouble understanding how one could be written considering that:
wxWidgets layout model based on sizers is very different from the typical layout models used on the web, so you would need to find a way to reimplement it in CSS first.
wxWidgets provides a much richer set of widgets than standard HTML, so you would also need to have a JavaScript library implementing many of them.

Is it actually possible to create a HTML5 game from scratch without any game frameworks, and have it run on the browser of any or most mobile devices?

please go easy on me when contributing to my question :)
Is it actually possible to create a HTML5 game from scratch without using any sort of game framework, and have it run on the browser of any or most mobile devices?
I have looked at many HTML5 game frameworks, Limejs and more, but I do not prefer to use a game framework of any kind.
For reasons that I prefer to have 100% control over my software without any rd party contribution integrated.
I just am curious whether a pure HTML5 html5, css and js project will be able to run on most or any user mobile devices, without getting into having to learning the Android or IOS frameworks.
I have previously been developing a game engine in pure Java with the more or less deprecated swing API, but I'm considering moving my efforts to HTML5 as I see alot of growth there.
I prefer to code everything from ground up. The game State, animation, collision, dialogue, every individual component such as I did with my Java swing game engine previously worked on.
Thanks.
Yes it is.
I've done a few html5, all have been done without the use of any framework.
its actually easier to develop games from scratch in html5 than it is in other programming languages, because you have certain features: like canvas, creating images, drawing arc, font manipulation.
In other languages, like C/C++, pascal etc. graphic/animation/ or video primitives are not part of the language, so you would have to either build the library or use a 3rd party library.
Not the case with HTML5. a lot of the tools needed to make games are part of html5.

Flex to HTML5 - what for presentation layer (canvas, div, ???)

My question is about migration from Flex3 to HTML5. I want do migrate myself not application actually. The question is, what direction is the best and most similar to flex knowledge. Maybe I will reimplement some custom components I already have in my flex library. I think that some of useful flex components I will have to implement myself in HTML5 - e.g. AdvancedDataGrid or Tree.
Now I can see 2 possibilities:
assume page (or big DIV) as application master class, and implement
other components based on extending DIV functionality - and placing
DIV in DIV in DIV - like AS3 uses UIComponent. It gives me supported
by browser environment event handling or DIV movement and redrawing
etc.
assume one CANVAS component as application master class. Build own
classes tree with owner drawing control etc. I think i will need to
implement event handling & dispatching for my internal visual
components. Also all UI actions (like moving, redrawing) I need to
implement myself.
I assume, that I will start to build my own class/component library for long-term future use. Question is what is better for knowledge and work investing?
It will be good to know wide opinion on this problem.
Can you give yours here?
From experience, we can say that writing a DataGrid component is a VERY large undertaking. We've been working on our DataGrid components for 3 years now, and we're STILL adding features. Instead of writing your own ADG like component, you should consider JS frameworks. Below are some:
DOJO (Excellent framework for RIA Enterprise App Development, and
Free!)
Sencha (Pretty good, but commercial)
JQuery (Very popular, but highly fragmented).
Each of these come with their own grid component. Senchas grid is pretty good, but so are some jquery grids. See this for example: Best dynamic JavaScript/JQuery Grid
Bottom line, dont reinvent the wheel. There are many excellent paid and free versions out there, pick one that works for you and run with it.
Disclaimer: I am author of Web Atoms JS
Web Atoms JS was built to bring all concepts of Flex, Silverlight and XUL. And each of these technologies used more of XML markup for very high level UI controls. Screens become complex and visualizing them becomes painful when it keeps on changing.
With Web Atoms you will write for less code then any of other frameworks. Web Atoms comes with all basic flex Components & more are coming.
This is a Sample of what all things are possible in Web Atoms JS.
Here is link to documentation.
http://webatomsjs.neurospeech.com/docs

HTML5/CSS3-like equivalent for software UI design?

I like the flexibility that HTML5/CSS3 offers me when I build user interfaces for the web. These technologies let me create rich website prototypes fairly quickly and, unlike on the desktop, I can skin UI elements such as buttons with ease.
So far I have not been able to replicate this experience on the desktop. Over the course of a couple of years I've worked with Visual C#, Qt (with Qt Creator) and Java Swing, but all require more work for the same design tasks.
Is there a GUI toolkit, possibly combined with an IDE that has UI designing abilities, that can replicate the ease and flexibility of the HTML5/CSS3 experience? Is there perhaps a way to apply CSS-like rules to C#, Qt, Java Swing or other GUIs?
For HTML5 / CSS3 UI Designing i have been using kendoui and twitter bootstrap
WPF (windows presentation foundation) is a possibility. This is new in .net 3.5. It doesn't use HTML5/CSS. But it's the closest thing that comes to mind to what you are describing. I will mention what I know, which honestly is not much.
I know it does NOT use HTML5/CSS, but the technique for structuring an application is similar in that you create your UI using an XML like structure (XAML as they call it). And this separates your UI from backend code similar to how you would structure a website.
Using WPF, you have the ability to utilize the power of directx to give your applications media, a skinnable user interface, 3D animations, and screen transitions, etc. In short, I know it allows you to customize the UI far greater than a typical windows forms application that would be developed using the .net framework.
Here is an example screenshot of a WPF application...
If this is something you haven't researched, I think it would be worth checking out. Hope this is helpful.

How best to implement Drag & Drop in MSIE? And what's the oldest MSIE which supports it?

I'm looking to implement drag & drop in MSIE (must be, a bonus for other browsers, but just "nice to have").
I'm looking at a sort of drawing package - let's say flowcharts for example. The user can drag flowchart elements from a palette and position them in the browser. When complete, I will need to know the type and position of each element, probably some other data too.
Can this be done? If so, what's the most powerful technology to do so? HTML 5? Ajax? JS? Something else?
Short version: I would recommend JQuery UI (A javascript framework), this will make your life easier. As for other components, you are free to stack it up from server-side to client-side components depending on your needs and most of the times depending on your preferences.
[update] The long version: Personally, if I would start a useful website with a back-end, I would use Java as my PL of choice since I'm familiar with it, SQL for my persistence, and make it a Web 2.0 site, like what you want to achieve which is a rich internet application (drag and drop, dynamic content, etc). I would normally make use of Java (JSP, Servlets) but use Grails framework (Groovy, GSP, Groovlets), SQL DB (like MySQL, SqlLite, etc), Ajax, HTML, CSS, Javascript (JQuery as my JS framework). Eclipse would be my IDE to program and integrate all of these components.
Some people would prefer to use Python, others PHP, some .NET, Ruby on Rails, etc. Like what I said, it is very subjective. If you already have a field of expertise, then I suggest you stick with it, but if you are starting from scratch, it's basically a choice of the easiest learning curve for you because different Programming Languages can and will satisfy your needs.
For the front-end you have Flash, Applets / JavaFX, Javascript, etc. The problems with Flash, Applets or other embedded media are 1) heavy on resources 2) compatibility, but the clear advantage is that they are more robust because you can do so much more with these technologies in arguably a smaller amount of time. But if you want to use one of these, you have to seriously think about your target audience e.g. for Flash, iPad and iPhones cannot display them at all (except if you installed the unofficial "frash" which supports a bit of flash content).
I believe what you want to do is highly feasible even if you just use Javascript, and again, I will strongly recommend that you use a framework that can readily satisfy your needs (like drag and drop) so that 1) you'd worry less about cross-browser compatibilities, 2) you won't have to reimplement them and 3) fix many unexpected bugs along the way. But this is the general idea if you are developing a software, if the framework or library already exists, use it (just be extra careful with licensing though but this is another topic) :)
disclaimer: rum + coke = awesome
use javascript, that's all you should need to have drag n drop for elements. for example : http://flowchart.com/demo/