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

Username:   Password: 
 RegisterRegister   
 plane game, flashing plane image help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
biggmak




PostPosted: Sat Oct 18, 2003 11:23 pm   Post subject: plane game, flashing plane image help

Im having trouble with a game that im currently working on with a plane that shoots on coming planes with a birds eye view. So basically the problem is that I have 3 different pics for my plane, to make it look like the plane is actually flying, and I had the tail dragging behind my plane so I decided to cover it up with a background image, but that only makes things worse by making the planes image flash. Ive looked at the tutorials but im not sure how to apply what is there to my program. If anyone knows how to fix this problem I will appreciate it very much.

code:
loop

        Input.KeyDown (chars)

        if chars (KEY_UP_ARROW) then

            y := y + 1
            Pic.Draw (back, 0, 0, 0)
            Pic.Draw (plane, x, y, picMerge)
            delay (1)

            y := y + 1
            Pic.Draw (back, 0, 0, 0)
            Pic.Draw (plane2, x, y, picMerge)
            delay (1)

            y := y + 1
            Pic.Draw (back, 0, 0, 0)
            Pic.Draw (plane3, x, y, picMerge)
            delay (1)
end if
end loop
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Oct 18, 2003 11:31 pm   Post subject: (No subject)

you should read a tutorial on flicker-free animation (i think it's called "smooth animation" or something).

Basically the use of
code:
View.Update


there's a lot of posts on that around the forum. Basically you set your screen to
code:

View.Set("offscreenonly")
mode and then call View.Update after drawing the WHOLE screen. This will remove flicker from your animations
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
biggmak




PostPosted: Sat Oct 18, 2003 11:55 pm   Post subject: (No subject)

i read the tutorial and from how my game is set up, which is different from the tutorial, viewset (offscreenonly) wont work, it just freezes the whole game. I tried changing the tutorial but all that showed up was the first picture of the character and the background, and also the character was moving very slow even after i changed the delay!
biggmak




PostPosted: Sat Oct 18, 2003 11:56 pm   Post subject: (No subject)

if you dont know how to fix it just say that you dont know
Tony




PostPosted: Sun Oct 19, 2003 12:13 am   Post subject: (No subject)

tony knows all Laughing

here's what I ment:
code:

View.Set("offscreenonly")

loop

        Input.KeyDown (chars)

        if chars (KEY_UP_ARROW) then

            y := y + 1
            Pic.Draw (back, 0, 0, 0)
            Pic.Draw (plane, x, y, picMerge)
View.Update
            delay (1)

            y := y + 1
            Pic.Draw (back, 0, 0, 0)
            Pic.Draw (plane2, x, y, picMerge)
View.Update
            delay (1)

            y := y + 1
            Pic.Draw (back, 0, 0, 0)
            Pic.Draw (plane3, x, y, picMerge)
View.Update
            delay (1)
end if
end loop
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
biggmak




PostPosted: Sun Oct 19, 2003 1:54 pm   Post subject: (No subject)

i got it to work, its perfect, youre awsome!!!!!!!!!!!!!!!
Tony




PostPosted: Sun Oct 19, 2003 2:17 pm   Post subject: (No subject)

biggmak wrote:
youre awsome

I know Laughing thx
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 7 Posts ]
Jump to:   


Style:  
Search: