R0J0hound's Forum Posts

  • You could, but it would be hard to get the 20fps you want.

    For an initial test you could try just sending an array as json and see how it performs. Since it's all text the size of the data could vary a lot. Sending only the pixels that changed would be less data to send up to a point. Since you'd need to send color and position, you could actually need to send more data.

    Getting the colors into the array is the next slow bit. Grabbing pixels is kind of slow, and the only plugin that does it somewhat is the canvas plugin. You'll want to do this in straight javascript for an acceptable speed. Same with arrays. Even looping over them in javascript is much faster than with events.

    Compression is possible, but with that amount of data you'll need to use javascript instead of events.

    A better solution would be to leverage html5 video streaming, but still javascript would be needed.

    But you could go a simpler route, like just sending the player's input so both sides can recreate the same image.

  • I center the track with the baseDx variable, so maybe you could modify it somehow when turning.

  • Here's a bit of experimentation with the idea. The main issue it has is the curving of the road isn't synchronized with the speed, so right now it kind of drifts.

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

    It's requires a bit of math and fiddling with the formulas to tune it. That said it's not exactly simple and I haven't really scratched the surface of what that guide covers. At the very least this provides something to play around with.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could do it that way, it could be tedious though.

  • The shape of the line is done with the sum of multiple sine waves.

    A single sine wave would look like this:

    y = a*sin(b*time+c*x+d)

    a is the amplitude of the wave

    b is the speed of the wave

    c is the frequency of the wave

    d is just an offset

    The interesting slopes can be done by adding more than one of those waves together as long as they have different values for a,b,c and d.

    So then we have an equation that gives a y position from a x position. That can be used to place the trees, since they just move up and down.

    Getting the angle of the curve at any point just requires some basic calculus. Just take the derivative of the equation above with respect to x and we get:

    slope = a*cos(b*time+c*x+d)*c*pi/180

    Then the angle can be found from the atan of the slope:

    angle = atan(slope)

    Here's an example:

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

    I used iid but I could have just as well used x, also the lines have gaps which could be fixed with better line drawing.

    That pretty much covers what it looks like is done in that video. To have other objects move about on that surface you'll need to do it manually. I make a ski example a while back that probably could be referenced.

  • To eliminate the sprite getting caught you need to lengthen the slope sprites. If you look close as it is now they don't extend far enough so there's corners to catch on.

    An overlaps check could be better than a on collision check. Just keep in mind you could overlap more than one wall. One way to deal with that would be to use the average angle of the wall's bossAngle.

    +------------------------+
    |                        | set sprite angle to 0
    +------------------------+
       local number count=0
       local number sum=0
       +---------------------+
       | sprite overlaps wall| set count to wall.pickedcount
       +---------------------+
          +------------------+
          | for each wall    | add wall.bossangle to sum
          +------------------+
          +------------------+
          |                  | set sprite angle to sum/count
          +------------------+[/code:3kmqslf2]
    
    The first action that set's the angle to 0 may not be necessary, but it might give some more consistency to it.  Probably a better idea than setting the angle of the platform object would be to use a seperate object that you'd position to the other one, and then just change the angle of that.
  • You could use the platform behavior to do it quick.

    every tick:

    --- simulate platform pressing right

    sprite: wall to right

    --- set angle of gravity to self.platform.angleofgravity-90

    you just need to eliminate the corners that it can get caught on.

  • The idea is possible, see here:

    It has a link to a generic guide on how such a game works. No c2 example has been made yet, but it looks somewhat doable. Maybe by having a sprite per scanline or some variation of that.

  • Pretty sure. The mibbit web client seems to work well.

  • Try a different irc client then. One that works is in the search results. A Google search also gives a link in the first page of results.

  • Did you try a search for irc in the forum search? There's one that has been in use for a while.

  • Here's one possible way that could give you ideas.

    It solves the cornering in an exact way by positioning the detectors relative to the object's rounded position as I recall.

  • Giganten

    It's generally better to use forces and torques to change the motion of the objects. Changing the velocities directly won't give very realistic results although you can increase the iterations setting to make it do a better job of keeping up.

  • I can't see the link you posted but to do a mirrored water like surface it's just a matter of positioning the canvas with it's hotspot on the bottom of it. You'd then position it in the layout so the bottom will be where you want the top of the water to be. Then in events you'd:

    1. paste everything you want to reflect to the canvas

    2. set the canvas' height to negative

    The effect would basically look like this:

    +---+
    |   |
    |   |
    +-o-+  ->  +-o-+
               |   |
               |   |
               +---+[/code:25j7xwz9]