Need help for moving smoke without trail
Author |
Message |
Lucy Xu
|
Posted: Fri May 10, 2013 8:22 pm Post subject: Need help for moving smoke without trail |
|
|
What is it you are trying to achieve?
i want to make my smoke moving without trail
What is the problem you are having?
the smoke is moving but there are trail in the screen that i can't clear them
Describe what you have tried to solve this problem
i try to add cls in the loop and after loop, it doesn't work.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>
Turing: |
setscreen ("graphics:1012;660")
setscreen ("offscreenonly")
%Smoke variables
var smoke1 : int := 250
var smoke2 : int := 265
var smoke3 : int := 280
loop
%Draw Smoke that moves up
Draw.FillOval (345, smoke3, 20, 20, 28)
Draw.FillOval (345, smoke2, 15, 15, 29)
Draw.FillOval (345, smoke1, 10, 10, 30)
smoke1 := smoke1 + 2
smoke2 := smoke2 + 2
smoke3 := smoke3 + 2
if smoke1 > 700 then
smoke1 := 260
end if
if smoke2 > 700 then
smoke2 := 260
end if
if smoke3 > 700 then
smoke3 := 260
end if
end loop
|
Please specify what version of Turing you are using
<Answer Here> |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Nathan4102
|
Posted: Fri May 10, 2013 8:53 pm Post subject: RE:Need help for moving smoke without trail |
|
|
You need a delay and a cls at the end of your loop, in that order. If you find your animation is flashy, look up View.Update. |
|
|
|
|
|
Lucy Xu
|
Posted: Fri May 10, 2013 10:27 pm Post subject: RE:Need help for moving smoke without trail |
|
|
but the problem is i have other stuff in my loop, so if i did cls, all the things were disappear. i only want trail disappear. |
|
|
|
|
|
Nathan4102
|
Posted: Fri May 10, 2013 10:42 pm Post subject: RE:Need help for moving smoke without trail |
|
|
Unfortunately turing cant clear individual layers. You will need to clear the whole screen, then redraw the smoke and trail. If you only want to clear a section of the screen, you could try drawfillbox(x1, y1, x2, y2, backgroundcolor) . |
|
|
|
|
|
|
|