Tiny Heist

  • Hello,

    I'm trying to make a game (https://www.coolmathgames.com/0-tiny-heist). I need help with the guards. They move in a grid, but only when you move. Any ideas how to accomplish that?

    Thank you.

  • Test when your player is moving not sure what method of input your using but you could create a variable and when you are moving for example keyboard w is down add sub event trigger once set value player moving to 1 then test if player moving is = to 1 on the enemy use path finding or whatever system you have in place then on w released same thing add sub event trigger once set player moving to 0

    Eaxample

    Add variable: player moving=0

    Set enemy pathfinding diagnols off so guards only move up and down

    W is down:

    Trigger once while true: set player moving =1

    W released:

    Trigger once while true: set player moving =0

    Player moving =1 : guard find path to

    Trigger once wherever. X .y

    Guard On path found:Move along path

    Player moving =0 Guard pathfinding stop

    Trigger once

    Note you could also do this with out the variable by searching for path when w is down trigger once in sub bracket

    Then on w release stop enemy path finding.

  • That sounds like it would work, but how do I do the grid movement?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you remove verticals from the path finding they will move in a grid like fashion under behaviors there is grid movement give the guards that behavior. There are some youtube videos on grid movement for construct 2 for enemy ai grid movement it depends how you want your enemies to move patrol a path or random.

    Sorry the behaviors official name is tile movement.

  • I just got an idea, but I might also look at the tutorials. Anyway, thank you for your time.

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