Scrolling Shooter - Rebound in layout

Discussion and feedback on Construct 2

Post » Tue Sep 13, 2016 2:13 am

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?
Posts: 1
Reputation: 152

Post » Tue Sep 13, 2016 5:05 am

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
:arrow: :!: enemy set bullet angle of motion to 45

:?: enemy.x > viewportright(activelayer)
:?: trigger once
:arrow: :!: 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!
Eh, Steve!
Posts: 112
Reputation: 16,085

Return to Construct 2 General

Who is online

Users browsing this forum: 99Instances2Go, Yahoo [Bot] and 1 guest