How do I detect edge of screen?

0 favourites
  • 3 posts
From the Asset Store
On the Edge is a puzzle game where you have 40 levels to have fun with.
  • Hi all,

    is there a way to determine if my character is on the left or right edge of the visible screen? I want to limit his movement based on the screen device. I dont want the character to go off the screen since there is no scroll on him. Something like bound by screen would be ideal

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi all,

    is there a way to determine if my character is on the left or right edge of the visible screen? I want to limit his movement based on the screen device. I dont want the character to go off the screen since there is no scroll on him. Something like bound by screen would be ideal

    there is a behavior https://www.scirra.com/manual/89/bound-to-layout

    if you want to use another way, you can make 4 invisible wall and set x,y, and use:

    ViewportBottom(layer)

    ViewportLeft(layer)

    ViewportRight(layer)

    ViewportTop(layer)

  • > Hi all,

    >

    > is there a way to determine if my character is on the left or right edge of the visible screen? I want to limit his movement based on the screen device. I dont want the character to go off the screen since there is no scroll on him. Something like bound by screen would be ideal

    >

    there is a behavior https://www.scirra.com/manual/89/bound-to-layout

    if you want to use another way, you can make 4 invisible wall and set x,y, and use:

    ViewportBottom(layer)

    ViewportLeft(layer)

    ViewportRight(layer)

    ViewportTop(layer)

    Bound to layout would be ideal but since there is no scrolling on my main character, it ends like this: my character leaves screen and then game over. The invisible wall could work. Also i thought about restrict his x y movements but on different screen sizes/aspects the character could not reach the edge of screen or go beyond it.

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