Change width attribute as other object gets closer for partially hidden mini-map

scitunesscitunes Member, Sous Chef Posts: 4,047
edited November -1 in Working with GS (Mac)
I am trying to create a mini-map that only shows a small window around the main player's dot. I could create a png file with a transparent window "cut out" of the middle of a solid rectangle but you would see the outer edges of the rectangle moving around and obstructing the playing screen. So I thought if I create a right, left, top and bottom rectangle I could constrain or change the width and location of each bar so that as you get closer to a bar it gets skinnier (and moves away from the player dot to compensate for the fact that the bar gets skinnier relative to the middle of the bar not the outer edge) and as you get farther from a bar it gets wider. If I get the math right it should look like a transparent "window" following the player around so that you can only see the part of the maze that you are in and not the entire maze. I am working on this for a game in progress, but I am trying to figure out the coding in a sample file. If I get it working I will upload it and allow access to the project file. It seems like this would be a good addition to any maze style game. Any help from more math inclined people would be much appreciated!

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Codemonkey,

    possible tip of the day?

    hint, hint...
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Anybody out there have a maze game in the works with a mini-map? Any ideas on how to create a "screen" over the mini map that only shows a small cutout around the player dot?
Sign In or Register to comment.