
-----------------------------------
Jessica359
Tue Apr 29, 2008 10:03 am

Disapearing Background
-----------------------------------
Allo! :)

Alright so i'm making a frogger game for my end of year game :)
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    :D

-----------------------------------
lordroba
Tue Apr 29, 2008 10:53 am

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.  



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


-----------------------------------
Insectoid
Wed Apr 30, 2008 10:15 am

RE:Disapearing Background
-----------------------------------
Use a sprite?

-----------------------------------
Jessica359
Wed Apr 30, 2008 11:58 am

RE:Disapearing Background
-----------------------------------
Awesome thanks :) 

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 :)

-----------------------------------
darkangel
Wed Apr 30, 2008 3:30 pm

Re: Disapearing Background
-----------------------------------
THIS tutorial was how i learned.
