R0J0hound's Forum Posts

  • I didn't implement save/load at all for this plugin so that's where the issue comes from. I don't have any plans to support that feature.

  • I see it looks like the acceleration is instant with your test, mine was pretty fast but it wasn't instant. It can be made to have smooth acceleration I just need to fiddle with it a bit more I think. I'll see if I can look at your capx and fiddle with my examples this weekend sometime.

  • Yeah, the physics behavior doesn't provide the features to do it.

    One idea that would work, and that I'm interested in, is to just deal with a physics library directly with JavaScript. The only disadvantage is it would be completely seperate from the behavior's and how they nicely mesh with c2's features. So everything would have to be done with events. A plugin would be better but that takes a lot more time to make and polish. I'll probably try the idea this weekend and see what comes of it.

  • 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

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.