Discuss Scratch

absmrg
Scratcher
25 posts

Help with resizing

So Ive run into a very complicated problem. Any help would be appreciated, as I really cant work this out…

Problem:
Heres the issue. Im making a in-game map in a game I'm making. You can use arrow keys to move the map, and the scroll wheel to zoom. There is a player marker on the map for where the player is in the world. When the map is zoomed in and out, the player marker should stay in the same place on the map. It does do this, but when the map is zoomed in far enough, the player marker stops doing this.

Things Ive tried:
I tried drawing a big invisible square around the player marker costume to change its size. This increased the zoom amount required for the positioning to stop working. However, this means that the player marker appears much smaller on the map, which I do not want. I cannot increase its size, because it hits Scratch's sprite size limit (which is in relation to the size of the costume). I also observed that (when keeping the map zoom constant) this happens at a lower zoom the further from the centre of the map you go.

Link:
Here is the project link if you want to check it out: https://scratch.mit.edu/projects/531137179/editor/
The sprites related to the map are the last two on the list. To access the map in-game, click ‘Play Offline’ then the M key when it
loads.

Last edited by absmrg (July 2, 2021 20:22:45)

Thingied
Scratcher
1000+ posts

Help with resizing

woah that's a clean OP and project
So I think it's the map that's not changing size. After a bit of scrolling the map stops moving so I think this is probably the case. So what we have to do is bypass the size cap which is pretty simple.
costume1 is already blank so just use that
more info

Last edited by Thingied (July 2, 2021 18:39:19)

absmrg
Scratcher
25 posts

Help with resizing

Thingied wrote:

woah that's a clean OP and project
So I think it's the map that's not changing size. After a bit of scrolling the map stops moving so I think this is probably the case. So what we have to do is bypass the size cap which is pretty simple.
costume1 is already blank so just use that
more info

Ok, ill try it

Last edited by absmrg (July 2, 2021 18:48:14)

absmrg
Scratcher
25 posts

Help with resizing

Thingied wrote:

woah that's a clean OP and project
So I think it's the map that's not changing size. After a bit of scrolling the map stops moving so I think this is probably the case. So what we have to do is bypass the size cap which is pretty simple.
costume1 is already blank so just use that
more info

Hm, It seems that this is not the problem. I have tried it and it does not have any effect. Note that the problem only happens when the player is towards
the edge of the world. I have made it spawn the player in the position where it happens now, in case you have any other ideas

The map stops moving because I have a cap on how far you can zoom in.

Last edited by absmrg (July 2, 2021 18:51:52)

Thingied
Scratcher
1000+ posts

Help with resizing

absmrg wrote:

Hm, It seems that this is not the problem. I have tried it and it does not have any effect.
It definitely fixed it for me…

absmrg wrote:

I have made it spawn the player in the position where it happens now, in case you have any other ideas
Can you save the project? It won't show if you don't.
absmrg
Scratcher
25 posts

Help with resizing

Thingied wrote:

absmrg wrote:

Hm, It seems that this is not the problem. I have tried it and it does not have any effect.
It definitely fixed it for me…

absmrg wrote:

I have made it spawn the player in the position where it happens now, in case you have any other ideas
Can you save the project? It won't show if you don't.

My mistake, I had a second script running for player pos reset. It will spawn you at the top now (Ive tested this while signed out). The fix does not work, I tested it again. Thanks for the help!

Last edited by absmrg (July 2, 2021 19:20:04)

Thingied
Scratcher
1000+ posts

Help with resizing

Fixed version:

I don't really know what was causing the bug but all I know is that the above fixes it.

Powered by DjangoBB