Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Scrolling map
- lwell72
-
100+ posts
Scrolling map
Is there a way to make a little map at the side of your game showing whats going on in your scrolling game?
- deck26
-
1000+ posts
Scrolling map
Depends what you want it to show probably. A full map (reduced size) with a rectangle showing where you are should be easy enough. Is there a way to make a little map at the side of your game showing whats going on in your scrolling game?
- gtoal
-
1000+ posts
Scrolling map
try to implement it using the same code for both the main map and the mini map, just a change of scale parameter and positioning,
- Uniquename1
-
100+ posts
Scrolling map
I decided to add one to one of my games. Wasn't too difficult. Took a few leaps of faith. Probably reinvented ratios not sure was never good with those.
Pretty simple script in a sprite called map gps.
https://scratch.mit.edu/projects/167457622/#player
First i decided my map would be 80 pixels long. Then i found how many x's in my scroll world. Roughly 0x to -4317x and 0y to-3240y. So I figured there is 54 scrollx's per increment of my mini map by dividing scroll max by # of incrments or 4317/80. So I figure when my scroll x is way left say at 1 or up to 54 the minimap should be at the way left at 1 of its area. then i just decided to say how if at 1minimap then scrollx =54 so scrollx=108 is 2 on the minimap etc. That ended up meaning that the absolute value of scrollx/ 54 = minimap position. Then to start my minimap i just added or subtracted how far over to where i wanted it to start. It just happened that i put the actual map at x: 160 y: -160 at it's lowest left hand point. I chose them as multiples of 80 but didn't really need it as i could just add or subtract any number to move the minimaps boundaries wherever.
Could have maybe used 100 instead of 80 but that wouldn't be anymore of a round # in the end. Oddly since my Y is not the same width as my x. I first plugged the same 54# into it and it worked. I later tried to change it to 60 I thought to match it's different length but that messed it up so idk what that means. Works though using the same # for both.
Pretty simple script in a sprite called map gps.
https://scratch.mit.edu/projects/167457622/#player
First i decided my map would be 80 pixels long. Then i found how many x's in my scroll world. Roughly 0x to -4317x and 0y to-3240y. So I figured there is 54 scrollx's per increment of my mini map by dividing scroll max by # of incrments or 4317/80. So I figure when my scroll x is way left say at 1 or up to 54 the minimap should be at the way left at 1 of its area. then i just decided to say how if at 1minimap then scrollx =54 so scrollx=108 is 2 on the minimap etc. That ended up meaning that the absolute value of scrollx/ 54 = minimap position. Then to start my minimap i just added or subtracted how far over to where i wanted it to start. It just happened that i put the actual map at x: 160 y: -160 at it's lowest left hand point. I chose them as multiples of 80 but didn't really need it as i could just add or subtract any number to move the minimaps boundaries wherever.
Could have maybe used 100 instead of 80 but that wouldn't be anymore of a round # in the end. Oddly since my Y is not the same width as my x. I first plugged the same 54# into it and it worked. I later tried to change it to 60 I thought to match it's different length but that messed it up so idk what that means. Works though using the same # for both.
Last edited by Uniquename1 (Oct. 31, 2017 19:25:45)
- Taco_Studios789
-
3 posts
Scrolling map
Can you help me make a scolling platformer? the map wont expand
- deck26
-
1000+ posts
Scrolling map
Create a new topic please rather than necroposting. Can you help me make a scolling platformer? the map wont expand
- Scratchmk17610
-
14 posts
Scrolling map
I cant make a scrolling game on my own. Is this the code of the sprite
in the map -
- The_Imaginarium
-
1000+ posts
Scrolling map
https://scratch.mit.edu/discuss/topic/355062/
Please refrain from necroposting.
Please refrain from necroposting.
- The_Imaginarium
-
1000+ posts
Scrolling map
Please don't reply that image to people new to the forums. It is very discouraging, and it feels like someone is telling at you. snip
Last edited by The_Imaginarium (May 9, 2021 11:46:49)
- Discussion Forums
- » Help with Scripts
-
» Scrolling map