| Mirage Source http://www.miragesource.net/forums/ |
|
| Flag system, chaning the .mask tile http://www.miragesource.net/forums/viewtopic.php?f=201&t=1808 |
Page 1 of 1 |
| Author: | Leighland [ Thu May 17, 2007 4:54 am ] |
| Post subject: | Flag system, chaning the .mask tile |
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:
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? |
|
| Author: | Dragoons Master [ Thu May 17, 2007 11:28 pm ] |
| Post subject: | |
That seams to be ok but I think it would be better if you don't change the .mask stuff, becouse there may be a few problems with that. Just right before the bltmask stuff, easy to find in gameloop, add a new blit that blits this thing to the screen. Maybe a maptiletype would be easier. About the img stuff, I mean you said you don't know it, just take a look at bltplayer and try to blit yhe same way that thing is done. Good lukc, it seams to be quite fun ^^ |
|
| Author: | Leighland [ Thu May 17, 2007 11:33 pm ] |
| Post subject: | |
Thanks, I got it working though. Minor bugs here and there but that is to be expected right :p. Works somewhat how I imagined but again not perfect. Maybe I'll throw up a tutorial for tihs after i get it all working right ... since it is kind of fun, and highly competative. |
|
| Author: | Tony [ Sat May 19, 2007 10:33 am ] |
| Post subject: | |
Looks easy to do. But great concept. I like it<3 Yee should do a point system as well :p |
|
| Author: | Coke [ Sat Jun 16, 2007 8:17 pm ] |
| Post subject: | Re: Flag system, chaning the .mask tile |
That would be great, mixed with a guild system, combat arena guild battles with flags would be hilariouse! |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|