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