Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Need help on making a scrolling map
- Alihene222
-
12 posts
Need help on making a scrolling map
So recently I wanted to make a scrolling map for an rpg game. I have made a decent small map with controls, but I just can't understand how to make other sprites scrolling as well. I want a separate door sprite in a specific place of my map, but I have no idea how it is done and I cannot find tutorials on youtube. This is my current project: https://scratch.mit.edu/projects/546264318 All help is appreciated. Thanks in advance.
Last edited by Alihene222 (June 19, 2021 12:57:56)
- BatteRaquette58
-
100+ posts
Need help on making a scrolling map
Watch a tutorial by Griffpatch called “Scrolling Background” on Youtube. It uses a sprite for a background so you can do the same with your sprites.
Hope this helped!
Hope this helped!
- Alihene222
-
12 posts
Need help on making a scrolling map
It didn't help much because all I want is to move multiple sprites at the same time and have them remain in their position on the moving map. Watch a tutorial by Griffpatch called “Scrolling Background” on Youtube. It uses a sprite for a background so you can do the same with your sprites.
Hope this helped!
- Yusei-Fudo
-
1000+ posts
Need help on making a scrolling map
It didn't help much because all I want is to move multiple sprites at the same time and have them remain in their position on the moving map.
I can help with that. Give me a few minutes.
- Yusei-Fudo
-
1000+ posts
Need help on making a scrolling map
Ok, I'm back.
Do this:
First, create a new variable named x and y “For this sprite only”. Do it for all sprites:


Then, assign a value to each x and y variables of each sprite. They control where a sprite “will be” on a scrolling level.
Then, make 2 variables named SCROLL X AND SCROLL Y “For all sprites”


Then, you can create your own scripts to change those variables (if you need a guide for that too, I can help with that as well)
After that, do these scripts:

That script is used to position sprites and hide them when “off screen”.

Then, you should see the go to ()() block like the one at the bottom of the last picture.
Drag it out, and create this:
Hope this helps you.
IF ANYONE IS GOING TO QUOTE THIS, PLEASE REMOVE THE IMAGE URLS.
Do this:
First, create a new variable named x and y “For this sprite only”. Do it for all sprites:


Then, assign a value to each x and y variables of each sprite. They control where a sprite “will be” on a scrolling level.
Then, make 2 variables named SCROLL X AND SCROLL Y “For all sprites”


Then, you can create your own scripts to change those variables (if you need a guide for that too, I can help with that as well)
After that, do these scripts:

That script is used to position sprites and hide them when “off screen”.

Then, you should see the go to ()() block like the one at the bottom of the last picture.
Drag it out, and create this:
Hope this helps you.
IF ANYONE IS GOING TO QUOTE THIS, PLEASE REMOVE THE IMAGE URLS.
- Alihene222
-
12 posts
Need help on making a scrolling map
Sorry for late response, but thanks! Ok, I'm back.
Do this:
First, create a new variable named x and y “For this sprite only”. Do it for all sprites:
Then, assign a value to each x and y variables of each sprite. They control where a sprite “will be” on a scrolling level.
Then, make 2 variables named SCROLL X AND SCROLL Y “For all sprites”
Then, you can create your own scripts to change those variables (if you need a guide for that too, I can help with that as well)
After that, do these scripts:
That script is used to position sprites and hide them when “off screen”.
Then, you should see the go to ()() block like the one at the bottom of the last picture.
Drag it out, and create this:
Hope this helps you.
IF ANYONE IS GOING TO QUOTE THIS, PLEASE REMOVE THE IMAGE URLS.
Last edited by Alihene222 (July 2, 2021 20:21:14)
- QuickMuffin8782
-
26 posts
Need help on making a scrolling map
You will also need this event as it helps your game big time. Griffpatch used this event:
- Thingied
-
1000+ posts
Need help on making a scrolling map
You don't need it, it's optional. You can just use a standard forever loop and get the same result. You will also need this event as it helps your game big time. Griffpatch used this event:
Last edited by Thingied (July 2, 2021 22:35:19)
- Alihene222
-
12 posts
Need help on making a scrolling map
Ok, I'm back.
Do this:
First, create a new variable named x and y “For this sprite only”. Do it for all sprites:
Then, assign a value to each x and y variables of each sprite. They control where a sprite “will be” on a scrolling level.
Then, make 2 variables named SCROLL X AND SCROLL Y “For all sprites”
Then, you can create your own scripts to change those variables (if you need a guide for that too, I can help with that as well)
After that, do these scripts:
That script is used to position sprites and hide them when “off screen”.
Then, you should see the go to ()() block like the one at the bottom of the last picture.
Drag it out, and create this:
Hope this helps you.
IF ANYONE IS GOING TO QUOTE THIS, PLEASE REMOVE THE IMAGE URLS.
I need help with the scripts to change the variables since I am still a bit confused. Thanks in advance.
Edit: I'm back and I figured it out. Thanks for the scrolling guide though.
Last edited by Alihene222 (July 3, 2021 10:56:56)
- Discussion Forums
- » Help with Scripts
-
» Need help on making a scrolling map