How do I make enemies smarter?

1 favourites
  • 3 posts
From the Asset Store
Pixel Enemies for SHMUP consists of 38 enemy ship sprites to be used in your game.
  • I have 4 types of enemies and i want them to move diferrently, like they are "cornering" (not sure about this word) the player. Using the MoveTo, all of hem just go to the same place. How do i malke them feel more natural and move towards the player, but using slightly different trajetories?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Pick a random point near the player to move to instead of directly on the player. Use for each, so they don't all move to the same random location.

    For each enemy, move to player.x+random(-100,100), player.y+random(-100,100)

  • Just to add to oosyrag's idea... you might want to tweak that a bit, because at present this might make enemies pick a point on the far side of the enemy - that will look weird and not "intelligent", because there would be no reason for them to want to move to the furthest possible point from their current location...

    Maybe you could add a check so that you first test if the enemy is to the left or right of the player (eg. if enemy.x < player.x then move to a random point on the left side of the player, etc). And do the same for the Y axis.

    Alternatively, you could maybe spawn a bunch of invisible helper objects around the player and have each enemy select the nearest node to their position and head towards that? 🤔

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