Computer Science Canada

Turing Animation Help

Author:  TheBoyWhoTried [ Thu Nov 26, 2015 9:53 am ]
Post subject:  Turing Animation Help

Hey so for a project I have to animate a Christmas card. What I attempted to do was make snow fall on top of a scene. I've been able to have random spheres appear on the screen like snow. The problem is I need the current snow set to disappear and then come back again (obviously not that same cooridnates as it's randomized) I cleared screen in the loop but then it clears everything else in the program so it's just the snow. I would also want to make it look like snow is actually falling in a pattern. I will link to a youtube video to show you what I mean: https://www.youtube.com/watch?v=zjwG3bVv5xQ I want the snow to sort of be like this


This is my current program:

process snow
setscreen ("graphics")
randomize
var x, y : int
loop
for i : 1 .. 100
randint (x, 0, 1250)
randint (y, 0, 885)
Draw.FillOval (x, y, 2, 2, brightred)
end for
delay (1000)
cls
end loop
end snow

fork snow

%Test if other will stay on screen
put "hellono die yea"

Author:  TokenHerbz [ Thu Nov 26, 2015 11:00 pm ]
Post subject:  RE:Turing Animation Help

if your redrawing the snow over and over a picture, and clearing everything to replace said snow, you have to re-draw the main picture first again, so the new snow goes ontop.

PS fork snow hurts

here check out what i mean::

code:

setscreen ("graphics")

var x, y : int
loop
    Draw.FillBox( 20,20,maxx-20,maxy-20,black) %%said picture
    for i : 1 .. 100
        randint (x, 0, 1250)
        randint (y, 0, 885)
        Draw.FillOval (x, y, 2, 2, brightred)
    end for
    delay (1000)
    cls
end loop

Author:  TheBoyWhoTried [ Fri Nov 27, 2015 11:09 am ]
Post subject:  Re: Turing Animation Help

I avoided inserting whatever the background scene is into the loop because i don't want the background scene to flicker in and rebuild itself. I only want the snow to be animated. In the program you have listed whatever the background will be will flicker in and rebuild itself because it's in the loop. This is what I'm trying to avoid. Please help.

Author:  TokenHerbz [ Fri Nov 27, 2015 4:17 pm ]
Post subject:  RE:Turing Animation Help

Have you tried looking into View.Set and View.Update to solve your flickering problem?

http://compsci.ca/holtsoft/doc/view_set.html
http://compsci.ca/holtsoft/doc/view_update.html

Author:  TheBoyWhoTried [ Fri Nov 27, 2015 4:44 pm ]
Post subject:  Re: Turing Animation Help

I've been trying to learn it today as i stumbled upon it in F10. I will try to learn it and come back with questions although I'm very confused thus far. I was also wondering if it's possible to localize a "cls" (clear screen) command so that it only applies to a certain part of the program and not everything (therefore it would only clear a specific portion etc.)

Author:  TokenHerbz [ Fri Nov 27, 2015 6:53 pm ]
Post subject:  RE:Turing Animation Help

cls is just that, "clear screen" not "parts of screen".

its an everthing or nothing type of deal.

also maybe a small delay() might help? for fps...

Author:  TheBoyWhoTried [ Fri Nov 27, 2015 6:55 pm ]
Post subject:  Re: Turing Animation Help

Well is there a command that would do something like that?

Author:  TokenHerbz [ Sat Nov 28, 2015 1:37 am ]
Post subject:  RE:Turing Animation Help

NO turing does not offer certain things to disapear off the screen like that unless maybe if you dive into sprites, but thats a whole different ball game.

Author:  Insectoid [ Thu Dec 03, 2015 6:59 pm ]
Post subject:  RE:Turing Animation Help

In a proper animation loop, everything gets erased and redrawn every frame. This makes it really easy to erase bits- just don't redraw the parts you don't want to see. Everything else will still get redrawn and the item you didn't want will have disappeared.


: