R0J0hound's Forum Posts

  • You could use anglelerp(350, 20, 0.5) to take into account wraparound.

    If you're using 2:1 (width to height) isometric then here's a way to get it to bounce correctly:

    1. first if you use the bounce action with events you can get the the before and after angles which then can be used to calculate the surface angle. A simple formula to calculate the bounce is "angle_out = 2*surface_angle - angle_in", which can be manipulated to "surface_angle = (angle_in + angle_out)/2".

    2. That angle is the visual angle. To get the iso angle you take the angle and convert it to x and y components with trig. x=cos(angle), y=sin(angle). If we double the y then use the angle() expression on that it should give us the corrected surface angle. Basically "new_angle = angle(0, 0, cos(old_angle), 2*sin(new_angle))".

    As an example looking at the image in the op, the bottom left edges of the diamonds are at 45 and 26.2 degrees. Then using the formula above we can convert 26.2 to 45.

    3. Once we have the corrected surface angle we can calculate the bounce angle again with "angle_out = 2*surface_angle - angle_in". Completed pseudo example below:

    number ang_in=0
    number ang_out=0
    number ang_surface=0
    
    on ball collides with wall
    --- set ang_in to ball.angle
    --- ball: bounce off wall
    --- set ang_out to ball.angle
    --- set ang_surface to (ang_in+ang_out)/2
    ---set ang_surface to angle(0,0,cos(ang_surface), sin(ang_surface)*2)
    --- ball: set angle to 2*ang_surface-ang_in[/code:2hbesvcv]
    
    One caveat is the result isn't quite perfect because the bullet behavior seems to calculate an approximate surface angle.  In my test it calculates the bottom left edge as 27.5 degrees instead of 26.5.  As a side note it should be 26.5 because atan(y/x) or antan(1/2) is approximately 26.5.  Anyways to get more precise surface angles we need to find the angle ourselves.
  • Fervir

    Effects don't work for this plugin. You can try the Paster plugin instead which was made with more webgl support.

  • I'm not sure a list of supported resolutions is relevant since full screen just scales up the game to cover the entire screen. Aka it doesn't change the actual display resolution, at least I don't think it does.

    Here's the api provided by nwjs which you probably can access from the browser object.

    http://docs.nwjs.io/en/latest/

    I didn't notice anything to get a list of resolutions there.

    If you really want a list of supported resolutions you could make a nwjs addon that calls winapi functions to get that info. I think there was a construct classic example that used some Python to do that, although the actual c code to do it should be pretty easy to find online.

  • No, you'd need an exe export so you can add additional code to do stuff beyond what browsers allow JavaScript to do.

    It's unlikely someone will get this working though.

  • This topic may be relevant:

    From JavaScript there doesn't seem to be a way to access the additional buttons. The mouse api alluded to being able to, but in the example capx using it shows that it doesn't work.

    You could map the buttons to keyboard keys or if you use just nwjs there may be way to utilize an addon to use another language to access more of the system than what the browser usually permits.

  • A star isn't restricted to grid based, and it should work well for what you want to do.

    Here's an awesome reference about it:

    http://www.redblobgames.com

    You can also find some examples of astar done in events if you search my posts. Possibly could be useful.

  • Both really. The issue has been known by me since I made the plugin. It's not a trivial fix and I haven't found it to be worth the effort to attempt making it work correctly. Also as of late I don't spend much time coding.

  • I don't use effects but as far as I know the only issue with the outline effect was being thicker on export but that was corrected in C2's renderer a few releases ago.

    Now the paster object doen't behave the same way as C2's renderer when using effects, so results will be different in a lot of cases. So yeah, it's a bug in the paster plugin but I probably won't get around to fixing it.

  • You can't with the forum software. Here is what's supported:

  • You could use the canvas object to get the pixel colors.

  • It may be a limit with the asmjs version of box2djs. You could try changing to box2dweb instead from the project properties and see if that's the case or not.

    Otherwise, you could file a bug. I don't think most people use objects with so many points, mainly from the over 8 point warning I guess.

  • Here's my example. It plays back perfectly every time with chrome and probably nwjs.

    https://dl.dropboxusercontent.com/u/542 ... cord2.capx

    Looking at yours the only difference that may need investigating more is the save/load state. Maybe there's a delay or something.

  • Oh ok, I'll look at your capx later when I get the chance.

    An idea just came to mind. Since setting the minimum framerate to 120 or higher will make dt be a constant 1/120, you could set the time scale to 2 to get a constant dt of 1/60 so that it wouldn't be half speed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't have Web access on my computer currently so maybe I'll be able to send it tomorrow.

    I did some more testing with it. I recorded for 27 seconds and observed the final location. It varied maybe a thousandth of a pixel so it's not exact, and I can see how it can get further off as the recording gets longer. Dt does indeed vary slightly because the time between frames varies a little, and the the minimum frame rate is only used if dt is greater than it.

    So instead I tried a framerate limit slightly higher than 60 like 64.

    On chrome it worked well in giving me a constant dt and after a 37 second recording the end position was exact every time.

    Edge didn't work so well with that. I was still getting a different dt occationally which made the end position off by around a pixel after 37 seconds. I tried 9999 but looking at dt it seems 1/120 is the minimum dt on my machine for chrome and edge.

    But that also made my game run at half speed. Does your game run at the same speed?

  • Any reason you set the minimum framerate to 99999 instead of 60?

    I did a test and didn't set the minimum framerate and recorded the input. I was at a consistent 60 fps so that was good. Playing back was spot on, I did some stuff to create lag and the replay was failing. I set the minimum framerate to 60 and the replay looked perfect again. However if I set the minimum framerate to 99999 instead of 60 the replay failed badly. My guess is something non-intuitive is occurring with such a high value.