Discuss Scratch

fraaker456
Scratcher
41 posts

Help With Scrolling

Hello i am making a platformer and i wanted to make it scroll and zoom in to ap-pear bigger (zoom is easy just make them bigger with some script)
but tutorials make script on levels and movement whitch i have already done can anyone help! https://scratch.mit.edu/projects/963905027
MineTurte
Scratcher
500+ posts

Help With Scrolling

fraaker456 wrote:

Hello i am making a platformer and i wanted to make it scroll and zoom in to ap-pear bigger (zoom is easy just make them bigger with some script)
but tutorials make script on levels and movement whitch i have already done can anyone help! https://scratch.mit.edu/projects/963905027
What exactly is your problem? You said you followed tutorials on how to do it but don't say what exactly is wrong with the tutorials or what you did (other than the scrolling itself).

15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.

Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well

If I helped you out consider following Juni-Bug!


Select this + shift + down arrow = view rest of signature

This is JuniperActias. AKA Moth mommy.





Signature gradients here





If you found this secret; reply with ‘uwu’ with absolutely no context













fraaker456
Scratcher
41 posts

Help With Scrolling

I am trying to do scrolling on my platformer without changing my current movement code and my curent level sprite.
The videos make movement code with blocks like (CameraX,CameraY) but i just want to add a script to my current code and not replace it all.

https://scratch.mit.edu/projects/963905027
MineTurte
Scratcher
500+ posts

Help With Scrolling

fraaker456 wrote:

I am trying to do scrolling on my platformer without changing my current movement code and my curent level sprite.
The videos make movement code with blocks like (CameraX,CameraY) but i just want to add a script to my current code and not replace it all.

https://scratch.mit.edu/projects/963905027
Okay, i'll see what I can do.

15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.

Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well

If I helped you out consider following Juni-Bug!


Select this + shift + down arrow = view rest of signature

This is JuniperActias. AKA Moth mommy.





Signature gradients here





If you found this secret; reply with ‘uwu’ with absolutely no context













GrayDevScratch
Scratcher
16 posts

Help With Scrolling

If you want scrolling, make a separate script that just sets a variable for camera X to player X and another variable for camera Y to player Y, and then any time to make a go to X and Y block make sure its X - camera X and Y - camera Y. Basically just this:

when green flag clicked
forever
set [CameraX v] to (X)
set [CameraY v] to (Y)
end
go to x: ((X) - (CameraX)) y: ((Y) - (CameraY))

Last edited by GrayDevScratch (March 26, 2024 17:23:12)


Dash: https://scratch.mit.edu/projects/947055709/

If you ever feel stupid, remember that I exist.
MineTurte
Scratcher
500+ posts

Help With Scrolling

GrayDevScratch wrote:

If you want scrolling, make a separate script that just sets a variable for camera X to player X and another variable for camera Y to player Y, and then any time to make a go to X and Y block make sure its X - camera X and Y - camera Y. Basically just this:

when green flag clicked
forever
set [CameraX v] to (X)
set [CameraY v] to (Y)
end
go to x: ((X) - (CameraX)) y: ((Y) - (CameraY))
That's not what he wanted. This is what he wanted:
https://scratch.mit.edu/projects/990183048/

15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.

Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well

If I helped you out consider following Juni-Bug!


Select this + shift + down arrow = view rest of signature

This is JuniperActias. AKA Moth mommy.





Signature gradients here





If you found this secret; reply with ‘uwu’ with absolutely no context













GrayDevScratch
Scratcher
16 posts

Help With Scrolling

GrayDevScratch wrote:

If you want scrolling, make a separate script that just sets a variable for camera X to player X and another variable for camera Y to player Y, and then any time to make a go to X and Y block make sure its X - camera X and Y - camera Y. Basically just this:

when green flag clicked
forever
set [CameraX v] to (X)
set [CameraY v] to (Y)
end
go to x: ((X) - (CameraX)) y: ((Y) - (CameraY))
I forgot to mention make sure to add the go to x - scrollX and y - scrollY to the background too. also, you can make the camera smoother with some methods, and its reasonably easy to implement. but you will need to change all the regular x and y to variable versions, that way you can actually scroll. im pretty sure this is mandatory for scrolling.

Last edited by GrayDevScratch (March 27, 2024 02:04:03)


Dash: https://scratch.mit.edu/projects/947055709/

If you ever feel stupid, remember that I exist.
GrayDevScratch
Scratcher
16 posts

Help With Scrolling

MineTurte wrote:

GrayDevScratch wrote:

If you want scrolling, make a separate script that just sets a variable for camera X to player X and another variable for camera Y to player Y, and then any time to make a go to X and Y block make sure its X - camera X and Y - camera Y. Basically just this:

when green flag clicked
forever
set [CameraX v] to (X)
set [CameraY v] to (Y)
end
go to x: ((X) - (CameraX)) y: ((Y) - (CameraY))
That's not what he wanted. This is what he wanted:
https://scratch.mit.edu/projects/990183048/
oh wait i didnt see that till now, but i still think it would be the best to just use the system i suggested for ease of use later on.

Dash: https://scratch.mit.edu/projects/947055709/

If you ever feel stupid, remember that I exist.
MrKingofScratch
Scratcher
100+ posts

Help With Scrolling

for the zoom just multiply all movement and sizes by a zoom variable

for example make the position blocks
go to x: ((positionx) * (zoom)) y: ((positiony) * (zoom))

and the size would be
set size to ((size) * (zoom)) %

setting the zoom variable to 1 would make it normal size, and bigger numbers would zoom in, with smaller numbers zooming out.
I haven't done a project with zoom in a while and i didn't dig through my old code so correct me if there's any mistakes

Last edited by kaj (Tomorrow 00:00:00)
100th post!
fraaker456
Scratcher
41 posts

Help With Scrolling

MineTurte wrote:

GrayDevScratch wrote:

If you want scrolling, make a separate script that just sets a variable for camera X to player X and another variable for camera Y to player Y, and then any time to make a go to X and Y block make sure its X - camera X and Y - camera Y. Basically just this:

when green flag clicked
forever
set [CameraX v] to (X)
set [CameraY v] to (Y)
end
go to x: ((X) - (CameraX)) y: ((Y) - (CameraY))
That's not what he wanted. This is what he wanted:
https://scratch.mit.edu/projects/990183048/

i did not want this its just the level moves but not the player
fraaker456
Scratcher
41 posts

Help With Scrolling

GrayDevScratch wrote:

MineTurte wrote:

GrayDevScratch wrote:

If you want scrolling, make a separate script that just sets a variable for camera X to player X and another variable for camera Y to player Y, and then any time to make a go to X and Y block make sure its X - camera X and Y - camera Y. Basically just this:

when green flag clicked
forever
set [CameraX v] to (X)
set [CameraY v] to (Y)
end
go to x: ((X) - (CameraX)) y: ((Y) - (CameraY))
That's not what he wanted. This is what he wanted:
https://scratch.mit.edu/projects/990183048/
oh wait i didnt see that till now, but i still think it would be the best to just use the system i suggested for ease of use later on.

It dosent work are you sure it works cus i didnt work for me when i put
go to x: ((X) - (CameraX)) y: ((Y) - (CameraY))
In a forever block i didnt work
MineTurte
Scratcher
500+ posts

Help With Scrolling

fraaker456 wrote:

MineTurte wrote:

GrayDevScratch wrote:

If you want scrolling, make a separate script that just sets a variable for camera X to player X and another variable for camera Y to player Y, and then any time to make a go to X and Y block make sure its X - camera X and Y - camera Y. Basically just this:

when green flag clicked
forever
set [CameraX v] to (X)
set [CameraY v] to (Y)
end
go to x: ((X) - (CameraX)) y: ((Y) - (CameraY))
That's not what he wanted. This is what he wanted:
https://scratch.mit.edu/projects/990183048/

i did not want this its just the level moves but not the player
That's what scrolling is??

15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.

Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well

If I helped you out consider following Juni-Bug!


Select this + shift + down arrow = view rest of signature

This is JuniperActias. AKA Moth mommy.





Signature gradients here





If you found this secret; reply with ‘uwu’ with absolutely no context













fraaker456
Scratcher
41 posts

Help With Scrolling

well i don like it and i hate bitmap
fraaker456
Scratcher
41 posts

Help With Scrolling

What u did worked but

MineTurte wrote:

fraaker456 wrote:

MineTurte wrote:

GrayDevScratch wrote:

If you want scrolling, make a separate script that just sets a variable for camera X to player X and another variable for camera Y to player Y, and then any time to make a go to X and Y block make sure its X - camera X and Y - camera Y. Basically just this:

when green flag clicked
forever
set [CameraX v] to (X)
set [CameraY v] to (Y)
end
go to x: ((X) - (CameraX)) y: ((Y) - (CameraY))
That's not what he wanted. This is what he wanted:
https://scratch.mit.edu/projects/990183048/

i did not want this its just the level moves but not the player
That's what scrolling is??
What u did worked but it was a bitmap and it had infanite level witch i did not want
MineTurte
Scratcher
500+ posts

Help With Scrolling

fraaker456 wrote:

well i don like it and i hate bitmap
Well you can undo the bitmap? Just remake the map lol


Edit: It's not infinite? You asked for scrolling I gave you scrolling lol.

Last edited by MineTurte (March 27, 2024 13:50:55)


15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.

Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well

If I helped you out consider following Juni-Bug!


Select this + shift + down arrow = view rest of signature

This is JuniperActias. AKA Moth mommy.





Signature gradients here





If you found this secret; reply with ‘uwu’ with absolutely no context













fraaker456
Scratcher
41 posts

Help With Scrolling

So i put it in my game but i need a litle help

There are many bugs with my animation and the scripts arent working
MineTurte
Scratcher
500+ posts

Help With Scrolling

fraaker456 wrote:

So i put it in my game but i need a litle help

There are many bugs with my animation and the scripts arent working
Yes I know the bugs with the animation but I was originally thinking you could fix it… Also what scripts in particular?

15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.

Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well

If I helped you out consider following Juni-Bug!


Select this + shift + down arrow = view rest of signature

This is JuniperActias. AKA Moth mommy.





Signature gradients here





If you found this secret; reply with ‘uwu’ with absolutely no context













fraaker456
Scratcher
41 posts

Help With Scrolling

the blob sprite wont touch the level just floats
fraaker456
Scratcher
41 posts

Help With Scrolling

ok i fixed it but i need to make it to where it dosent phase trough the ground
MineTurte
Scratcher
500+ posts

Help With Scrolling

fraaker456 wrote:

ok i fixed it but i need to make it to where it dosent phase trough the ground
It usually shouldn't…

15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.

Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well

If I helped you out consider following Juni-Bug!


Select this + shift + down arrow = view rest of signature

This is JuniperActias. AKA Moth mommy.





Signature gradients here





If you found this secret; reply with ‘uwu’ with absolutely no context













Powered by DjangoBB