R0J0hound's Forum Posts

  • Cool.

  • I did understand it. You want a seeded random number generator.

    These are the three plugins that can do a seeded random:

    viewtopic.php?t=93998&start=0

    viewtopic.php?t=63543&start=0

    viewtopic.php?t=76204&start=0

    And btw here is where you go to find a list of all the plugins:

    c2-plugins-and-behaviors-list_t65170

    If you wan to do it yourself the simplest way is this:

    https://en.wikipedia.org/wiki/Linear_co ... _generator

    Wikipedia also lists other methods here if you're curious:

    https://en.wikipedia.org/wiki/Random_nu ... al_methods

  • SoldjahBoy

    You can do that with the zeropad() expression.

    int(number)&"."&zeropad(int(number*100)%100, 2)

    That only works for positive numbers though. For negative numbers make it positive first, then add a minus sign after. Using a function would be useful in this case.

    Or if you add the browser object to your project you can do it with js:

    Browser.ExecJS(number&".toFixed(2)")

  • You could try moving each piece left by 100*sin(self.angle) pixels or something. You'll probably want to tweak 100 till it looks right.

    Here's the general idea below. If there are still gaps increase 100 to something bigger.

    global number prevAngle=0

    global number prevX=0

    global number prevY=240

    global number turn=0

    start of layout

    repeat 10 times

    set turn to random(-10,10)

    create tiledbg at (tiledbg.x, tiledbg.y)

    tiledbg: set angle to prevAngle+turn

    tiledbg: move tiledbg.width-100*sin(turn) pixels at prevAngle degrees

    set prevAngle to tiledbg.angle

    set prevX to tiledbg.x

    set prevY to tiledbg.y

  • You could use two for loops to check each tile in the tilemap. Then just check the tiles around it if it's a water tile.

    There's an old example of grid based water here:

  • Two ideas come to mind. One is to use the third party noise plugin. With it you can set a seed and get random values over a grid with perlin noise.

    The second idea is to use a random number generator. A simple one is rather easy to write but the quality won't be there. More complex ones will give better values.

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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"?