R0J0hound's Recent Forum Activity

  • Maybe instead of using anglelerp in multiple events, just use it once in an every tick event with anglelerp(bar.angle, weightRight-weightLeft, dt)

    And just make sure to add the weight's weight every time you pin it and subtract it every time you unpin. It looks like you got it mostly there but instead of checking for an overlap of groupBase in event 9, you rather need to check for an overlap of baseCheckL and baseCheckR individually in events 10 and 11 so you subtract the weight from the correct side.

  • There isn't enough info here.

    What steps did you do to see this bug? Do you have a minimal capx that reproduces the error?

  • The .scale expression was asked for before and the main problem was what value should be returned if the object was not uniformly resized? You could just use a instance variable instead though.

  • Make a post in the bug forums. Just using the physics behavior should not cause a javascript error.

  • You could normalize the angle to a range of (-180,180) with angle(0,0,cos(a),sin(a)) before comparison.

    Or you could use the sprite condition "is within angle" or "is between angles".

    Or you could use the anglediff(a,b) expression to find the angle difference in the range of (0,180).

  • digitalsoapbox

    I can't reproduce the issue. It's working fine here in Firefox, Chrome and NodeWebkit. Can you post a capx with the issue?

  • So you're trying to measure reaction time? The "on key pressed" events are triggers, so they can happen at any time instead of just on a tick. Also the "wallclocktime" system expression may be of interest to you. It is the time elapsed (in seconds) since the start of your game, and it isn't affected by the framerate.

    As far as changing the framerate; you can't in C2. The framerate will basically try to match the monitor refresh rate which is usually 60hz.

  • Try Construct 3

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

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

    It works fine here.

  • Here is generic guide on how that type of game is done:

    http://www.extentofthejam.com/pseudo/

    I was able to get it working in Construct Classic here:

    viewtopic.php?t=58596&start=0

    And some discussion about doing it in C2 can be found here:

    viewtopic.php?f=156&t=77718&p=640214&hilit=pseudo#p640214

    An example for C2 hasn't been made as of yet though.

  • You could try the custom movement behavior's push out action but that doesn't work too great for moving objects.

    One idea is to treat the enemies and player as circles. Then see if they collide if any two of them have a distance between them less than the sum of their radius'. Then the overlap between them would be radius1+radius2-distance. To resolve the collision just move each object half of the overlap away from each other.

    Also you'll want to either set the speed to zero, bounce the objects or only set the velocity in the direction of each other to zero. The last two can be done with the help of a vector projection:

    Speed_at_angle= velocity_x*cos(angle)+velocity_y*sin(angle)

    Then you can eliminate speed in that direction by:

    set velocity_x to velocity_x-Speed_at_angle*cos(angle)

    set velocity_y to velocity_y-Speed_at_angle*sin(angle)

    or to bounce do:

    set velocity_x to velocity_x-K*Speed_at_angle*cos(angle)

    set velocity_y to velocity_y-K*Speed_at_angle*sin(angle)

    Where K is 1 for no bounce to 2 for fully elastic bounce.

    I have an example of it in the first capx in this topic:

    and a more advanced version of the walls can be found here:

    But there are probably other ways.

  • Alpro

    Having a fixed flight time and having a different launch angle isn't physically accurate since it requires each cannonball to have a different gravity.

    Do do a launch here are the formulas. "angle" is the launch angle and t is the flight time. You'll need to change event 5 to use ball.gravity instead of gravity in the equations.

    ball set vx to (x_target-x_start) /t

    ball set vy to ball.vx*tan(angle)

    ball set gravity to 2*(y_target-y_start-ball.vy*t)/t^2

    bear13

    Probably no, the turret behavior is for straight shots, but with some creativity you possibly could do something similar with events.