Computer Science Canada

how to slow stuff down please help ASAP

Author:  dani190 [ Wed Dec 14, 2005 8:19 pm ]
Post subject:  how to slow stuff down please help ASAP

hey guys my code is the following
code:
setscreen ("graphics:max,max,offscreenonly")



colorback (black)
var row, column : int
var x : int
x := 1
cls
loop




    var v : int
    var u : int
    var c : int
    var count : int
    var g : int
    var k : int


    loop


        %-------------------------------------------------------------------------HOUSE
        g := 1300
        k := 600
        %              x1  y1  x2   y2    color
        Draw.FillBox (150, 50, 400, 250, brightred) %Main house box
        Draw.FillBox (501, 50, 620, 150, brightgreen) %Garage
        Draw.FillBox (520, 50, 601, 140, brightblue) %Garage Door

        Draw.FillBox (350, 140, 300, 170, grey) %Main house window Right side
        Draw.FillBox (200, 140, 250, 170, grey) %Main house window Left side
        Draw.FillBox (1800, 1, 1, 50, green) % Road in front



        View.Update
        delay (1)
        %--------------------------------------------------------------------------^^^^^HOUSE END
        %--------------------------------------------------------------------------ROOF                                                                         ROOF
        var h : array 1 .. 4 of int := init (150, 400, 270, 10)
        var d : array 1 .. 4 of int := init (250, 250, 400, 10)
        Draw.FillPolygon (h, d, 3, 1)
        %---------------------------------------------------------------------------ROOF END
        loop
            %---------------------------------------------------------------------------STARS
           
            delay (1)
            randint (row, 1, 15)
            randint (column, 1, 158)
            locate (row, column)
            color (white)
            put "*"


            %----------------------------------------------------------------------------STARS END
            %----------------------------------------------------------------------------moon start
            g := g - 1
            k := 1 + 500

            Time.Delay (5)
            Draw.FillOval (g, k, 30, 30, white)
            View.Update


            Draw.FillOval (g, k, 30, 30, black)
            exit when g = 1

            %-----------------------------------------------------------------------------moon end

         




        end loop
    end loop
end loop


guys i need to know how to slow down the stars and speed up the moon
also after that i need to know how to change all of this to day time after the moon has finished (i want the sun to come in and sky to change to blue)

Author:  dani190 [ Wed Dec 14, 2005 8:36 pm ]
Post subject: 

help?

Author:  iker [ Wed Dec 14, 2005 8:40 pm ]
Post subject: 

[1]increase the delay
(btw, you could just use one delay, or time.delay, i don't know which one you like using more, because you use them both...)

[2]increase the
code:
g := g -1
to a higher number such as
code:
g := g -5


do both of these steps, and the moon should move faster, and the stars slow.
also, clean up your code so it actualy works before posting
code:

..
%line 53
randint (column, 1, 158)
locate (row, column)
color (white)
put "*"
..

i think you meant to have
code:

randint (column, 1, 15)

instead

Author:  iker [ Wed Dec 14, 2005 8:47 pm ]
Post subject: 

dani190 wrote:
help?

relax for a bit, this isn't the most active forum in the world, anyways, i was writing that last post as you posted...

Author:  dani190 [ Wed Dec 14, 2005 8:58 pm ]
Post subject: 

thx man also can somebody help me with the smoke i have no clue how to do it

Author:  codemage [ Thu Dec 15, 2005 1:51 pm ]
Post subject: 

A grey circle.
If you're feeling adventurous, two grey circles stuck together.


: