R0J0hound's Forum Posts

  • The exponents are calculated with the Math.pow javascript function. Looking here it says for negative bases the result is always Nan when the exponent is less than 1.

    https://developer.mozilla.org/en-US/doc ... s/Math/pow

    It has further links to get into the nitty gritty why that's so. It says it has to do with precision issues.

    Doubt it will be something to fix.

    For just cubed root you could do something like this:

    x = any number

    sign = (x>0)-(x<0)

    result = sign*abs(x)^(1/3)

  • The idea there is to only run the physics simulation once per tick. You probably could just check if the last run tick is different than the current one:

    this.runtime.tickcount != this.behavior.lastUpdateTick

  • I did not implement saving and loading state with this. I haven't reasoned about what side effects this would cause but it probably causes the effects you see.

  • Probably the way to do it would be to use a seperate object for the different parts. The player won't know the difference

  • Simplest would be to use an iframe plugin and then just run the example in that. Iframe lets you run almost any html inside it. Probably not feasible in C3 at this point.

    It may be better to just use that directly and not use construct at all. It has tutorials, tools and examples ready to go. Making it into an add-on for construct will make it more complicated and clunky to use.

  • To be sorted the tail has to have the isometric behavior too. When you move an object with another behavior you need to update the isometric position as well. I believe there is an included action to do that.

  • A quick google search looks like there's a setting in chrome where you can have it ask where to save files each time. Otherwise it looks like a browser controlled behavior, not something you can control from javascript in a html5 export.

    I even checked C3 which would likely have this were it possible. No dice.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I never added anything to the behavior for the debugger or save/load. The only issues would trying to do something the chipmunk library doesn't allow. I wasn't able to protect against all cases. Normal use should be fine. Also the collisions seem to be spongier than box2d which may or may not be an issue.

    I concur with what ossyrag said, behaviors are just JavaScript so they should run the same across anything that runs C2.

  • Physics is quirky in general. You could try a different physics behavior. There's another box2d one and a chipmunk one. Both were made after a dissatisfaction with the default one. Not sure if they solve that issue. I know the chipmunk one has its own set of issues.

  • You can do that with the browser object. There's a download action. Also with nwjs exports the nwjs object has save dialogs.

  • irina

    Sorry, I have no idea why one works and the other doesn't. I've only ever used html5 and nwjs export.

  • That's good to hear.

    If you later want it to be uniformly random here's a second idea. Basically for n objects there is n+1 gaps. My thought is if we generate a random number for each gap and then sum them up, we can then find a factor to convert the sum to freespace and use the array values and the factor to get gap widths.

    Sum=0

    Freespace = 100-10*n

    Array size (n+1,1,1)

    Array for each X

    --- set current X to random(1)

    --- add curx to sum

    Factor = freespace/sum

    X=0

    Repeat n times

    --- add array.at(loopindex)*factor to X

    --- create Sprite at (X,0)

    --- add 10 to X

  • Maybe something like this? It assumes the sprite's origin is on the left, that probably is a quick tweak. It's also untested so I'm not sure how well they distribute on the line. A second idea would be to first evenly distribute the sprites then jitter them around while preserving gaps to be >0

    n : number of 10px sprites

    FreeSpace = 100- 10*n

    Gap:0

    X:0

    Repeat n times

    ---set gap to random(freespace)

    --- subtract gap from freespace

    --- add gap to X

    --- create Sprite at (X,0)

    --- add 10 to X

  • Link2 is purely cosmetic. It always is at the end no matter what.

    To add a new link it should be simple as creating a link object and setting the index to where you want it.

    So if the front has an index of 0 and the next link has a index of 1 you could give the new one an index of 0.5 to add it to the front.

    Index can be any value, just as long one is greater than the previos

  • No idea really. I guess you could look at the browser console. Maybe you're running out of video memory?