Discuss Scratch

Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

Hello, does anybody here know how to make a simple scrolling code?
Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

say [hello]
FlayFlyAnimations
Scratcher
100+ posts

How to make a Scrolling code?

you mean a scrolling platformer? please clarify
Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

So far i have this:
forever
change [Scrollx v] by (1)
end

forever
go to x: (Scrollx) y: (0)
end
Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

FlayFlyAnimations wrote:

you mean a scrolling platformer? please clarify
yes i mean i have the platformer code i just need the scrolling code
Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

Thanks for helping

Last edited by Thomasschirmer (Sept. 14, 2021 23:56:28)

Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

Now this:

forever
if <key [Left arrow v] pressed?> then
change [Scrollx v] by (-1)
end

forever
if <key [Right arrow v] pressed?> then
change [Scrollx v] by (1)
end

Last edited by Thomasschirmer (Sept. 15, 2021 00:01:31)

Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

forever
if <key [Up arrow v] pressed?> then
change [Scroll y v] by (5)
end
end
Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

forever
go to x: (Scroll x) y: (Scroll y)
end
FlayFlyAnimations
Scratcher
100+ posts

How to make a Scrolling code?

there are a lot of options, first, check griffpatch’s youtube tutorial series. you could also check the wiki page (this is simpler but you wont learn anything). ill also mention this is a copy of this topic. next time - please check the other forums before creating a new one
Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

FlayFlyAnimations wrote:

there are a lot of options, first, check griffpatch’s youtube tutorial series. you could also check the wiki page (this is simpler but you wont learn anything). ill also mention this is a copy of this topic. next time - please check the other forums before creating a new one
ok i will, sorry i am a bit new to this, thanks for your help!
FlayFlyAnimations
Scratcher
100+ posts

How to make a Scrolling code?

Thomasschirmer wrote:

FlayFlyAnimations wrote:

there are a lot of options, first, check griffpatch’s youtube tutorial series. you could also check the wiki page (this is simpler but you wont learn anything). ill also mention this is a copy of this topic. next time - please check the other forums before creating a new one
ok i will, sorry i am a bit new to this, thanks for your help!

Amruth_Harshith
Scratcher
3 posts

How to make a Scrolling code?

Bro first create 2 global variables scroll x and scroll y then do the code
Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

* wrote:

Bro first create 2 global variables scroll x and scroll y then do the code
Ok i have done it now:

when green flag clicked
forever
if <key [Left arrow v] pressed?> then
change [Scrollx v] by (5)

end
if <key [Right arrow v] pressed?> then
change [Scrollx v] by (-5)
end
end


when green flag clicked
forever
set x to (Scrollx)
end
Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

* wrote:

Bro first create 2 global variables scroll x and scroll y then do the code

Is this right? (its for a scrolling platformer)











Last edited by Thomasschirmer (Sept. 15, 2021 21:59:17)

ti2v78
New Scratcher
8 posts

How to make a Scrolling code?

What are you scrolling? The whole background? Your character? A cloned pixel?

Move right 5

change x by (5)

That's a pretty simple thing - no variables needed. Want to bind it to a key?

when key pressed
change x by (5)


Want to have it move to the right from the start until it hits the right side? (the following is NOT using a “forever” block, because too many of these is bad)

when green flag clicked
repeat <(x position) = [250]>
change x by (5)
end

Last edited by ti2v78 (Sept. 15, 2021 22:31:20)

ti2v78
New Scratcher
8 posts

How to make a Scrolling code?

Ugh … the move on key:

when [Right Arrow v] key pressed
change x by (5)

And an appropriate repeat (until, with a > instead of an =, so it always finds an end point)

when green flag clicked
repeat until <(x position) > [220]>
change x by (5)
end

Last edited by ti2v78 (Sept. 15, 2021 22:33:49)

FlayFlyAnimations
Scratcher
100+ posts

How to make a Scrolling code?

why are people still posting here? his problem is resolved - so please stop bumping this topic. @Thomasschirmer please close this topic
Thomasschirmer
Scratcher
26 posts

How to make a Scrolling code?

FlayFlyAnimations wrote:

why are people still posting here? his problem is resolved - so please stop bumping this topic. @Thomasschirmer please close this topic
How do you?
FlayFlyAnimations
Scratcher
100+ posts

How to make a Scrolling code?

Thomasschirmer wrote:

FlayFlyAnimations wrote:

why are people still posting here? his problem is resolved - so please stop bumping this topic. @Thomasschirmer please close this topic
How do you?

there should be a button at the top that says “close topic”

Powered by DjangoBB