How do I spawn bullet from right side of screen (think Bowser's fireballs in Mario 1 or 3)?

0 favourites
  • 4 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hi,

    I have a platform game and want to spawn bullets that shoot towards the player (so 180 degrees) every 2 seconds.

    Since the game is scrolling, my initial idea was to set the "bullet spawner" on the UI layer (which has 0,0 parallax) but that makes the bullet speed weird if the player is moving.

    Any suggestions are appreciated.

  • Put it on a layer that is scrolling the same speed as the player?

  • Plinkie is right and you have the right starting idea.

    Keep the bulletSpawner Sprites outside of the screen

    Have bulletSpawner spawn bullet at (dt*bulletTimer) on layer = player.layernumber

    Destroy bullet when bullet.X > (is less than) (-1 *bullet.width)

    --------------------------------------------------------------------------------------------------

    OR you can create all the objects like your bullet in the beginning of the layout

    every (dt*bulletTimer) set bullet.X to [Just outside of the screen] set bullet visible enable bullet behavior

    After bullet.X > -bullet.width set bullet.X to [Just outside the screen] set bullet invisible disable bullet behavior

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you both for the replies! I was able to make it work like I wanted :)

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