GRID?

For questions about using Classic.

Post » Tue Nov 25, 2008 2:48 pm

Well i would need to make somekind of grid movement to my new game its strategy game where u command ur troops in country and the country is divided into a sectors which you need to conquer and for that i need grid movement. So is it even possible and if it is how can i do that?
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Tue Nov 25, 2008 4:31 pm



Okay here's a pretty basic explanation based on a 64x64 grid:

1. You select the unit (which has a green border or indicator that he can move)

2. Four Arrow detectors are created at it's sides:
Up: Unit.Y - 64
Left: Unit.X - 64
Right: Unit.X + 64
Down: Unit.Y + 64

3. IF the arrow overlaps harsh terrain (rock/lava/water, ect) set the arrow to Red (False) + indicate that movement is not allowed.

4. User clicks on a arrow + Arrow is Green (True)
Up: Set Unit.Y to Unit.Y - 64
Left: Set Unit.X Unit.X - 64
Right: Set Unit.X to Unit.X + 64
Down: Set Unit.Y to Unit.Y + 64

Is that what you kinda need?
B
13
S
3
G
5
Posts: 286
Reputation: 3,193

Post » Tue Nov 25, 2008 9:40 pm

set position to

(go.x,go.y is where you want it to be closest to on your grid,)

set x to: round(go.x/64)*64
set y to: round(go.y/64)*64

thats basically it
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Wed Nov 26, 2008 8:27 am

Okay taht shuld work ty for help
B
11
S
3
G
4
Posts: 622
Reputation: 3,186


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest