I'm new and I want to make the enemy bounce

0 favourites
  • 4 posts
From the Asset Store
Bouncing ball
$9.99 USD
Template for a bouncing ball game, fully documented in comments and video
  • ello. I'm making a mobile game. How can I make the enemy bounce in the X direction when it reaches the sides or the ground? And considering this, how can I ensure that when it bounces, it doesn't exceed X height?

    And while we're at it, how can I make them appear randomly from both sides of the screen?

  • Depends on how you're having them move in the first place.

    Try using the bounce off solids property of the bullet behavior, and pin invisible helper sprites with the solid behavior to the viewport edges.

  • I managed to do it by setting solid objects and making them bounce. What I’m not doing very well is getting the random enemies to appear correctly (although they are being produced), they don’t enter the screen properly despite forcing them to move towards the center. Some do, others go in random directions. Could it be because of the solid objects? The enemy is created in the top left and right, off-screen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That would be reasonable. You can add the 'is on screen' condition to enable bounce only after they enter the viewport.

    Or you can use the 'On collision' condition with the 'bounce off object' action along with the 'is on screen' condition as above, instead of just enabling bounce forever.

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