R0J0hound's Forum Posts

  • Why not use the physics behavior or this behavior?

    You can do it without the physics behaviors but you'll have to do some math.

    If ball is in the air then move it down.

    If the ball hits the ground then...

    1. find the angle of the ground.

    -- one way to do this is just have different sprites for different angles or you could even use the angle of the ground sprites.

    -- another way is to use two detector sprites. One a little to the left of the ball and another a little to the right. Then in a loop move each detector down till they hit the ground. Then just calculate the angle of the left detector to the right.

    2. Move and roll the ball down the slope. This is where the math comes in.

    -- the simplest way is of course to just use the move at angle action.

    -- the amount to rotate the ball can be calculated with distance_moved/ball_radius*180/pi. And make it rotate counter clockwise if the slope is to the left (or the angle is from 0 to -90 degrees.).

    That will give roughly ball motion. It can be improved instead by giving velocity and angular_velocity to give the ball momentum and calculating the accelerations on a slope for the angular_velocity. So basically the better you want it to look the more physics equations you need to use, which is something those behaviors already do for you. But it never hurts to learn how things work.

  • Updated to version 1.1:

    Fixed: bug with "set collision layers" action.

    Fixed: bug with "apply impulse" action.

    Fixed/Added: more support for Chipmunk2d's object sleeping behavior

    Fixed: Collision shape wasn't always aligned properly.

    Added: expression to get the uid of the other object of a joint.

    Added: action to sleep or wake up an object.

    Cosmetic change: moved the actions in the "velocity" action group to the "dynamics" action group.

    Here's example using segment shapes, collision layers and the "pick closest object" condition to do a sonic the hedgehog like loop.

  • spongehammer

    Segments are basically lines with rounded ends, which are useful for level design.

    In the picture the black is the collision shape. A negative radius insets inside the sprite. When segments are put together the rounded ends eliminate gaps that you'd get with boxes.

  • FileChooser.fileUrlAt(0) is just a file name. You need the contents of the file which you can get with Ajax.

    https://www.scirra.com/manual/182/file-chooser

  • locohost

    According to the change log "pick by uid" works with a single look up since r127

    [quote:37ts1v7b]The condition 'Pick by UID' has been reimplemented to work with a single lookup, rather than iterating every instance. This should make it faster, but it also is now the one condition that is the exception to the rule about picking newly created objects in subevents, i.e. you can call a function on a newly created object, passing its UID, and successfully pick the instance, which did not previously work.

    https://www.scirra.com/construct2/releases/r127

  • -90 is correct, since -90 is up. The issue is when the bullet behavior has a speed of zero, then setting the angle of motion has no effect, it will always become 0 (right). The solution is to set the speed first, then the angle of motion.

    The reason behind this is the bullet behavior stores velocity in two variables: vx and vy, the first being for horizontal velocity and the other for vertical. When the speed is zero then:

    vx=0

    vy=0

    The angle of motion is set by first calculating the current speed with the Pythagorean theorem: speed=sqrt(vx^2+vy^2)

    next the new velocity is set in the angle you want:

    vx = speed*cos(angle)

    vy = speed*sin(angle)

    But since the speed is zero vx and vy will become zero.

  • To position objects the math in the shader is reversed, and it comes out kind of complicated.

    Change the m7x and m7y variables of the obj sprites to change their locations.

  • spongehammer

    It is, concave polygons need to converted to multiple convex polygons to work. That being said It should be possible to do this inside the behavior with no difference to the user. The problem is it's a more complicated feature to implement, but it is on my todo list.

  • You do not have permission to view this post

  • It would be very useful to be able to call the update function of the pin behavior from anywhere and as many times as needed. I've gone the event way before because I needed to do that. So +1 to this request.

    Also it is dead simple to add such an action to the behavior, but it's always better if the modification is official.

  • Thank you sir. Still 4 more hours to go till 2015 here. So the last of 2014 for me.

  • Kyatric

    It's ready to go. It's pretty much complete with everything in working order. At this point Changes will mainly be bug fixes, and currently there are no bugs that I know of.

  • Kyatric

    Good sir,

    Would it be possible to add this "Chipmunk physics" behavior to the list?

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Happy new year!

    Edit: in other news I seem to have just turned 0 years old.

  • You do not have permission to view this post