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

#1 2013-01-11 21:29:13

tranedepriest
New Scratcher
Registered: 2012-11-23
Posts: 1

Scrolling starry sky background

I'm making a Galaga-like game...

But none of the tutorials on scrolling background really helps me figure out how to make a auto scrolling background of stars... how do I make it seamless?

Help

Offline

 

#2 2013-01-11 21:30:54

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

Re: Scrolling starry sky background

This topic goes in Help With Scripts. I'll have it moved for you, you'll get a lot more help there than here.


Why are the secret organizations getting all the attention?  mad

Offline

 

#3 2013-01-11 21:34:17

BlackKyurem
Scratcher
Registered: 2012-12-22
Posts: 100+

Re: Scrolling starry sky background

I think this belongs in Help With Scripts.


inspirational quote as of now: anything you can imagine is real | Main Account: ProgrammingPro01
http://img843.imageshack.us/img843/1205/blackkyuremsig.png

Offline

 

#4 2013-01-12 00:15:31

iNKGaming
New Scratcher
Registered: 2012-07-18
Posts: 18

Re: Scrolling starry sky background

What I'd recommend is simply making some white dots on a transparent or black background - make two sprites like this, and set them to scroll vertically.

Just in case you're not familiar with scrolling backgrounds, here's in essence how it works - set one sprite to go to X: 0, and Y: SomeVariable. Then set the other sprite to go to X:0, and Y: SomeVariable + Screen Height (Which is 360 in this case). Thus, the two will move together when you change SomeVariable's value. As soon as Sprite 1 is above a certain point, shoot it underneath Sprite 2, so they swap places. Keep changing SomeVariable by -1, and you'll get the illusion of moving through space.

Check out this article if you didn't understand the above -
http://wiki.scratch.mit.edu/wiki/Scrolling_Platformer_Tutorial

Happy scratching!
- iNK

Offline

 

#5 2013-01-12 00:42:28

luiysia
Scratcher
Registered: 2011-07-05
Posts: 1000+

Re: Scrolling starry sky background

I did something similar to this a while ago, you kind of take the ends and just make sure they match up. It should be pretty easy if you just draw white dots on a blue-black sky.


http://i50.tinypic.com/dx00pd.gif

Offline

 

#6 2013-01-12 04:07:45

chimoo5
New Scratcher
Registered: 2013-01-08
Posts: 18

Re: Scrolling starry sky background

So first you can make a sprite with the background you want without a background color (just the stars). Copy it and put a black background. Set the stage to black background.

Now go to your first background and click costume then edit it. Zoom out all the way and Set the sprite costume to the top left corner. Go to the second background and Set costume center to the bottom left corner.

The first background sprite takes either a broadcast if you a play button or just a button press.

when [s v] key pressed
broadcast [go v]
forever
go to x: (-240) y: (180)
glide (5) secs to x:(-240) y:(-180)
Second sprite background should then have

when I receive [go v]
forever
go to x: (-240) y: (180)
glide (5) secs to x:(-240) y:(-180)
I did a basis for this game in my project if you want to check it.

http://scratch.mit.edu/projects/chimoo5/3033237

Offline

 

Board footer