Skip to content

Instantly share code, notes, and snippets.

@Shilo
Last active February 21, 2018 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shilo/c723d452aa803b8d2829f0c78f7f9e18 to your computer and use it in GitHub Desktop.
Save Shilo/c723d452aa803b8d2829f0c78f7f9e18 to your computer and use it in GitHub Desktop.
VyScript to detect what side of map void the player bumps into. (Vylocity engine: http://vylocity.com/)
Mob/Player
onBump(pB)
if (pB == Map.void)
if (this.xPos == -this.xOrigin)
World.log("bumped against left void")
else if (this.yPos == -this.yOrigin)
World.log("bumped against top void")
else if (this.xPos == Map.getMapSize(this.mapName).xPos-this.xOrigin-this.width)
World.log("bumped against right void")
else
World.log("bumped against bottom void")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment