Enemy Grid Movement

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hello!

    I want to make a simple roguelike-style game. I used nivram's grid movement example to make the player movement, and I got a simple enemy AI to chase the player when he gets close to it. How can i get the enemy to move on the same grid pattern as the player, yet find the simplest path to get to him? I am happy to attach the project if anyone wants to look at it.

    Thanks!

  • Just looked through the code. It's great AI, and could definitely come in handy in my game, but I didn't see anything involving grid movement, which is my real problem here. I will keep that file with me though, that's some really cool stuff!

    Thanks for the help,
    Sp33d

  • if you have a working grid movement that the player can control, can't you easily modify that movement so that the computer controls it?

    for example -
    instead of "User holds right arrow" you could have an alterable value called "move right" or "move down" etc. If move right = 1 then that means the enemy will move right. You'd simply change the alterable values to move the enemy around, the values would change depending on what direction the enemy needs to move in order to move toward the player. For example - if the players X position is greater than the enemies X position, set the "move right" value to 1. This would make the enemies X position a little closer to the player.

    Check out my Game on Itch.io
    Please login to see this link.

  • The example file I posted works pretty much in the same way DaveC suggested. They have grid-based movement: moving the enemies 32 times, 1 pixel a time before coming to a stop. They then change direction and move again.

    Maybe I don't understand what you mean by grid movement?

  • Cheers DaveC. I get it now. So all he'd have to do is change their speed value to 32 - to make them move in increments of 32 instead. And then slow down their movement with a timer or something.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!