Help With Scrolling

id: 750328

category: Help with Scripts

posts: 34

fraaker456 fraaker456 loading
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 MineTurte loading

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).
fraaker456 fraaker456 loading
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 MineTurte loading

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.
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))
MineTurte MineTurte loading

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/

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.

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.
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
fraaker456 fraaker456 loading

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 fraaker456 loading

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 MineTurte loading

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??
fraaker456 fraaker456 loading
well i don like it and i hate bitmap
fraaker456 fraaker456 loading
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 MineTurte loading

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.
fraaker456 fraaker456 loading
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 MineTurte loading

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?
fraaker456 fraaker456 loading
the blob sprite wont touch the level just floats
fraaker456 fraaker456 loading
ok i fixed it but i need to make it to where it dosent phase trough the ground
MineTurte MineTurte loading

fraaker456 wrote:

ok i fixed it but i need to make it to where it dosent phase trough the ground
It usually shouldn't…
fraaker456 fraaker456 loading
it does a lil
fraaker456 fraaker456 loading
So can anyone help with this problem
Phase through ground
Phase through platforms
fraaker456 fraaker456 loading
NEVER MIND I FIXED IT CRedit to the um guy who umm errrr made fixeed
MineTurte MineTurte loading

fraaker456 wrote:

NEVER MIND I FIXED IT CRedit to the um guy who umm errrr made fixeed
Me?
fraaker456 fraaker456 loading
But i am now making a goal flag still need help with scrool related thing but now making flag do fland things
MineTurte MineTurte loading

fraaker456 wrote:

But i am now making a goal flag still need help with scrool related thing but now making flag do fland things
I can add a flag for you if you'd like. A win flag correct? Like you get to it and touch it and you either go to the next level or just win?
Nt3_m Nt3_m loading
steal code from griffpatch
fraaker456 fraaker456 loading

MineTurte wrote:

fraaker456 wrote:

But i am now making a goal flag still need help with scrool related thing but now making flag do fland things
I can add a flag for you if you'd like. A win flag correct? Like you get to it and touch it and you either go to the next level or just win?
Yea i made one but it dosent stay in the same place you can do that thanks!
fraaker456 fraaker456 loading
i made a start menu
MineTurte MineTurte loading

fraaker456 wrote:

i made a start menu
Okay. Sorry I forgot about the flag lol. I'll do it now!
MineTurte MineTurte loading

fraaker456 wrote:

i made a start menu
https://scratch.mit.edu/projects/991456055/

Here you go.
fraaker456 fraaker456 loading
Thanks You Willl be in my credits Wait how do i make it chage depending on levels its only for level 2
fraaker456 fraaker456 loading
Nvm it work just ^
|