How do I count each movement / action as a turn?

0 favourites
  • 7 posts
From the Asset Store
A well commented RPG game template to learn from or use as a base for your own game!
  • I have a tile map that is the movement grid and I would like every tile to count as a turn. Also every action lets say a attack count as a turn. I have a global value of "game_turn" and the movement is done with a tween action. You can move multi tile map squares at once but I want each one to count as a "turn." on end of tween works a little but not for multi tile map tiles.... Any ideas? I haven't even addressed the attack or other actions as turns yet. Can someone point me in the right direction to solve this? Thanks.

  • You can move multi tile map squares at once but I want each one to count as a "turn."

    Do you want to allow moving multiple tiles at once? Then calculate the distance, divide by tile size and you get the number of turns. Add it to the variable.

  • what id do. give each player instant variables. set to the tile they are on at the start of the turn (tilex*(tile width))

    then, when move turn is over. and its battle turn:

    so work out how many tiles they moved by their current positional tile to the saved original tile variables.

    this will count as a direct route.. might not consider obstacles..

    then count this movement score from their action points.

  • re reading it as turns. not a point based move attack system.

    but still. that will give you "turns" 4 turns.

    just a solution to a posted problem. if you want them all to pathfind, thats a bit more in depth

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks all for the interesting ideas. I'll keep eating away at it. Every time I think I have it right I'm able to break the turn count in some way. If I create a 2px transparent sprite on each tile-map it works great (on overlap) however that's lots of sprites. Only reason I tried that is its an isometric layout not a square checkerboard layout.

  • mate, gimmi a shout and ill try it when im sober/ the morning

  • Heroes4hire

    Here is a striped down C3P (Sorry its a bit messy) Bloated but it works...

    1drv.ms/u/s!AjhAqDbxsedphq9QupnIpf9uwAgiVw

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