Developing for Android (or anything) using Construct 1!!!

0 favourites
  • 9 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • I've found a way to translate a cap file to Java very, very quickly. it requires some programming know how, and some initial setup time, but once that's over, damn it's fast. and anyone confident in their language of choice can do it. but first a little background info:

    So, I was using Construct to prototype my ideas for my Android game, especially because it uses procedural animation exclusively, which requires alot of trial and error. I wanted the process to be as painless as possible, so I created java functions for all the construct functionality I'd need.

    I have a 'sprite' class, with a 'move to position' function, a 'set angle towards' function, etc

    I've got lerp.. basically every object type I'll be using I made a java equivalent class, and every action/condition/expression also has a java equivalent.

    Then I discovered that you can right click on a construct event, and "copy as text".

    if you set up your java classes to be as much like construct objects as possible, you can just copy/paste into something like notepad++, and then completely convert it to java using the same set of find/replace commands each time. The whole process of converting from cap file to java takes about 1 minute 30 seconds (because you have to copy/paste, etc). After I setup a macro to automate it, I'd say it'll probably take about 15 to 30 seconds to convert from cap file to java. in short, again, Construct is awesome always, now and forever, and ever has been.

  • Oh that's just sick.

    You sicko.

    How do you even come up with this stuff? I told you to go program something, I didn't mean to become an instant show-off.

    ~Sol

  • oh here goes soldjah boy, showing up just long enough to say something stupid.

    totally kidding sol. yeah, thanks again soljah, for suggesting I try plugin development again, you changed my life. if I become a millionaire developing mobile games, I owe you beer, or a joint, whatever you weirdos do over there.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Wow, that's awesome lucid. Post a video of your game running on android, I want to see this.

  • Mmm... I'm not persuaded this will work for complicated games though! You'd have to basically reinvent most of the runtime in Java. As you already point out, you have to write Construct-themed routines to be able to paste in, and that's the beginning of reinventing the engine.

  • DUDE... awesome.

    Hmm... I wonder if there's some way to automate this a bit more. What exactly does the event exporter do? Could it be made to export to java code that could then use that engine to plug in to?

    Or... is there some way that upon exporting, the java engine could be used like the directx engine at runtime, merely using the java one instead? And does it matter if he's basically creating a new runtime?

  • What exactly does the event exporter do?

    <img src="http://dl.dropbox.com/u/1013446/simpleevent.PNG">

    converts to this:

    + MouseKeyboard: On Left mouse button Clicked
    -> Sprite: Set position to mousex, mousey[/code:d4q1ub3z]
    which after a few find/replaces (and I confess I forgot I have to manually add { }'s and ;'s until I learn to use the expression based find/replace in notepad++, but my time estimates remain the same) could be converted to this:
    if (screentouched())
    {
       sprite.setpositionto(touchx,touchy);
    }
    
    

    Hmm... I wonder if there's some way to automate this a bit more. Could it be made to export to java code that could then use that engine to plug in to?

    I don't think a plugin can be made to access the cap the way the Copy as Text function does. I was in the middle of asking this question earlier when the forums went down. But someone in chat recommended Autohotkey, which will automate most of it.

    Or... is there some way that upon exporting, the java engine could be used like the directx engine at runtime, merely using the java one instead?

    I don't think it's possible without rewriting construct itself, but construct 2 will be able to do things like this, according to ash.

    Mmm... I'm not persuaded this will work for complicated games though! You'd have to basically reinvent most of the runtime in Java. As you already point out, you have to write Construct-themed routines to be able to paste in, and that's the beginning of reinventing the engine.

    in some respects the game I'm working on is complicated: here's a typical event:

    <img src="http://dl.dropbox.com/u/1013446/exampleofcode.PNG">

    which was converted using the copypaste technique and works exactly as it does in construct.

    I agree that I'm basically writing a java/android runtime, but that's something I wanted to do anyway.(quote="arima"And does it matter if he's basically creating a new runtime? ) As stated earlier, you have to understand the language enough to create the classes, so it's definitely not a way for someone squeamish about coding to 'export to everything'.

    But I think we can all agree that construct is a much better tool for rapid prototyping than java, or objective-c is. Java and the android plugin is definitely not a gamemaker, and I needed to write code to move and track sprites, simplify and manage touch data, and for this game in particular, I needed the equivalent of imagepoints and hotspots. After prototyping in construct, it made sense to make those classes mirror those in construct to minimize the effort required to port the finished prototype. I had no idea there was a "copy to text" function, it was just dumb luck I stumbled upon it.

    After importing the images, and setting them into my sprite class and initializing their hotspots, and imagepoints, I have to say, at this point I'm literally not writing any java code. I'll probably have to code some java again before the end, but as of now, I'm making this game in construct, and copy-pasting it to java. so like it or not, Ash, your tool is once again reaching beyond it's original boundaries. There are things that would have never been tweaked to their current level of perfection this early in the development process or even later for that matter, if construct didn't make it so fast and easy to mess up, and try again.

    Wow, that's awesome lucid. Post a video of your game running on android, I want to see this.

    I will definitely do so once it's further along. I'll post a side by side comparison, it's really neat to see the tiny exact replica responding to touch instead of mouse movements. Luckily, I designed this game as a mobile game meant to be enjoyed in short doses, so it's not one of my typical Towers of Babylon projects that are more suited to teams of thousands.

    I predict a late summer release for the android version, and a simultaneous (thank you spellcheck) windows release if Steam will have me

  • Seems to me that just like I suggested in your thread about find and replace, you could also use Construct to make an app to set up your Java... that works like Construct.

  • Seems to me that just like I suggested in your thread about find and replace, you could also use Construct to make an app to set up your Java... that works like Construct.

    definitely, but looking back at the infinite wake of my unfinished projects, if I've learned anything, it's that unless it's your fulltime job, or you don't have one, working on an editor instead of a game should only be done if absolutely necessary, at least that's the case for me

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)