Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flag system, chaning the .mask tile
#1
So basically this is the concept.

Someone from team A touches a flag on the map. It turns red.

Someone later comes along from team B and the flag turns green.

Later on the flag is touched by someone belonging to no team, and the flag turns gray (neutral).

I have the code done for this using a flag type and an alignment variable in the player type, and a TILE_TYPE_FLAG constant so that the mappers can place flags on certain maps.

My problem is changing the mask tile that the flag is on when it is touched, to correspond with the team color that touched it.

I have the red flag, green flag, and gray flag in the first 3 32x32 spot of the tile set, like so:

[Image: sampleyq4.png]

So I want it to so this. When the flag is nuetral, the .mask image for the tile should be the gray flag, and when someone comes along and touches, say from the red team, it changes the .mask tile to the red flag.

How can I do this? I am very bad when it comes to image work, especially with mirage so any help would be appreciated.

I figured putting some code in the gameloop sub might work the best, using an if statement as such:

Code:
For y = 0 To MAX_MAPY
                For x = 0 To MAX_MAPX
                    With map(GetPlayerMap(MyIndex)).Tile(x, y)
                        If .Type = TILE_TYPE_FLAG Then
                            If GetFlagValue(GetPlayerMap(MyIndex)) = FLAG_NONE Then
                                .Mask = FLAG TILE
                            End If
                        End If
                    End With
                Next x
            Next y

My problem is choosing the right tiles. I don't understand the mapping side of the mirage source as well as I probably should... obviously. So, any help? Or perhaps a better way of doing this?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)