R0J0hound's Recent Forum Activity

  • The simplest way would be to use the Browser.execJS() expression.

  • For saving and loading with NWjs I like to setup a variable "appPath" to specify where to load from. If I'm previewing I set it to a fixed location on my computer and if it's an export I set it to the same folder as the exe with nwjs.appfolder.

    global text appPath="C:\tmp\"
    
    Start of layout
    system: [inverted] is in preview
    

    set appPath to NWjs.AppFolder[/code:7sh25o66]

    So after that you can specify your files as appPath&"filename.txt"

    Now you could use xml, ini, json or any other format you can come up with but by far the simplest would be to use C2's save state feature. When you use the save action you can then get SaveStateJSON "on save complete" and either write it to a file or save it to the "local storage" object. Loading in turn can be done with the "load from json" action.

  • laypax

    Without families you'll have to be much more verbose with your events. Like for instance setting a variable to a random integer (ex: int(random(5))) and then check it's value. For ex: if var=0 then create health, if var=1 then create powerup, ... etc

  • That plugin is to load files from a website or from the project's files folder. If you want to run javascript you could use the browser plugin's execJs action, but it just runs some code and it doesn't interact with the rest of c2. The sdk is ideal to do that as Ashley said.

  • An offset is just a position relative to something else. It could be some thing as simple as your left eye is two inches to the left of your right eye. It's use in that capx would depend on what the capx is doing specifically.

    Usually to do drag n drop in C2 you just use the dragdrop behavior unless you have a good reason not to.

  • A midpoint is just this: (a+b)/2

    So for touch it would look like this. I don't think that was the correct syntax for touch but you should get the idea.

    midx = (touch(0).x+touch(1).x)/2

    midy = (touch(0).y+touch(1).y)/2

  • You could I guess if you could figure out what the minifier renamed cocoonlazyload to, but that's not really possible. Also yes you can find a few js minifiers online to do it later I suppose.

  • Thanks Little Stain

    Can you please give me the link for that Plugin and if possible some documentation to implement that plugin so that i can test that in my game.

    The quickest way to find it is to use the forum search and search for "svg"

    Just scroll down till you see a topic with "[PLUGIN]". To use it, presumably that topic will have some documentation, although I doubt it's just a simple matter of replacing sprites with svg.

    Also I second immortalx's idea, it's much simpler.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • socialpilgrim

    I don't use mobile export at all so I can't test. It should work though, since a html5 canvas' are the most basic things that should work everywhere, and the plugin does nothing unique with it. Does any drawing work at all? Does it work with "webgl off"?

  • Fengist

    It doesn't crash for me either, and I'm not sure why you'd be running into a memory limit with asm.js in your capx.

    One thing that does stand out is sprite3 is animated. The physics engine has to re-calculate the collision polygon every time the frame changes, which I guess may be using up memory. Often what I do is create an invisible second object with one frame to handle the physics, and then remove physics from the animated object and pin it to the other object.

    Also you can avoid the memory limit entirely by changing "project properties"->"Physics engine" from "asm.js box2d" to "box2d web". The only difference is the performance may not be as good.

  • Actually picking is as efficient as looping over all the tiles, since each tile would need to be looked at to see if it should be picked. But like eliasfrost said you don't have to loop over all the tiles only the ones the player is overlapping.

    Link with examples to look at only overlapping tiles:

    Alternatively you could use just sprites instead of the tilemap to be able to do picking.

  • Sounds like the file is corrupted, and from what I've seen that means anything beyond that point in the file is gone. Cap files contain info in this order "layout", "animations", "images"... But if the file is corrupted beyond that point the only real thing you may be able to recover is images up to that point. If you post a link to your cap file I can see what images can be recovered.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound