R0J0hound's Recent Forum Activity

  • They do different things so I'm unsure of the comparison.

  • You can't change the refresh rate of the game with C2. I believe a half framerate (30fps) was attempted before but it didn't perform well with html5, the result wasn't smooth. A search could probably give more info.

    That said C2 only redraws if something has changed position. So you possibly could force lower redraw rate by only moving the objects every other tick or something. It wouldn't work if you used any behaviors since they update every tick but with just events it could work. Probably more trouble than it's worth though.

  • You could do it like this. First you pick the object and save it's x, y and uid to some variables. Next you use an inverted "pick by uid" to pick all the instances except the original instance. The you can use the "pick closest" condition as usual.

    global number x=0

    global number y=0

    global number obj=-1

    pick sprite at random

    set x to sprite.x

    set y to sprite.y

    set obj to sprite.uid

    [inverted] pick sprite instance by uid obj

    sprite: pick closest to (x,y)

    do something

  • It looks like you'll need to call this function:

    CollisionPoly_.prototype.cache_poly = function(w, h, a)[/code:1bjeiulg]
    The only catch is it won't update if the width, height or angle haven't changed. So you'll probably need to change one of those first.
    
    I only took a quick look so I didn't investigate where that function is usually called.  You may even be able to change the size or angle of the object to force a update without calling the function if it's called every tick anyways.  Or instead you could change the .cache_width value from the polygon.
  • Waltuo

    It was mainly as an exercise to see how physics is implemented, so I didn't get it to a perfect state. I'm sure the collision detection could be better, maybe using SAT instead of what's currently in place would help.

    As far as adding sleeping I'm sure it could be added but I haven't looked into it. Basically there is a whole lot missing with it so it is mainly for amusement right now.

  • Here's one way

    Every tick

    Sprite: move forward 100*dt pixels

    Sprite: rotate 10*dt degrees clockwise

    Sprite: set X to self.x+50*dt

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to adjust where the origin is on your Sprite. You can do this in the image editor.

  • It's likely a graphics driver bug, try updating your graphics card driver.

  • For the other example you'd have to tweak it to use the 8dir movement instead of what it uses now.

    With just horizontal and vertical walls you could use the overlaps at offset condition to see if there's a wall next to it and just invert the X or y vector depending on which side a wall is. You could do it like the following. The first step would be to get the Sprite out of the wall, that is where custom movement is useful. On another note you could also compare the X and y velocity in addition to the wall detection, since you only need to bounce against walls you're moving toward.

    Sprite overlaps wall

    Sprite: customMovement: push out of solid

    Sprite: overlaps wall at offset (-1,0)

    Or

    Sprite: overlaps wall at offset (1,0)

    Sprite: set xvelocity to -self.xvelocity

    Sprite: overlaps wall at offset (0,-1)

    Or

    Sprite: overlaps wall at offset (0,1)

    Sprite: set yvelocity to -self.yvelocity

  • Oos

    You could also use the bullet behavior to handle the bounce:

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

    For more precise bouncing you'll need to find the angle of the object hit.

    Maybe something like this:

    viewtopic.php?f=147&t=152906&p=964827&hilit=normal#p964827

  • The joints just need to be created a tick after the objects are created. You could save the tickcount to a global variable when you create the objects and compare when the tickcount equals that global plus one to add the joints.

  • Yeah the compare all will do that. It's probably a bit flawed now that I think about it since it's comparing per component instead of per pixel.

    So a transparent pixel rgba(0,0,0,0) will be 75% similar to a black pixel rgba(0,0,0,255) instead of not at all.

    Fix that and a blank image should give a lower percentage.

    "rms" is a term used in your last link. It's basically the distance between the two pictures.