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

#1 2012-08-23 23:08:17

skykoi
Scratcher
Registered: 2012-06-30
Posts: 22

Quick question about scrolling?

Is it normal for sprites in scrolling games to always stay on the edge of the screen?

It's like if I walk away from something it'll move away but you can still see it at the edge of the screen?

Am I making sense o.o?

Offline

 

#2 2012-08-23 23:17:45

videogame9
Scratcher
Registered: 2008-05-12
Posts: 1000+

Re: Quick question about scrolling?

you mean how the terrain doesn't scroll all the way off the edge of the screen and it just stays on the edge?

Yeah, that happens.


http://img641.imageshack.us/img641/4118/newvg9logo.png
QUOTE OF THE RIGHT NOW: why are we arguing about dead babies? -videogame9

Offline

 

#3 2012-08-23 23:26:41

skykoi
Scratcher
Registered: 2012-06-30
Posts: 22

Re: Quick question about scrolling?

videogame9 wrote:

you mean how the terrain doesn't scroll all the way off the edge of the screen and it just stays on the edge?

Yeah, that happens.

OH well...that stinks  smile

Offline

 

#4 2012-08-23 23:30:29

Scratcher456
Scratcher
Registered: 2010-12-04
Posts: 58

Re: Quick question about scrolling?

You could try 'if touching edge, hide'. That... *might* do it.


Mining diamonds, mining diamonds, mining diamonds...

Offline

 

#5 2012-08-23 23:32:18

videogame9
Scratcher
Registered: 2008-05-12
Posts: 1000+

Re: Quick question about scrolling?

Scratcher456 wrote:

You could try 'if touching edge, hide'. That... *might* do it.

No, it wouldn't.


http://img641.imageshack.us/img641/4118/newvg9logo.png
QUOTE OF THE RIGHT NOW: why are we arguing about dead babies? -videogame9

Offline

 

#6 2012-08-23 23:37:54

Scratcher456
Scratcher
Registered: 2010-12-04
Posts: 58

Re: Quick question about scrolling?

That's what I was afraid of... I really know NOTHING about scrollers, they've never been my thing to make.


Mining diamonds, mining diamonds, mining diamonds...

Offline

 

#7 2012-08-23 23:39:47

skykoi
Scratcher
Registered: 2012-06-30
Posts: 22

Re: Quick question about scrolling?

Scratcher456 wrote:

That's what I was afraid of... I really know NOTHING about scrollers, they've never been my thing to make.

They make me frustrated!!

Scratch makes me frustrated!! ...but  love it :3

Offline

 

#8 2012-08-23 23:44:47

skykoi
Scratcher
Registered: 2012-06-30
Posts: 22

Re: Quick question about scrolling?

I HAVE FIGURED IT OUT!! I JUST MADE TO GIANT BLACK RECTANGLE BLOCKS AND PUT THEM ON THE EDGES!! SO NOW YOU CAN'T SEE THE SPRITES ON THE EDGE!

...I is genius...  - u -

Offline

 

#9 2012-08-24 00:59:15

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: Quick question about scrolling?

That is one way to do it, but here is a script scrollers commonly use.

when gf clicked
forever
go to x: ((scroll x) + ([480] x [0])) y: ((scroll x) + ([480] x [0]))
if <<([abs v] of (x position)) > [460]> or <([abs v] of (y position)) > [340]>
hide
else
show
end
If the object still doesn't hide while off screen, click on it, look at its x and y positions, and adjust the greater than numbers to a little below what you see.

Edit: where it says or, it cuts off. It is the same as the first part, with x poistion changed to y position, and the number changed to 340.

Last edited by sonicfan12p (2012-08-24 01:03:47)


Why are the secret organizations getting all the attention?  mad

Offline

 

#10 2012-08-24 05:58:03

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

Re: Quick question about scrolling?

sonicfan12p wrote:

That is one way to do it, but here is a script scrollers commonly use.

when gf clicked
forever
go to x: ((scroll x) + ((480) * (0))) y: ((scroll x) + ((480) * (0)))
if <<([abs v] of (x position)) > [230]> or <[170] < ([abs v] of (y position))>>
hide
else
show
end
If the object still doesn't hide while off screen, click on it, look at its x and y positions, and adjust the greater than numbers to a little below what you see.

Edit: where it says or, it cuts off. It is the same as the first part, with x poistion changed to y position, and the number changed to 340.

Fixed. That is a really annoying glitch. :3


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

Offline

 

#11 2012-08-24 11:51:11

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: Quick question about scrolling?

Yes. Yes it is very annoying.


Why are the secret organizations getting all the attention?  mad

Offline

 

#12 2012-08-25 00:37:50

tree-hugger
Scratcher
Registered: 2011-11-19
Posts: 38

Re: Quick question about scrolling?

So for your question about scrolling... ya your making sense and ya that's normal. One way of dealing with it is adding a border to your project to hide the terrain on the edges!


http://oi48.tinypic.com/1y7tjr.jpghttp://oi50.tinypic.com/28tb34j.jpg                     http://oi50.tinypic.com/21c6v74.jpg                    ...ya, I'm weird... REAL weird...
BITBOT ALL THE WAY!!!     Only the WEIRDEST games!     (that's just  a Tree-Hugger thing)

Offline

 

#13 2012-08-25 00:50:37

bananaman114
Scratcher
Registered: 2010-03-15
Posts: 1000+

Re: Quick question about scrolling?

I usually add a black border around my game to fix that, but there are ways to fix it with scripts too.


the sun still shines

Offline

 

Board footer