mattb's Recent Forum Activity

  • Ruskul - these are the conditions available & there's an 'on pre step' trigger.

  • Hi ruskul, I only skimmed your post but have you looked at the Chipmunk physics behavior? From Rojo's post:

    [quote:1sof8dpk]* Collision info with the "Post Collision" condition. With it you can get:

    1. Kinetic energy of collision.

    2. Impact of a collision.

    3. UID of other chipmunk object hit

    4. Number of contact points and the point, normal and penetration depth of each.

  • Is there a way to set linear or angular damping per object? I find those to be essential features of the in-built physics behavior for tweaking movement & doing things like underwater effects. Prevent rotation is another handy feature that's missing, but I suppose it'd be easy enough to set these with events.

  • Thanks, this sounds great. The post collision trigger stuff should add some interesting new possibilities over the current physics engine. Chipmunk's lack of tilemap support is a problem for me though, but I'm sure Rojohound will get that working in the future.

  • I posted this under bugs & Ashley confirmed that it's a limitation of the box2d engine. The same thing happens to a lesser extent with asm.js, so I'm still looking for a workaround. Any ideas?

  • Problem Description

    If you toggle a physics sprite between movable & immovable while it's sitting on top of an immovable sprite, it falls through the one below when toggling back to movable.

    Attach a Capx

    Attached below

    Description of Capx

    As above

    Steps to Reproduce Bug

    Click on the red sprite to toggle moveability.

    Observed Result

    Clicking once makes it fall into the floor slightly then move back up. Clicking repeatedly can make it fall through.

    Expected Result

    I'd like it to not move, but this may just be a limitation of the physics engine.

    Affected Browsers

    • Chrome: yes
    • FireFox: yes
    • Internet Explorer: don't know

    Operating System and Service Pack

    ____ Win7 64bit ____

    Construct 2 Version ID

    190 (64bit)

  • I've got a situation where I want to switch an object's physics between movable & immovable, however there's a problem with this as you can see in the capx. Click on the red sprite to toggle, & the sprite falls through the floor when it becomes movable (this gets worse with each click).

    I've tried moving the sprite up 1 pixel before it's set to movable again to avoid overlaps, but that doesn't work. It seems to have no collision with the floor for a few frames. Any ideas for a workaround?

  • I didn't check lunatrap's capx (don't have the latest c2 installed), but if it's not using rex's light behaviour then I'd recommend you use that instead of an event-based solution - it's much easier & seems more efficient with lots of laser bounces:

    Just apply the Light behaviour to your laser sprite (a thin sprite with the origin at the left side), & with one action it will extend towards a custom obstacle or a sprite with the solid behaviour. You can do this every tick or manually.

    After the laser has hit, you then get the hit object's UID, hitX, hitY & a reflection angle (eg. to pick the hit object you would do: Spritename | Pick instance with UID Laser.Light.HitUID)

  • rexrainbow - please do Here's a version with better textures & opacity falloff...

  • Got the events working at last. Capx is attached below...

  • Well that was embarrasingly simple now you've explained it Thanks! Also thanks for showing the '?' operator, hadn't seen that before.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What I'm trying to do is work out which side of an arbitrarily rotated rectangular sprite is hit, so I can then get a reflection angle for the Light behavior plugin.

    I can already do this for sprites which stay at 0 degrees, as you can see here:

    https://dl.dropboxusercontent.com/u/52354372/detect%20rectangular%20sprite%20side.capx

    That's basic trig comparing the angle between sprite & hit point with 4 ranges for each side.

    The problem I'm having is working out the math for a rotated sprite. Any idea how to do this?

mattb's avatar

mattb

Member since 21 Nov, 2012

None one is following mattb yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies