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

Username:   Password: 
 RegisterRegister   
 Disapearing Background
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jessica359




PostPosted: 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



Game.zip
 Description:

Download
 Filename:  Game.zip
 Filesize:  5.08 KB
 Downloaded:  46 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
lordroba




PostPosted: 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
Insectoid




PostPosted: Wed Apr 30, 2008 10:15 am   Post subject: RE:Disapearing Background

Use a sprite?
Jessica359




PostPosted: 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
darkangel




PostPosted: Wed Apr 30, 2008 3:30 pm   Post subject: Re: Disapearing Background

THIS tutorial was how i learned.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: