How do I warn the player of an attack coming from outside the window

0 favourites
  • 4 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • Hello,

    I have a layout twice bigger than my window, so you often can't see all of the enemies. When an enemy launch a big attack, I want the player to be informed of it with an exclamation point (!) or something, so WITHIN the window, at a relative X and Y position.

    So if the enemy is left to the window, the warning sign should get the same Y position, but have a X position right to the enemy, visible by the player.

    I've tried lots of expressions, like "viewport", but I can't get a satisfying result. Could someone give me a hand?

    Many thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • (ViewportLeft(n)+10) or (ViewportRight(n)-10) should work, where "n" is layer number and "10" is a small offset/padding from the edge of the screen.

    Choose a layer with 100% parallax and scale.

  • Thanks, but it works only with the X coordinates alone. If I try to retrieve X and Y, the sprite sometimes disappears and sometimes it's stuck in the corner of the screen.

  • Do you have layers with different parallax?

    It will be easier to help if you could post your capx.

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