scunliffe's Forum Posts

  • 9 posts
  • Changing the bounding poly worked perfectly... I can't believe I didn't find this before.

  • I have a scenario where I want to know if one element is completely (or mostly) overlapping another element.

    The best way I can describe this is to imagine a top-down view of a mini-golf course... I want to know when the "centroid" of the ball is within the hole element's circumference... hence a completed hole.

    Collision doesn't work because the ball would be considered "in" if the edges touch.

    Overlapping doesn't work because the ball would be considered "in" if a fraction of the ball covers the hole.

    In my case the "ball" I'm trying to get in the "hole" is a ~20px dia. ball in a ~25px dia hole.

    Is there a built in event that I can use to achieve this? or do I need to roll my own... testing the X,Y of my "ball" vs. the X,Y +/-5px of the hole?

  • Doh! I solved it!

    When I was dragging in images from exploring into Construct 2 I first tried to drag in several at once... this didn't appear to work and I only got 1 sprite... BUT! it created an animation sequence for that tile with the remaining images I thought that didn't come in.

    Erasing them from the animation sequence for that sprite solved it.

    PS - IMHO, dragging in 2 or more images should create "N" objects... not 1 object with "N" animation frames. Am I alone on this?

  • Hi,

    I have a bunch of square images "tiles" that represent roads (straight up/down, left/right, corners, etc).

    To quickly mockup a tiny neighborhood I put together a 10x10 grid of these tiles... and in the editor all looks perfect.

    When I preview it in my browser... on load there is a bunch of flickering as some (~25%) of the tiles change between various shapes until stopping on a completely incorrect tile.

    I'm lost as to why this happens... I have no behaviors on these tiles, I simply dragged them in to the editor from my filesystem and arranged them as needed.

    Additional notes in case relevant: my "grid" is larger than my viewport (1024x600) and my "car" is set to have a car and scrollto behavior.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah ha! I presumed that fullscreen mode applied "stretching" to fit the browser screen (undesired) thus avoided using it. Since that doesn't appear to be the case, I'll try the fullscreen option.

    As for devices... I was testing on a few... iOS (phone/tablet), & BlackBerry (phone/tablet)

    Cheers,

    Steve

  • Hello fellow game developers,

    I'm making a game that will ideally be played on a tablet or phone... but I want to ensure that the default browser behavior of "overscrolling" when the user swipes the "page" doesn't occur.

    e.g. I'm catering specifically to a known device (and resolution) thus I want to "fix" the screen size to exactly 640x480 for example.

    Webkit does provide meta tags for this, that lock the scaling of the viewport... e.g.

    <meta name="viewport" content="width=device-width,height=device-height, initial-scale=1.0, user-scalable=no, maximum-scale=1.0"/>

    or for some devices with extra high pixel density, the preferred is:

    <meta name="viewport" id="viewport" content="initial-scale=1.0,target-densitydpi=device-dpi,user-scalable=no"/>

    However if I add this (either) and use the device dimensions above (or hard code them... I still get the screen shifting issue when I touch and drag.

    I also tried wrapping all the content on the page in a div that was positioned "absolute" with the full width/height set, and overflow set to hidden and it still doesn't work.

    FYI: I also removed the CSS 1px border on the canvas too in case this was causing the canvas to grow larger than the screen size.

    Is there any trick to get this to work? Even if it is programatic to detect a touch "swipe" event and "return false".

    Cheers,

    Steve

  • Thanks for the tips... PS you did mean "VelocityX, and VelocityY" vs. VectorX, and VectorY... correct?

  • thanks for the ideas... i'm guessing that the distance(0, 0, Sprite.Physics.VectorX, Sprite.Physics.VectorY) is what I need... the only trick I have now... (and sorry for being so naive) is where can I use this expression?

  • I'd like to be able to know what the force of a collision is to determine if it was just a "bump" or enough to trigger a "kill" etc.

    If you think of Angry Birds... a light tap does nothing to a pig... a medium hit gives a black eye... and enough hits or a big hit destroys the pig.

    In a similar way in my physics based game I'd like to know how hard an impact is.

    If there is a way to do this I'd love to know (legit or a hack ;-)

    Cheers,

    Steve

  • 9 posts