Discuss Scratch

tyranuscrafter
Scratcher
25 posts

Scrolling Menus

Im making a clicker with a upgrade menu but idk how to make a scrolling one. Here is the problem: I was creating a new upgrade but i realized that the menu was so small, so i do it bigger, and bigger, and bigger, and i run out of space. So i think that a scrolling menu would be nice, but i never did.

I make cool games.
MCfanTJK
Scratcher
18 posts

Scrolling Menus

Can you give me the project link?

when green flag clicked
forever
make projects
wait for nobody to play it
end
tyranuscrafter
Scratcher
25 posts

Scrolling Menus

MCfanTJK wrote:

Can you give me the project link?
It isn't shared

I make cool games.
orangetheory
Scratcher
500+ posts

Scrolling Menus

Here is an example of a scrolling menu (except it is levels) but it can be easily inputted into your game. (I suggest using the same cloning technique so multiple objects can be clicked but in the same sprite.)
just press the play button, and use the arrow keys to scroll around the levels.
https://scratch.mit.edu/projects/551101283/
What we do in the above project is that we make a costume, almost 10x bigger than the original, or bigger (the bigger the better, but the laggier), and we switch to that costume. But in the next frame, we switch back to the level costume, and doing this you can only see the levels costume. Why do we do this? We did this because bigger objects can scroll much farther off the screen than smaller ones.
Then, how do we make the sprites scroll? We can do this with this simple technique:
when green flag clicked
forever
switch costume to [big v]
go to x: ((scroll x) - (my x)) y: ((scroll y) - (my y))
switch costume to [main v]
end

The scroll x stays at it's value, but we subtract the my x/y from it to get the global value. Oh, and make sure the my x/y variable is for this sprite only, or local.

After this just put in your regular scripts for the shop.

-Frisbee- -Cricket--Basketball--Forums--Mapping--Coding--Trigonometry master--Mathematics King--Future Prime Minister--Intro-Maker-
I know HTML/CSS, and JavaScript, and with these coding skills I have made some decent projects! Test them out below!
~Archery~Cops + Robbers~
Want an intro, outro, music, effects, or more? Check out the intro shop!

The forum helpers, a place where we help people in the forums
tyranuscrafter
Scratcher
25 posts

Scrolling Menus

orangetheory wrote:

Here is an example of a scrolling menu (except it is levels) but it can be easily inputted into your game. (I suggest using the same cloning technique so multiple objects can be clicked but in the same sprite.)
just press the play button, and use the arrow keys to scroll around the levels.
https://scratch.mit.edu/projects/551101283/
What we do in the above project is that we make a costume, almost 10x bigger than the original, or bigger (the bigger the better, but the laggier), and we switch to that costume. But in the next frame, we switch back to the level costume, and doing this you can only see the levels costume. Why do we do this? We did this because bigger objects can scroll much farther off the screen than smaller ones.
Then, how do we make the sprites scroll? We can do this with this simple technique:
when green flag clicked
forever
switch costume to [big v]
go to x: ((scroll x) - (my x)) y: ((scroll y) - (my y))
switch costume to [main v]
end

The scroll x stays at it's value, but we subtract the my x/y from it to get the global value. Oh, and make sure the my x/y variable is for this sprite only, or local.

After this just put in your regular scripts for the shop.

Thanks!!
But…
What can i do if the sprite is allways changing the costume with another script??
when green flag clicked
forever
if <touching [ mouse pointer] ?> then


switch costume to [ v]

else
switch costume to [ v]
end
end

I make cool games.
tyranuscrafter
Scratcher
25 posts

Scrolling Menus

tyranuscrafter wrote:

orangetheory wrote:

Here is an example of a scrolling menu (except it is levels) but it can be easily inputted into your game. (I suggest using the same cloning technique so multiple objects can be clicked but in the same sprite.)
just press the play button, and use the arrow keys to scroll around the levels.
https://scratch.mit.edu/projects/551101283/
What we do in the above project is that we make a costume, almost 10x bigger than the original, or bigger (the bigger the better, but the laggier), and we switch to that costume. But in the next frame, we switch back to the level costume, and doing this you can only see the levels costume. Why do we do this? We did this because bigger objects can scroll much farther off the screen than smaller ones.
Then, how do we make the sprites scroll? We can do this with this simple technique:
when green flag clicked
forever
switch costume to [big v]
go to x: ((scroll x) - (my x)) y: ((scroll y) - (my y))
switch costume to [main v]
end

The scroll x stays at it's value, but we subtract the my x/y from it to get the global value. Oh, and make sure the my x/y variable is for this sprite only, or local.

After this just put in your regular scripts for the shop.

Thanks!!
But…
What can i do if the sprite is allways changing the costume with another script??
when green flag clicked
forever
if <touching [ mouse pointer] ?> then


switch costume to [ v]

else
switch costume to [ v]
end
end
Ok i found the solution, thanks!!

I make cool games.

Powered by DjangoBB