R0J0hound's Recent Forum Activity

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

  • Try Construct 3

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

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

  • 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

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound