Need Help Fixing Animation Problem
Author |
Message |
cool1143
|
Posted: Sun Dec 06, 2009 8:36 pm Post subject: Need Help Fixing Animation Problem |
|
|
ok, ive only got one really simple question... How do you Pic.Draw and have image move upwards, but not leaving behind a few hundred images... like iaf you see on bottom, i have to use n blank image to erase previous drawn arrows...
Turing: |
var blank, upArrow, downArrow, leftArrow, rightArrow : int
var x1, y1 , x2, y2, x3, y3, x4, y4: int
x1 := 0
y1 := 100
x2 := 100
y2 := 100
x3 := 200
y3 := 100
x4 := 300
y4 := 100
blank := Pic.FileNew ("blank.BMP")
upArrow := Pic.FileNew ("upArrow.BMP")
leftArrow := Pic.FileNew ("leftArrow.BMP")
downArrow := Pic.FileNew ("downArrow.BMP")
rightArrow := Pic.FileNew ("rightArrow.BMP")
for i : 0 .. 600
Pic.Draw (upArrow, x1, y1, picXor)
Pic.Draw (leftArrow, x2, y2, picXor)
Pic.Draw (downArrow, x3, y3, picXor)
Pic.Draw (rightArrow, x4, y4, picXor)
delay (50)
Pic.Draw (blank, x1, y1, picCopy)
Pic.Draw (blank, x2, y2, picCopy)
Pic.Draw (blank, x3, y3, picCopy)
Pic.Draw (blank, x4, y4, picCopy)
y1 + = 15
y2 + = 15
y3 + = 15
y4 + = 15
end for
|
Please specify what version of Turing you are using
4.1.1
PS: this is kinda urgent...
Description: |
|
 Download |
Filename: |
DDR GAME.zip |
Filesize: |
13.93 KB |
Downloaded: |
38 Time(s) |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Tony

|
Posted: Sun Dec 06, 2009 8:44 pm Post subject: RE:Need Help Fixing Animation Problem |
|
|
I see that you are using pixXor as a draw option. Do you know what does does, as oppose to default picCopy?
You can also just clear the whole screen with cls
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
cool1143
|
Posted: Sun Dec 06, 2009 9:02 pm Post subject: Re: Need Help Fixing Animation Problem |
|
|
but if i use cls, then all the other arrows would be cleared, and the images would look choppy...
|
|
|
|
|
 |
TheGuardian001
|
Posted: Sun Dec 06, 2009 9:11 pm Post subject: Re: Need Help Fixing Animation Problem |
|
|
This is where the magic of View.Set("offscreenonly") and View.Update come in.
using View.Set("offscreenonly") will cause everything you draw to be drawn offscreen. This offscreen image will be drawn on the screen only when you call View.Update.
Basically, It causes everything to be drawn at the same time, instead of one by one, removing flickering and choppiness. You use it like this:
|
|
|
|
|
 |
cool1143
|
Posted: Sun Dec 06, 2009 9:32 pm Post subject: Re: Need Help Fixing Animation Problem |
|
|
hurray thanks! im gonna expect alot more posts from me in the help section during this week :/ making a game with limited knowledge in turing is hard
|
|
|
|
|
 |
|
|