
-----------------------------------
DanShadow
Thu Jan 08, 2004 8:40 pm

[source] viewing a starry night
-----------------------------------
I saw "Rowah" or someone make it, so I decided to post mine.

%Starry Night Thing
var counter, temp : int := 1
var x, y : array 1 .. 200 of int
for i : 1 .. 200
    x (i) := 0
    y (i) := 0
end for
for i : 1 .. 200
    randint (x (i), -400, 1000)
    randint (y (i), -400, 1000)
end for

loop
    setscreen ("offscreenonly")
    View.Update
    Draw.FillBox (0, 0, maxx, maxy, 255)
    delay (200)
    for i : 1 .. 200
        Draw.FillStar (x (i) - 10, y (i) - 10, x (i) + 10, y (i) + 10, 14)
    end for
    if counter = 20 then
        randint (temp, 1, 8)
        counter := 0
    end if
    for i : 1 .. 199
        if temp = 1 then
            x (i) := x (i) - 6
        elsif temp = 2 then
            x (i) := x (i) + 6
        elsif temp = 3 then
            y (i) := y (i) - 6
        elsif temp = 4 then
            y (i) := y (i) + 6
        elsif temp = 5 then
            x (i) := x (i) - 6
            y (i) := y (i) - 6
        elsif temp = 6 then
            x (i) := x (i) + 6
            y (i) := y (i) - 6
        elsif temp = 7 then
            x (i) := x (i) - 6
            y (i) := y (i) + 6
        elsif temp = 8 then
            x (i) := x (i) + 6
            y (i) := y (i) + 6
        end if
    end for
    counter := counter + 1
end loop


-----------------------------------
Maverick
Thu Jan 08, 2004 9:20 pm


-----------------------------------
good, yet laggy.

-----------------------------------
DanShadow
Thu Jan 08, 2004 9:44 pm


-----------------------------------
Its supposed to be laggy...have you ever looked out at the stars? If so, do you spin your head around wildly and quickly, or slowly gaze across the distances, enjoying the scenery and the moment? Thats why there is "lag". (which is actually a delay :wink: )

-----------------------------------
Maverick
Thu Jan 08, 2004 9:48 pm


-----------------------------------
I'm aware that its a delay. 
To me that doesnt look like what you seem to be describing, but thats just me.

-----------------------------------
santabruzer
Sat Jan 10, 2004 4:32 pm


-----------------------------------
i still say Asian's i think it was Snowflakes. or stars.. was amazing.. wonder if i can find it again ..

-----------------------------------
shorthair
Tue Jan 13, 2004 7:08 pm


-----------------------------------
Its alright for a turing program , but the fake stars just ruin it , if you wrere to use dots and lines to make some constelations ( spelling) then i would be impressed , but its a good program to build on :D

-----------------------------------
Rowah
Thu Jan 15, 2004 11:52 am

Heh
-----------------------------------
Hmm my starry night program was different.
Mines was about the stars you see at night, twinkling, appearing, dissappearing.  You dont really see stars all yellow, and they ain't that big.  My aim was a non-fictive approach, simple yet slick.
Good work but that isn't realistic and its ugly, im sorry but my thumbs are down on this one.   :cry:

-----------------------------------
DanShadow
Thu Jan 15, 2004 2:02 pm


-----------------------------------
*ouch* man...well, its not supposed to be that realastic anyways... plus, I did this like a couple months after I started programming, and for that time, it was pretty good. hmm..maybe ill have to design a "revenge of the starry night: stab fest" program to impress you  :twisted: ...but nah, too boring, heh.

-----------------------------------
santabruzer
Thu Jan 15, 2004 4:32 pm


-----------------------------------
i dunnu.. i did a star program.. 
    % New type for "stars" or "snow"
    type star :
        record
            x : int
            y : int
            clr : int
        end record

    const maxstar := 500

    % Array for Stars
    var stardot : array 1 .. maxstar of star

    % Generating an Intial Value
    for i : 1 .. maxstar
        stardot (i).x := Rand.Int (0, maxx)
        stardot (i).y := Rand.Int (0, maxy)
        stardot (i).clr := Rand.Int (20, 31)
    end for

    % Regenerating the Intial Value
    proc clearstar (number : int)
        stardot (number).x := maxx
        stardot (number).y := Rand.Int (0, maxy)
        stardot (number).clr := Rand.Int (20, 31)
    end clearstar

    % General Execution Procedure
    
        % Set the screen, and the back color
        setscreen ("offscreenonly")
        colorback (black)
        cls
        loop
            for i : 1 .. maxstar
                % Draw the Star
                drawdot (stardot (i).x, stardot (i).y, stardot (i).clr)

                % Move the Star one left
                stardot (i).x -= 1

                % If Star is offscreen, refresh
                if stardot (i).x < 0 then
                    clearstar (i)
                end if
            end for

            % Refresh the screen
            View.Update
            delay (10)
            cls
        end loop

-----------------------------------
shorthair
Thu Jan 15, 2004 5:07 pm


-----------------------------------
Thats a much better starry night program ,if you were to connect some constelations into that , or some bitmaps of planets then it wiould be just awsopme , but hte effect taht you give is just amazing :D  :D

-----------------------------------
Rowah
Fri Jan 16, 2004 11:39 am

Heh
-----------------------------------
Santabruzer, your awesome!!
That was l33t..

-----------------------------------
santabruzer
Sat Jan 17, 2004 11:30 pm


-----------------------------------
and all thanks to the world of records.. :P.. maybe i should become the "record warrior" or someone like that....  :lol:

-----------------------------------
PaddyLong
Sun Jan 18, 2004 11:20 am


-----------------------------------
and all thanks to the world of records.. :P.. maybe i should become the "record warrior" or someone like that....  :lol:

wait till you learn about objects (classes)  :D

-----------------------------------
AsianSensation
Sun Jan 18, 2004 4:23 pm


-----------------------------------
lol, yeah, structures (or records, as they call it in turing) is like halfway between normal programming and OOP. As PaddyLong said, learn Classes, they will help you so much later on.

-----------------------------------
santabruzer
Sun Jan 18, 2004 6:39 pm


-----------------------------------
hmmm classes.. i like the sound of it.. i still wish though that turing had a function like TObject....

-----------------------------------
PaddyLong
Mon Jan 19, 2004 7:49 am


-----------------------------------
structures provide a good stepping stone to oop

-----------------------------------
kalin
Tue Jan 20, 2004 7:54 am


-----------------------------------
to Dansahdow: well...I dunno what to say. Stars are tooo big and such, but, well, its cool..............err yeah. I'll shut up now......:P

-----------------------------------
DanShadow
Tue Jan 20, 2004 8:51 am


-----------------------------------
lol,  you dont have to shut up.  :D

-----------------------------------
kalin
Wed Jan 21, 2004 3:21 pm


-----------------------------------
No I think I will before my mouth gets the better of me...and I say something baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaad
