Domain Model Programming on plugins

For developers using the Construct 2 Javascript SDK

Post » Thu Jul 25, 2013 2:47 pm

I'm new to construct 2, it seems to be very good for easily creating games.
I've started doing a game in android using java, and decided to give it a try, to make my graphical life easier.
I'm a developer, and used to working with an object oriented approach, I already have my domain model set up in java classes, with custom business logic and interactions there.
I was thinking on porting this to construct but without re-doing everything with the event system, I think that'd be too complex and also wouldn't want to do it like that, for me it's much cleaner and maintainable the way it is right now
What's the normal way of doing this? I was thinking that maybe I can create a custom plugin, then create javascript classes and objects there, and finally when I need to communicate with Construct (to show something visual for example), can use instance variables in the plugin to do so.
Is this a correct way of doing it in this platform, or there's another way? thanks for your help!
B
3
Posts: 2
Reputation: 179

Post » Thu Jul 25, 2013 3:12 pm

It's better just to make everything in the event system, if you can. It requires a fairly significantly different way of thinking to traditional programming, but you'll get used to it.
Scirra Founder
B
386
S
229
G
87
Posts: 24,207
Reputation: 191,742

Post » Fri Jul 26, 2013 11:22 am

Hi Ashley, I understand that the event system is the main asset of Construct2, and therefore the "normal" way of doing things here, but in my case the game is a simulation, and relies heavily on object interactions. Believe me, it'd be a nightmare to implement that using the event based system, not to say that it'd become unmaintainable. THat's why I'm asking how to get the best from both worlds, from one part the flexibility to handle the UI / graphical part from Construct and the power of being able to code behind.
B
3
Posts: 2
Reputation: 179

Post » Fri Feb 07, 2014 6:51 am

HI Sephrag,

Did you in the end go with Construct2, and managed to get both world working. Perhaps the way to go is to make more heavy use of javascript and use C2 as a "thin" UI interface.

If you can events firing in javascript or get functions in javascript called as actions.

I don't know enough api dev. just yet, but thats one thing that came to my mind.
B
8
S
4
G
1
Posts: 205
Reputation: 1,354


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests