Sprite.Overlaps usage in Python

This forum is currently in read-only mode.
From the Asset Store
A set of 10 pixel art animated magic effects with icons. 2 Fire, 2 Earth, 2 Wind, 2 Water, Portal, Explosion.
  • I've run into some weirdness with python again, and I was hoping someone could give me a hand. I can't seem to actually get any results with Sprite.Overlaps() in python, even though the same operation works just fine in the event sheet.

    I have a "Player" sprite with the platform behavior running around (well, sliding anyway) on top of a solid object and another, non-solid sprite that is intended to work as a trigger (currently named Sprite3). No matter where I go onscreen, Player.Overlaps(Sprite3) always returns false from my python script. Has anyone else had trouble with this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The correct syntax would be, Player.Overlaps("Sprite3"), but "Overlaps" will cause a crash when used in python because it's implementation requires it to be attached to an event.

    A solution is to use Player.OverlapsOffset("Sprite3",0,0) instead.

  • Great, thanks again! It seems like I'm in the minority for wanting to use python so much, so I definitely appreciate the quick, thorough answers.

    Speaking of which, is there a place where python functions / parameters are documented? If not, I'm willing to update the wiki what I learn from my experiences.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)