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

Username:   Password: 
 RegisterRegister   
 Need help with garage and moon problems (code writen)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dani190




PostPosted: Fri Dec 16, 2005 10:32 pm   Post subject: Need help with garage and moon problems (code writen)

code:

setscreen ("graphics:max,max,offscreenonly")



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





var v : int
var u : int
var c : int
var count : int
var g : int
var k : int
var countx, county : int
var x1, y1 : int
var a, b : int
var x2, y2 : int
a := 420
b := 50
c := black
countx := 10
county := 7
x2 := 1000
y2 := 300


loop
    var h : array 1 .. 4 of int := init (150, 400, 270, 10)
    var d : array 1 .. 4 of int := init (250, 250, 400, 10)


    g := 1300
    k := 600

    Draw.FillBox (150, 50, 400, 250, brightred)     %house box
    Draw.FillBox (401, 50, 620, 160, brightgreen)   %Garage
    Draw.FillBox (420, 50, 601, 140, brightblue)    %Garage Door

    Draw.FillBox (350, 140, 300, 170, grey)         %house window Right side
    Draw.FillBox (200, 140, 250, 170, grey)         %house window Left side
    Draw.FillBox (1800, 1, 1, 50, green)            %Grass in front
    Draw.FillBox (250, 110, 200, 50, grey)          %Door
    drawfillbox (205, 250, 250, 400, red)           %Chiminy

    Draw.FillBox (a, b, 601, 70, black)             %Garage part2
    Draw.FillPolygon (h, d, 3, 1)                   %Roof of house
    a := a
    b := b + 5

    exit when b > 170
    View.Update
    delay (150)
    cls
    colorback (c)
    drawfilloval (g, k, 20, 20, yellow)


    if b > 170
            then
        drawfillbox (475, 120, 480, 125, white)
        drawfillbox (520, 120, 525, 125, white)
    end if
end loop

loop
    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.FillBox (150, 50, 400, 250, brightred)      %house box
    Draw.FillBox (401, 50, 620, 160, brightgreen)   %Garage
    Draw.FillBox (420, 50, 601, 140, brightblue)    %Garage Door

    Draw.FillBox (350, 140, 300, 170, grey)         %house window Right side
    Draw.FillBox (200, 140, 250, 170, grey)         %house window Left side
    Draw.FillBox (1800, 1, 1, 50, green)            %Grass in front
    Draw.FillBox (250, 110, 200, 50, grey)          %Door
    drawfillbox (205, 250, 250, 400, red)           %Chiminy

    Draw.FillBox (a, b, 601, 70, black)             %Garage part2
    Draw.FillPolygon (h, d, 3, 1)                   %Roof of house
    drawfillbox (475, 120, 480, 125, white)
    drawfillbox (520, 120, 525, 125, white)
    View.Update
    delay (150)
    colorback (c)

    cls

    drawfilloval (x2, y2, 20, 20, yellow)
    exit when x2 = 0
    x2 := x - countx
    y2 := y2 - county
    if y2 > 500 then
        county := 0
        if x < 250 then
            county := -7
        end if
    end if
end loop



ok so thats my code, my problem is that i cannot get that garage to open properly, meaning i cannot get it to go down so there is not more blue left then open like it is now.Also the moon is going crazy on me i have no clue why it's doing that and i need help badlly, iv been trying to fix this for almost an hour so could somebody please help me!
Thanks
Sponsor
Sponsor
Sponsor
sponsor
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  [ 1 Posts ]
Jump to:   


Style:  
Search: