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

#1 2012-10-05 20:08:00

EzraB
Scratcher
Registered: 2012-03-06
Posts: 29

Please help!!!

I need help figuring something out. How do you create a moving background sprite in your games? Please post a reply.  smile


I think life should have a few simple meanings: Love. Pulled pork sandwiches. You. Me. Video Games. EzraBsmile

Offline

 

#2 2012-10-05 20:09:29

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Please help!!!

Don't use the background, use a 480x360 sprite.  wink

Last edited by berberberber (2012-10-05 20:09:52)


http://i47.tinypic.com/2iaa73k.png

Offline

 

#3 2012-10-05 20:18:04

EzraB
Scratcher
Registered: 2012-03-06
Posts: 29

Re: Please help!!!

Yeah, I knew that, but I need the Script for the Sprite.


I think life should have a few simple meanings: Love. Pulled pork sandwiches. You. Me. Video Games. EzraBsmile

Offline

 

#4 2012-10-05 20:56:01

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Please help!!!

EzraB wrote:

Yeah, I knew that, but I need the Script for the Sprite.

I never had made one, but:

when gf clicked
set [scrollx v] to (0)
set [scrolly v] to (0)
forever
 go to x: ((scrollx) + ([some multiple v] of (480))) y: ((scrolly) + ([some multiple v] of (360)))
 Filler//Or set y to 0 if you only want left/right scrolling.
 if <<( [abs v] of (x position)) > (the farthest right it can go - 1)> or<([abs v] of (y position)) = (the farthest up it can go - 1)>>
   hide// The above = is actually a >.
 else// Don't include the second part of the "or statement" if you only want …
  show//…left/right scrolling.
 end

Last edited by ErnieParke (2012-10-06 08:10:41)


http://i46.tinypic.com/35ismmc.png

Offline

 

#5 2012-10-05 21:56:09

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Please help!!!

@ErnieParke - I think you've got a mistake in the (set x, y) block.  Check the value you put for y-coordinate.

ErnieParke wrote:

 go to x: ((scrollx) + ([some multiple v] of (480))) y: ((scrollx) + ([some multiple v] of (360)))

Last edited by amcerbu (2012-10-05 21:57:08)

Offline

 

#6 2012-10-06 08:11:34

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Please help!!!

amcerbu wrote:

@ErnieParke - I think you've got a mistake in the (set x, y) block.  Check the value you put for y-coordinate.

ErnieParke wrote:

 go to x: ((scrollx) + ([some multiple v] of (480))) y: ((scrollx) + ([some multiple v] of (360)))

My mistake. Thanks for catching it!


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer