This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-08-13 09:57:33

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Scroll-X-Velocity

Help I REALLY, [excess "REALLY"s removed by moderator], need help with ScrollVelocity.....
..... i want to scroll using velocity but...  IT DIDN'T WORK!

when gf clicked
think [Help A Guy Out !] for (3) secs
dance for {87} mins

Last edited by Paddle2See (2012-08-14 17:44:47)


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#2 2012-08-13 10:32:45

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: Scroll-X-Velocity

You can check out the method that I used in my platformer Stik.  smile


http://i50.tinypic.com/312u714.jpg

Offline

 

#3 2012-08-13 12:38:12

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Scroll-X-Velocity

Woah! How many "REALLY"'s is that?  smile
BirdByte's platformer is a great example. Here is the most common way to do it (for the character/non-terrain sprite):

when gf clicked
forever
if <key [right-arrow v] pressed?>
change [x-vel v] by (-0.2) // any negative number works
end
if <key [left-arrow v] pressed?>
change [x-vel v] by (0.2) // any positive number works
end
change [scroll-x v] by (x-vel)
set (x-vel) to ((x-vel) * (0.87))
end
the last line (set x-vel...) is to give the velocity a decreasing speed. The number could be as much as 0.99 (1 or over causes an error) or as little as 0.85. Whatever you want the range of speed to be.

Hope this helps!


http://i48.tinypic.com/2072ctw.gif

Offline

 

#4 2012-08-14 14:06:10

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Re: Scroll-X-Velocity

I'll try it now and there are so many 'REALLY''s that i forgot how to count


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#5 2012-08-14 14:09:17

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Re: Scroll-X-Velocity

I'll try it now and there are so many 'REALLY''s that i forgot how to count


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#6 2012-08-14 14:10:30

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Scroll-X-Velocity

Jodymoses wrote:

I'll try it now and there are so many 'REALLY''s that i forgot how to count

lol
thought so  smile


http://i48.tinypic.com/2072ctw.gif

Offline

 

#7 2012-08-16 11:49:44

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Re: Scroll-X-Velocity

It doesnt bring your sprite back to the center


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#8 2012-08-16 11:53:46

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Scroll-X-Velocity

What do you mean?


http://i48.tinypic.com/2072ctw.gif

Offline

 

#9 2012-08-16 12:44:13

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Re: Scroll-X-Velocity

You touch the edge and then you don't smoothly move back to x 0


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#10 2012-08-18 03:28:26

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Re: Scroll-X-Velocity

Can anyone please give me a script for that?                             

              when gf clicked           say (can anyone help) for (3) secs                    stop script                    


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#11 2012-08-18 03:30:49

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Re: Scroll-X-Velocity

It came out that way because i did it on my phone


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#12 2012-08-18 16:32:17

soniku3
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: Scroll-X-Velocity

Jodymoses wrote:

Can anyone please give me a script for that?                             

              when gf clicked           
say (can anyone help) for (3) secs                    
stop script                    


internet's all about cats today.

Offline

 

#13 2012-08-18 18:13:41

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Scroll-X-Velocity

soniku3 wrote:

Jodymoses wrote:

Can anyone please give me a script for that?                             

              when gf clicked           
say [can anyone help] for (3) secs                    
stop script                    

I think I know what you want, is it a scrolling background, but the player can still move around and the background catches up?


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#14 2012-08-19 01:05:54

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Re: Scroll-X-Velocity

Yes yes Yes


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

Board footer