R0J0hound's Forum Posts

  • Short answer:

    You can't.

    Long answer:

    C2 is synced to the screen refresh rate, typically 60fps, and there isn't a way to change it. If you want to get creative you could only move objects every 1/15th of a second to get that effect, but you can't use any movement behaviors.

  • Open topic is a good place for this. If it was originally somewhere else I approve of it being moved here.

    One thing I enjoy is clearing brush with a machete.

  • They're kind of like clamp. Min will only keep the lowest value, and max will keep the highest. I used it here to stop the value from passing 50 from either direction.

    Min(a,b)

    If a<b then it will be a

    If a>b then it will be b

    Max(a,b)

    If a<b then it will be b

    If a>b then it will be a

  • There have been other topics on this and there isn't such a function, but you can do it with a speed variable.

    Global number speed=0

    Every tick

    --- add 1 to speed

    Box X <50

    --- box: set X to min(50, box.x+speed)

    Box X > 50

    --- box: set X to max(50, box.x-speed)

  • BioMechanical

    The three ways to access values values are the following. Also they are the same expressions given when you select them from the expression list.

    Array(x)

    Array(x,y)

    Array(x,y,z)

    To use them replace x,y and z with a value. Also keep in mind the indexes start at 1 not 0.

    So to get the first value of an array you'd use:

    Array(1)

    For the second:

    Array(2)

    and so on...

  • I wouldn't worry about it unless it becomes slow to save/load.

  • The simplest is to put all the objects you want to z sort in a family (player, trees, walls, enemies). Then use a a for each ordered condition.

    for each family1 ordered by family1.y ascending

    --- family1: move to front

  • When you release you need to convert the angular velocity to a linear one. The equation for that is:

    linear = radius*angular

    where angular is in radians.

    Here's a complete calculation:

    radius = distance(bar_contact_zone.x, bar_contact_zone.y, player.x, player.y)

    angle_of_motion = angle(bar_contact_zone.x, bar_contact_zone.y, player.x, player.y) +bar_rotation*90

    speed = radius*bar_turn_speed*pi/180

    velocityX = speed*cos(angle_of_motion)

    velocityY = speed*sin(angle_of_motion)

  • InvaderX

    I guess this is a very late reply, but you could pick a random map sprite and create stairs on that.

    corpvs2

    I don't think I fully understand, but this was designed to have each room be the same size (one screen). It make it able to do different size or even L shaped rooms would be a lot harder, and probably require a new approach.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can still use those ideas. For instance you can take the second one and after you make sure the two objects aren't overlapping you can use overlaps at offset for a similar effect.

    Using the bullet's bounce is an interesting idea, but the bounce is inconsistent.

    You can however correct the angle by utilizing the equation for a bounce:

    angleOut = 2*agleSurface - angleIn

    So if you set rotateAngle to (Sprite3.Bullet.AngleOfMotion+90)/2-90

    You can also use your original idea of using detectors at the corners. To make it instant use a loop. To make it less jittery, move them by smaller steps.

    here's a wip of that I had laying around:

    https://dl.dropboxusercontent.com/u/542 ... 0_wip.capx

  • I think you can change it by changing the png in the Sprite plugin's folder.

    Edit:

    If you change the defaultImage.png in C2's install directory that will change it.

  • You could keep the player on a layer that doesn't rotate.

  • There are a couple ways to do this.

    One is to take the locations of the points of the collision polygon and calculating the point of collision and angle of the surface in contact by using the Separating Axis Theorem. It's a bit more technical to do but it gives exact results:

    Another simpler way is to check for collisions around an object and averaging out the offsets to get a angle. Here's one that does that when one object is a ball:

  • The angle() expression is what you're looking for.

    angle(sun.x, sun.y, self.x, self.y)

  • The bounce action of the bullet behavior should bounce according to the shape of both objects, aka their collision polygons.

    You can approximate it with events like this:

    In the case of a ray of light, you only need the angle on the object that's hit then the reflected angle would be 2*AngleOfSurface-angleOfMotion.