R0J0hound's Forum Posts

  • tulamide

    Hey that sounds pretty cool.

    megatronx

    I guess he could by generating it on the fly with webauido, but from the sounds of it he's using something else to program directly with a dsp chip on the soundcard.

  • socialpilgrim

    For everything except paste the coordinates to draw at are relative to a unrotated canvas.

    To have the point be the right spot you could use this equation to rotate around the canvas' center by the canvas' angle:

  • If you mean properties for your plugin you can specify the type as integer or float:

    https://www.scirra.com/manual/20/properties

    Otherwise all numbers in javascript are double.

  • I can't open your link. Put spaces in the url or put it in

     tags.
    
    Usually typical random is too noisy to be smooth.  Using perlin noise is one option to have smooth noise.  Another is to generate the noise at a lower resolution and interpolate to a higher resolution.
    
    Squidster's go faster uses the second idea.
    
    For the first you could look here:
    
    It uses the noisejs plugin
  • Presumably you can access and change the collision polygon at runtime with the sdk. Yann's "polygon" plugin changes the collision polygon as I recall. You could reference that for an example.

  • Not really enough details to say why it wouldn't work. Assuming the sprite is in the family like you say and it has that boolean set, it should work.

    That said it may not be pickable yet if it was just created and a toplevel event wasn't reached yet. Is it a sub-event of something?

  • 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.

  • Try Construct 3

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

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