Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 starfield/space screensaver
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
gamer




PostPosted: Wed Apr 14, 2004 9:09 pm   Post subject: starfield/space screensaver

ok if u rightclick desktop n go select the starfield screensaver, n yea this is the one i wish to make. but problem is, i hav no idea as to how to start, can anyone please guide me some steps to make this...if u want u can post the codes , but i would kinda prefer you just teachin me the steps to getting this screensaver

thankyou for ya time
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Wed Apr 14, 2004 9:43 pm   Post subject: (No subject)

maybe this would help u, I found it using search
http://www.compsci.ca/v2/viewtopic.php?t=2760&highlight=star
gamer




PostPosted: Wed Apr 14, 2004 9:56 pm   Post subject: (No subject)

thnx paul bian for the link but however their program only hav stars just simply goin across the screen....which is just way too simple n not wut i wanted

wut i wish to make is kinda like imagining urself travelling through the space, like keep zooming in (if u wanna kno wut i reli mean just select "startfield" at the screensaver setup)

i just dun understand how to make that kind of "zooming" from small to big thingy

if anyone knows plz share....thnx
gamer




PostPosted: Thu Apr 15, 2004 3:14 pm   Post subject: (No subject)

can ANYONE plz help me?? u guys dont hav ta gimme the exact codes (but if u hav them plz do), all i need is just steps as to how i can get to makin it...pleassse
recneps




PostPosted: Thu Apr 15, 2004 3:16 pm   Post subject: (No subject)

well you could have the dots bein drawn near the middle and out towards the edge.. and then they would move down the screen and to the outside of screen... i think thats how it works
gamer




PostPosted: Thu Apr 15, 2004 4:16 pm   Post subject: (No subject)

ok sry maybe im just dumb but i reli confused n stuff

i guess i reli need some codes

if anyone is nice enough to kinda make it plzz do (like just the beginnin or sumthin)
AsianSensation




PostPosted: Thu Apr 15, 2004 6:46 pm   Post subject: (No subject)

code:
View.Set ("offscreenonly")
colorback (7)
cls

type StarType :
    record
        X, Y, Size, Vx, Vy : real
    end record

var Stars : array 1 .. 100 of StarType

for rep : 1 .. 100
    Stars (rep).X := maxx div 2
    Stars (rep).Y := maxy div 2
    Stars (rep).Size := 1
    if Rand.Int (0, 1) = 0 then
        Stars (rep).Vx := Rand.Real * 3
    else
        Stars (rep).Vx := Rand.Real * 3 * -1
    end if
    if Rand.Int (0, 1) = 0 then
        Stars (rep).Vy := Rand.Real * 3
    else
        Stars (rep).Vy := Rand.Real * 3 * -1
    end if
end for

loop
    for rep : 1 .. 100
        drawfilloval (round (Stars (rep).X), round (Stars (rep).Y), round (Stars (rep).Size), round (Stars (rep).Size), white)
    end for
    View.Update
    cls
    for rep : 1 .. 100
        Stars (rep).X += Stars (rep).Vx
        Stars (rep).Y += Stars (rep).Vy
        Stars (rep).Size := abs (Stars (rep).X - maxx div 2) / 100
        if Stars (rep).X < 0 or Stars (rep).X > maxx or Stars (rep).Y < 0 or Stars (rep).Y > maxy then
            Stars (rep).X := maxx div 2
            Stars (rep).Y := maxy div 2
            Stars (rep).Size := 1
        end if
    end for
end loop


it's not that good, but I have a compsci and guitar test tomorrow, so I couldn't spend too much time on it. But this is basicly what you could do.
gamer




PostPosted: Thu Apr 15, 2004 6:57 pm   Post subject: (No subject)

wow man thnx alot, however.......
damn im still a newb n i hardly kno any of the codes Crying or Very sad
is it possible to make it with simplier codes??
or if u hav time, can ya kinda explain them??plzzz
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Thu Apr 15, 2004 7:15 pm   Post subject: (No subject)

basicly, I created a star "object", where it has it's position and speed. Read up on records first.

I increase the x and y coordinate of a star by their speed, then I change the size accoding to the x coord. It gets bigger as it gets near the edge of the screen.

Then draw everything, View.Update it.
gamer




PostPosted: Thu Apr 15, 2004 8:06 pm   Post subject: (No subject)

thnx alot
gamer




PostPosted: Thu Apr 15, 2004 8:56 pm   Post subject: (No subject)

but wut exactly are type n record for?? is it posible if i use somethin else instead?? also, wuts withe the (rep) thing?? lol cuz ive never seen the command "Stars (rep).X"
maybe im just too dumb for this

btw how come it seems theres this black rectangle with a dot in the middle??
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: