How do I aim enemy bullets as player?

0 favourites
  • 3 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • I can't seem to make my enemies shoot at me, no matter how I programme these plonkers, they always shoot in the direction they are facing...

    I have tried BulletAngleofMotion, Set angle towards and also set angle (i think it is called)

    no matter how I do it, i end up with the same result...

    Also, any idea why my enemies are 'teleporting' across the layout? I know I've programmed enemy_yellow to move pixels at random angle in cases of no LoS found, but teleporting across the layout is a little too far...

    drive.google.com/file/d/1KIgsLwpqEqtnrYpLzhd7IKuFH7SXa-Ys/view

    I've been working on enemy_yellow, so just ignore the rest of them. although, they too are teleporting.

    I want sort out 1, before a mass roll out to the rest of the enemy army...

    Thank you

  • The triggered event "obj_bullet_yellow On created" is placed as a sub-event under "Every 0.9 seconds". This is wrong. Move it to top-level and it will work.

    Also, you code is a bit messy.. You have Enemy family, but you are not utilizing it. You have lots of duplicate events for each enemy type - this is exactly what families are supposed to optimize.

    Move LoS, Pathfinding and other behaviors to the family, and you'll be able to decrease the amount of code significantly. See this link:

    scirra.com/tutorials/535/how-to-upgrade-an-object-to-a-family

    You can add another copy of Enemy family to use it in events like Enemy is overlapping EnemyCopy. You can use "Create by name" action to use in events like Enemy has LoS to player : System create "obj_bullet_"&Enemy.Type and so on..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yea I know my sheet is a mess, my technique is generally whack it on there, then go through it working out what can be consolidated into 1 event, kind of thing.

    I did try the usuing the enemy family as a way to detect enemies, issue I had was it was also registering the an enemy as it’s own enemy. So I changed it back to the mess until I had a solution.

    Advice is greatly appreciated dude.

    Thank you dop, I’ll go change that sort that out.

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