0 Favourites

Bullet bouncing

This forum is currently in read-only mode.
  • so far I know how to create a bullet and when it collides with an enemy the bullet bounces but when it did, it does not follow the next closest target but instead goes straight towards the exit.

    I also cannot find a way to do so.

    Here are my events:

    + System: Start of layout

    -> BadGuy: Set angle to random(360)

    + MouseKeyboard: On Left mouse button Either single or double clicked

    -> System: Create object Bullet on layer 1 at (MouseX, MouseY)

    + Bullet: On collision between Bullet and BadGuy

    + Bullet: [negated] Bullet: Value 'hIT' Equal to 1

    -> BadGuy: Spawn object Dummy on layer 1 (image point 0)

    -> Dummy: Set 'LastTarget' to BadGuy.UID

    -> Bullet: Destroy

    + System: For each Dummy

    + BadGuy: [negated] BadGuy: Unique ID is Dummy ('LastTarget')

    + Dummy: Pick closest to: BadGuy.X, BadGuy.Y

    -> Dummy: Set angle towards BadGuy

    + System: For each Bullet

    + BadGuy: Unique ID is Bullet ('ID')

    -> Dummy: Set angle towards BadGuy

    + Dummy: Value 'Produce' Equal to 0

    -> Dummy: Spawn object Bullet on layer 1 (image point 0)

    -> Bullet: Set 'hIT' to 1

    -> Bullet: Set 'ID' to BadGuy.UID

    -> Bullet: Set angle to Dummy.Angle

    -> Dummy: Set 'Produce' to 1

    + Bullet: [negated] On collision between Bullet and BadGuy

    -> Bullet: Set 'hIT' to 0

    + Dummy: Value 'Produce' Equal to 1

    -> Dummy: Destroy

    + BadGuy: Is outside layout

    -> BadGuy: Rotate 5 degrees clockwise

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Can you post your cap file showing this? You can usually host free with DropBox

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Hyper Bounce Blast
49 4,060
Flump's avatar
Flump
Unread hot topic
0 Favourites
Bullet-Hell ; The game !
34 2,208
mELTINGsKYsTUDIO's avatar
mELTINGsKYsTUDIO
Unread hot topic
0 Favourites
Make an object bounce?
26 15,570
Manarsoft's avatar
Manarsoft