0 Favourites

Scrolling Shooter - Rebound in layout

  • Hi, I have a problem with my Scrolling Shooter game.

    I want that the enemy rebound in the two limits of the layout while it goes to the player. I can't get that the enemy rebound.

    How can I do this?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • If I understand you right, I think you want your enemy to bounce off the walls of your layout. Am I right? If you use the bullet behavior, you can set the bullet angle of motion, with the bullet behavior "set angle" property turned off, to something down and to the right when the enemy goes past the left side of the screen and set the angle down and to the left when the enemy goes past the right side. You might try these events:

    enemy.x < viewportleft(activelayer)

    trigger once

    enemy set bullet angle of motion to 45

    enemy.x > viewportright(activelayer)

    trigger once

    enemy set bullet angle of motion to 135

    Or you might have the bullet behavior moving the enemy straight down (or the player straight up) while the "sine" behavior controls side-to-side motion, but I don't have experience with that behavior. Hope that helps!

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