R0J0hound's Forum Posts

  • It's the change in velocity. In simple cases like hitting the wall at 60mph the car would go from 60 to 0 so the speed would be the change in speed. Still you'll need to store the velocity before colliding because after the hit the the velocity will be 0 (if it doesn't bounce).

  • Mayfly

    Opps, wrong file. I fixed the link.

  • Here's my result:

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

    But a steering behavior would look nicer:

    https://gamedevelopment.tutsplus.com/tu ... amedev-849

    https://gamedevelopment.tutsplus.com/tu ... medev-1303

    Here's my experiment with that:

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

    The easing curve isn't symmetrical though.

  • Maybe what you want is the kinetic energy or maybe the impulse of the collision. Now that I think about it it can be thought of as the acceleration. Basically the change of speed. You can calculate the X acceleration like this. Y can be done similarly, and the total can be calculated with both: distance(0,0,ax,ay).

    Var lastVx=0

    Var acceleration=0

    every tick

    --- set acceleration to (car.physics.velocityX-lastVx)/dt

    --- set lastVx to car.physics.velocityX

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tunepunk

    That js code you posted is the same as lerp.

    We should be able to eliminate the orbit by just having a speed toward the target instead of seperate xy velocities.

    Var speed=0

    Distance(sprite.x,Sprite.y,mouse.x,mouse.y) > (speed^2)/(2*100)

    --- add 100*dt to speed

    Else

    --- subtract 100*dt from speed

    Every tick

    --- Sprite: move speed*dt pixels at angle angle(self.x,self.y,mouse.x,mouse.y)

    That should be closer. A bit more work could be done on the slowing down bit. Like instead instead of just using 100 as the decceleration we could calculate the required deceleration based on the remaining distance and speed.

  • One way is to keep track of the velocity. Basically it starts at 0 and accelerates (ease in). Then you can calculate the distance it would take to decelerate to zero and use that the change the acceleration to decceleration (ease out).

    Here's a link of the idea:

  • It still works fine here. I noticed the newer Dropbox links are slightly different so I added a modified link.

  • TileAt(loopindex("x"),loopindex("y"))

  • Replace tile with the expression to get a tile at a location.

  • You should be able to do it by changing the logic around. In it able to open the capx right now so this may be a bit different. You don't even need a variable. You could take a loop over all the tiles and make these sub-events to keep for example tiles 4 and 6.

    Tile=4

    Else

    Tile=6

    Else

    --- erase

    Or if you still wish to use a variable just structure the text variable used for the list like this. Comma seperated and starting and ending with a comma.

    Global text keep=",4,6,"

    Then use a sub-event like this:

    System compare: find(keep, ","&tile&",") = -1

    --- erase

  • You first find the length and divid both values by it.

  • The general way to connect multiple physics object together is with joints, but they won't give absolute rigid results. The way to do that is merge multiple shapes to one object, but neither the physics or chipmunk behavior provide that capability.

    Why? Well the bundled physics is fairly simple what features it provides from the box2d library. With the chipmunk behavior I opted to keep things simpler by just keeping one shape per object because it's more useful in the general case.

    Possible solutions could be the just use a physics library directly with JavaScript run with the browser object, or a new physics behavior which just provides access to everything in the library. you'd have to deal with more errors.

  • Variable=1 and the else should be subevents of on button pressed and it should work.

    You can also toggle the variable between 1 and 2 with one event:

    On button pressed

    --- set variable to 3-variable

    Just be sure the variable starts as 1 or two.

  • Fonts mess on different systems, because different browsers and operating systems do things differently. This is a web wide issue. At least that's what I gather from an Internet search.

    You could create a bug report for it. Maybe it can be corrected?

  • It's hard to give improvements with just videos. Here's a possible model:

    Joints at all the normal spots, and some range of motion limits. The springs are used to encourage extended legs and flexed arms. That encourages a more bent over posture which keeps the joints in the middle of their ranges of motion.

    Here is a possible implementation:

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

    The feet angle could probably be done manually instead of being physics based.

    It may not be usable other than maybe giving some ideas. I does need a lot more tweaking.