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

#1 2010-06-18 11:51:41

481
Scratcher
Registered: 2009-12-20
Posts: 8

What's wrong?

I put up a scrolling engine on my user page, and there's something wrong with it. Am I missing a script, or do I need to change something? Please reply!
Here's the link.


481 is quitting for a bit. I'll be back one day.

Offline

 

#2 2010-06-18 12:00:35

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: What's wrong?

That's a nice scrolling system, so far  big_smile  As for your problem, try something like this on 1 inside the x part of "go to x: () y: ()"...

(0 - (ScrollX) )

And on 2...

(0 - ( (ScrollX) - (480) ) )

Hope this helps  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#3 2010-06-18 12:04:23

481
Scratcher
Registered: 2009-12-20
Posts: 8

Re: What's wrong?

This does help, except for one thing...
I want it to do forever scrolling. Still, thanks!


481 is quitting for a bit. I'll be back one day.

Offline

 

#4 2010-06-18 12:50:51

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: What's wrong?

Whoops! ^^ I'm not too good with forever scrolling... I'll see if I can find anything that's of use for you  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#5 2010-06-18 12:56:14

481
Scratcher
Registered: 2009-12-20
Posts: 8

Re: What's wrong?

Thanks!


481 is quitting for a bit. I'll be back one day.

Offline

 

#6 2010-06-18 13:01:43

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: What's wrong?

Does this help? You could adjust how the background makes the list change (eg, change it to using arrow keys, not automatic scrolling)

http://scratch.mit.edu/projects/teammcb/421895


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#7 2010-06-18 13:13:10

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: What's wrong?

here is my working fix
in Sprite4 (the ball) I changed 2 things...

<if>   <key[ right arrow ]pressed?>
<change{ Scrollx  }by( 1
   <if>  <{ Scrollx  }>    <(  <>>  )> 480
   <set{ Scrollx  }to( -480
   <end>
<turn ccw( 360-(25*3.1415926 )degrees>
<end>

and

<if>  <key[ left arrow ]pressed?>
<change{ Scrollx  }by( -1
   <if>  <{ Scrollx  }>    <(  <<>  )> -480
   <set{ Scrollx  }to( 480
   <end>
<turn cw( 360-(25*3.1415926 )degrees>
<end>


then in sprite 1...
<when green flag clicked>
<forever>
<go to[ x: Scrollx   y: 0

and lastly in sprite 2...
<when green flag clicked>
<if>  <( Scrollx <<> 0 )>
<go to[ (( Scrollx <+> 480 ))
<else>
<go to[ (( Scrollx <-> 480 ))

Last edited by Locomule (2010-06-18 13:25:59)


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#8 2010-06-18 14:33:43

481
Scratcher
Registered: 2009-12-20
Posts: 8

Re: What's wrong?

@Locomule: Sorry, that didn't work at all.


481 is quitting for a bit. I'll be back one day.

Offline

 

#9 2010-06-18 16:00:06

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: What's wrong?

use method 2 then everything will be perfect http://scratch.mit.edu/forums/viewtopic.php?id=2440

Last edited by archmage (2010-06-18 16:02:31)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#10 2010-06-20 10:42:04

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: What's wrong?

It worked perfectly for me or I wouldn't have posted it. Maybe something got typed wrong, anyway I uploaded the fixed version here...

http://scratch.mit.edu/projects/Locomule/1138457

Here are some observations btw. Notice how the sprites get stuck momentarily as they are just about to move off the stage? Scratch defaults to keeping the last 18 pixels of a sprite visible until it 'jumps' the sprite away. I had a lot of luck with using an outside graphic editor to make an 18 pixel-wide transparent square around my sprites so they would move smoothly off the screen.

Also, you can get an annoying flicker around the edges of the stage. My true scratchx type scrolling projects all include a border sprite that stays above all the other sprites and hides this. Sometimes I color it or sometimes I just use a black border to blend in with the normal black border in presentation mode.

Happy Scratching >=P

Last edited by Locomule (2010-06-20 10:50:30)


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#11 2010-06-20 13:22:29

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: What's wrong?

Locomule wrote:

It worked perfectly for me or I wouldn't have posted it. Maybe something got typed wrong, anyway I uploaded the fixed version here...

http://scratch.mit.edu/projects/Locomule/1138457

Here are some observations btw. Notice how the sprites get stuck momentarily as they are just about to move off the stage? Scratch defaults to keeping the last 18 pixels of a sprite visible until it 'jumps' the sprite away. I had a lot of luck with using an outside graphic editor to make an 18 pixel-wide transparent square around my sprites so they would move smoothly off the screen.

Also, you can get an annoying flicker around the edges of the stage. My true scratchx type scrolling projects all include a border sprite that stays above all the other sprites and hides this. Sometimes I color it or sometimes I just use a black border to blend in with the normal black border in presentation mode.

Happy Scratching >=P

Yeah - I think your method is the only way to get your sprites to move off the screen well enough, aside from the method of hiding the sprites after they've moved "off" the screen.

Happy to see you're having success!

Offline

 

#12 2010-06-21 20:21:05

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: What's wrong?

Thanks a lot! I've been working on learning to code different routines from games I grew up on (I'm 38) while accumulating ideas for finished games. I started out doing this stuff in 1983, this is much easier  smile


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

Board footer