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

#1 2010-12-27 13:20:13

GoboAddict
New Scratcher
Registered: 2010-10-21
Posts: 7

scrolling questions

i am making a scroller game, but i have the problem that the terrian sprites pile up at the edges of the screen, if you know a way to help please tell me  smile

the scroll script is
<when green flag clicked>
<forever>
<if><key[ left arrow ]pressed?>
<change{scrollx  }by(-3.5)
<if>
<key[ right arrow ]pressed?>
<change{ scrollx }by( 3.5)

thanks!
______________
i'm allergic to scratchcats, AAAACHOOOO

Offline

 

#2 2010-12-27 13:22:35

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: scrolling questions

Use: http://i51.tinypic.com/2pychg4.gif
This makes the sprites that pile on the edges disappear, but reappear when they move into view.  "Abs" just means always the positive.


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#3 2010-12-27 13:33:19

MiffinTheMuffin
Scratcher
Registered: 2010-12-11
Posts: 1000+

Re: scrolling questions

Kileymeister wrote:

This makes the sprites that pile on the edges disappear, but reappear when they move into view.  "Abs" just means always the positive.

I should use that some time.


http://i.imgur.com/FDvbV.png

Offline

 

#4 2010-12-27 17:21:10

GoboAddict
New Scratcher
Registered: 2010-10-21
Posts: 7

Re: scrolling questions

it worked ok, but one ofd the sprites doesnt reappear, it isnt perfect but it is better
_________________________________
<when green flag clicked>
<forever>
<say[ <{ if you are reading this, HI! }>

Offline

 

#5 2010-12-27 17:30:09

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: scrolling questions

GoboAddict wrote:

it worked ok, but one ofd the sprites doesnt reappear, it isnt perfect but it is better
_________________________________
<when green flag clicked>
<forever>
<say[ <{ if you are reading this, HI! }>[/block]

If it doesn't work, it's probably because the boundaries (the 200 and 150) are too far.  Set the sprite as far off screen as you can (use a block like "set x to 500000") then set the 200 in "abs of x < 200" to a number less than it's new position.

Last edited by Kileymeister (2010-12-27 17:30:47)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#6 2011-01-01 11:28:59

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: scrolling questions

If i am making a scroller, and am being lazy, I just make a border around the screen to hide the terrain and other sprites.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer