Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Movement in grid-based strategy games

Years of Service
User Offline
Joined: 30th Sep 2009
Posted: 30th Sep 2009 17:39
I'd like to make a game similiar to Fire Emblem and FFT. I'm stuck, however, with setting up where a unit can move to. I can calculate the movement range itself easy enough, but when you throw in the enemies and terrain costs, it becomes tricky. Anybody have any ideas on this?

Also, I'm guessing this is the right section, sorry if it's not...
Pincho Paxton
Years of Service
User Offline
Joined: 8th Dec 2002
Posted: 30th Sep 2009 18:45 Edited at: 30th Sep 2009 18:46
I don't know much about Fire Emblem, but I can see that it is a grid. It seems that you are saying that each tile of the grid has values associated with it.

The Grid...

Dim Map(X,Y)

A grid with values

Dim Map(X,Y,Values)

Values could be Terrain Type, Water etc, rocks, and Enemy Position.

So Dim map(1000,1000,2) = X,Y,Terrain/Enemy No.

Walking from A to B with enemy in-between.

What you would be doing is just pausing. So A might be 50,50, and B might be 55,50. If 53 = Enemy position, you would still be in the walking loop, but the loop would not have been returned yet, so the X isn't being updated until you win the fight.

Login to post a reply

Server time is: 2023-01-29 05:22:22
Your offset time is: 2023-01-29 05:22:22