Computer Science Canada

Disapearing Background

Author:  Jessica359 [ Tue Apr 29, 2008 10:03 am ]
Post subject:  Disapearing Background

Allo! Smile

Alright so i'm making a frogger game for my end of year game Smile
So far this is what I have so far except when my "green circle" moves around it destroys the background with it. So i tried getting a grey circle to follow it but its not working. This is my program.

Hope the background shows up Wink

Thanks Very Happy

Author:  lordroba [ Tue Apr 29, 2008 10:53 am ]
Post subject:  Re: Disapearing Background

Notice some of the changes I've made. Try to see what I did different and how it might affect the program.

Turing:


View.Set ("graphics, offscreenonly")
var x, y : int := 100
var chars : array char of boolean
var anglex : int := 135
var angley : int := 225
var tmp : boolean := true


var back : int := Pic.FileNew ("background.bmp")

procedure frog
    if tmp then
        %exit when anglex = 135 and angley = 225
        Draw.FillOval (x, y, 20, 20, green)
        anglex := anglex - 1
        angley := angley + 1
        delay (20)
        if anglex = 135 and angley = 225 then
            tmp := true
        end if
    end if
end frog

loop

    Input.KeyDown (chars)
    if chars (KEY_UP_ARROW) and y < 390 then
        y := y + 5
    end if
    if chars (KEY_DOWN_ARROW) and y > 10 then
        y := y - 5
    end if
    if chars (KEY_RIGHT_ARROW) and x < 630 then
        x := x + 5
    end if
    if chars (KEY_LEFT_ARROW) and x > 10 then
        x := x - 5
    end if
    Pic.Draw (back, 0, 0, picCopy)
    frog
    View.Update
end loop

Author:  Insectoid [ Wed Apr 30, 2008 10:15 am ]
Post subject:  RE:Disapearing Background

Use a sprite?

Author:  Jessica359 [ Wed Apr 30, 2008 11:58 am ]
Post subject:  RE:Disapearing Background

Awesome thanks Smile

and for sprites i don't know anything about them, once i'm done this game i'm going to start reading on sprites, but thanks anyways Smile

Author:  darkangel [ Wed Apr 30, 2008 3:30 pm ]
Post subject:  Re: Disapearing Background

<a href="http://compsci.ca/v3/viewtopic.php?t=4598">THIS</a> tutorial was how i learned.


: