R0J0hound's Forum Posts

  • I'm not sure there is an easy solution. You could look into steering behaviors as used in boids for a possible solution.

    You could also take digitalsoapbox's idea to detect what's around the car and then use a state machine to decide what the car will do.

    Like if it is clear in front of the car have it accelerate and drive in the best path.

    If a car is in the way, have the car try to steer around the other. If the other car then slows then have the first car stop overtaking and move to the best path.

    Basically look at what's around the car moment by moment and have states like "overtake" for maneuvers that take longer. It can get as complex as you want.

  • You could also use an array t do this and just store the uid of the object in a grid space (beware one object will have a uid of 0).

    So assuming you set up the level so at most one object is in a grid you could do:

    Start of layout

    --- array: set size to (layoutwidth/32, layoutheight/32, 1)

    --- for each sprite

    ------ array: set at (sprite.x/32, sprite.y/32) to sprite.uid

    so basically if a grid location is 0 it's empty otherwise it's the uid of the object in it. To do movement you'd set the grid of the destination grid to the uid first and then when the sprite arrives there you can set the old position to 0 again. Some instance variables can be used for that.

  • I think it's only doable with nwjs. If you add the nw.js object you can access the x,y position of the window.

    Then to check if it changed you could do

    global number winx=0

    global number winy=0

    start of layout

    --- set winx to nwjs.windowx

    --- set winy to nwjs.windowy

    winx != nwjs.windowx

    or

    winy != nwjs.windowy

    --- set text to "user moved window"

  • The speeds are in pixels per second. So if the speed is 100 the number of pixels moved in a frame is 100*dt.

    Accelerations are similar. If an acceleration of 1500 is used the speed will change by 1500*dt in a frame.

  • Box2d doesn't do that.

    If you want to apply air friction to an object then apply a force in the opposite direction of motion.

    Or you could play around with the linear damping property.

  • Using it as the first condition makes it similar to a "start of layout" condition while not being a trigger. I also can see why you'd use it in the middle of other conditions, although it's a less common use.

  • Making an example or searching the forum for one isn't worth the trouble. Why not pick one and try your hand at making it? Everything in games can be broken up into lots of simpler parts that can be figured out. Then if you get stuck you can post your attempt and explain what you're trying to do. If you end up not being able to do any part you could always try something simpler and then with maybe with later games you'll be able to do it with more knowledge and experience.

  • I'm not working on this anymore, but probably the best way to improve performance is to have less objects have this behavior. For instance the ground could be sorted once and left as is.

  • That video is a demonstration of all the joint types, they aren't rope. I think the was an example capx in the first post using a few joints. Any of the other joints should be as easy to use. If any don't make sense you can reference the chipmunk manual for a better description.

    I don't think I'll really be getting around to making any other capx.

  • Momentum is just keeping the speed it was dragged and slowing it down over time. You can get the speed from the current position and the previous.

    So something like:

    sprite: on drop

    --- sprite: set vx to self.x-self.oldx

    [inverted] sprite: is dragging

    --- sprite: set x to self.x+self.vx

    --- sprite: vx to vx*0.9

    every tick

    --- sprite: set oldx to self.x

  • You probably can do it with a few revolute joints to connect the stick to the platform and two wheels to the platform.

    Then you'd need two keyboard events to apply horizontal forces to the platform. Add another physics object as the ground and tweak the amount of force applied by the events and you should be set.

  • A rope would just be multiple objects connected by maybe pivot joints. Make them all the same collision group or alternate collision layers so they don't collide with each other

  • You could just use the "rotate to angle" action to gradually turn to a object. It will be smooth but not symmetrical.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't really have any plans to update. I'd need to port 7.0 to JavaScript myself. Also I'm not interested in the store.

    You mean apply force toward a point?

    For the force select "polar" and angle(self.x,self.y,touch.x,touch.y) as the angle and any value for the magnitude.

  • No idea really. I only use the HTML export.

    Neither have I measured performance, although some say it's faster.