Computer Science Canada

Need help with my animation.

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 12:50 pm ]
Post subject:  Need help with my animation.

Okay I have an animation it runs fine but it iesn't too good, so can someone tell me what I can fix up on it and tell me how please. This is my best work, I spent hours on it, if I don't get a good mark on this I fail the class, and with my science and turing exam on monday and tuesday I have so much work to do. Here is my animation:
code:

colourback (11)
cls

for col : 1 .. maxy by 25
    drawfilloval (95, col, 64, 64, yellow)
    drawfilloval (470, 15, 240, 150, brown)
    drawfilloval (130, 10, 250, 180, brown)
    delay (64)
   
    drawfilloval (95, col, 64, 64, 11)
    drawfilloval (470, 15, 240, 150, brown)
    drawfilloval (130, 10, 250, 180, brown)
end for
drawfilloval (470, 15, 240, 150, brown)
drawfilloval (130, 10, 250, 180, brown)
colourback (black)
cls

for col : 1 .. maxy by 10000
    drawfilloval (95, 330, 30, 30, yellow)
    delay (1)


    drawfilloval (470, 15, 240, 150, brown)
    drawfilloval (130, 10, 250, 180, brown)
    for : 1 .. 255
        drawfilloval (300, 350, 1, 1, yellow)

        drawfilloval (400, 350, 1, 1, yellow)

        drawfilloval (400, 320, 1, 1, yellow)

        drawfilloval (320, 300, 1, 1, yellow)

        drawfilloval (450, 300, 1, 1, yellow)

        drawfilloval (420, 250, 1, 1, yellow)

        drawfilloval (200, 300, 1, 1, yellow)

        drawfilloval (150, 350, 1, 1, yellow)

        drawfilloval (170, 225, 1, 1, yellow)

        drawfilloval (250, 320, 1, 1, yellow)

        drawfilloval (320, 300, 1, 1, yellow)

        drawfilloval (230, 345, 1, 1, yellow)

        drawfilloval (520, 270, 1, 1, yellow)

        drawfilloval (920, 245, 1, 1, yellow)

        drawfilloval (320, 270, 1, 1, yellow)

        drawfilloval (500, 350, 1, 1, yellow)

        drawfilloval (100, 250, 1, 1, yellow)
        delay (64)
    end for
    cls
end for

for decreasing count : maxy .. 1
    drawfilloval (95, count, 64, 64, yellow)
    drawfilloval (470, 15, 240, 150, brown)
    drawfilloval (130, 10, 250, 180, brown)
    delay (11)
    drawfilloval (95, count, 64, 64, black)
    drawfilloval (470, 15, 240, 150, brown)
    drawfilloval (130, 10, 250, 180, brown)

end for



Author:  Cervantes [ Sun Jun 11, 2006 12:56 pm ]
Post subject: 

You might want to use double buffering to reduce flickering.

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 1:04 pm ]
Post subject: 

Okay hopefully that will help a bit but not make my program go wow that's amazing. I'll tyr to do more work on my animation, after I study for my science exam 2mro and work on this animation so I can hand it in 2mro as well. Crying or Very sad

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 6:08 pm ]
Post subject: 

I don't get how to put offscreenonly, do I just type in offscreenonly and it will stop fickering?

Author:  Cervantes [ Sun Jun 11, 2006 6:13 pm ]
Post subject: 

kickflipto50-50tobigspin wrote:
I don't get how to put offscreenonly, do I just type in offscreenonly and it will stop fickering?

No. Read the tutorial that I linked to my last post.

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 6:23 pm ]
Post subject: 

Cervantes wrote:
kickflipto50-50tobigspin wrote:
I don't get how to put offscreenonly, do I just type in offscreenonly and it will stop fickering?

No. Read the tutorial that I linked to my last post.

I'm starting to get it a little but my teacher didn't teach us View.Set ("graphics,offscreenonly") so if I use it he'll be like how did he do that. He's good at turing but I'm 100% sure that you guys on the forums are much better than him. Is there anyway to stop the flickering by using delays or something like that? Also what else can I add to my animation?

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 6:41 pm ]
Post subject: 

okay I can fix my animation by using delay and by such and such, but it takes a long time for the next thing to pop up on the screen. How do I want to add a song in the backround so can someone tell me how to add a wmv or mp3 file to play on my turing program? Also when my moon comes down i nthe animation I can get it to come behind the ground but it starts to mix colours with the ground how do I get it to stop that. I can live with that but I'd rather know how to add music to it. Wink

Author:  Cervantes [ Sun Jun 11, 2006 6:47 pm ]
Post subject: 

kickflipto50-50tobigspin wrote:
How do I want to add a song in the backround so can someone tell me how to add a wmv or mp3 file to play on my turing program?


Did your teacher not tell you how to do that? If not, then why are you doing it? You're teacher will be suspicious.

The point is, it's okay to learn outside of the classroom. In fact, it's encouraged. Especially with a course like Computer Science, such much of the material can be self taught, and it is often to the student's advantage to self-teach him or herself.

Music.PlayFile or something like that. Check the Music module in the Turing Help manual (press F10 when in the Turing window).

kickflipto50-50tobigspin wrote:
Also when my moon comes down i nthe animation I can get it to come behind the ground but it starts to mix colours with the ground how do I get it to stop that.

I'm not quite sure what you mean. (I'll let you in on a little secret: I haven't even run your code!) I'm guessing the problem is that you're drawing the moon after your drawing the ground. Try drawing it before you draw the ground, so that the ground will overlap the moon.

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 6:58 pm ]
Post subject: 

Cervantes wrote:
kickflipto50-50tobigspin wrote:
How do I want to add a song in the backround so can someone tell me how to add a wmv or mp3 file to play on my turing program?


Did your teacher not tell you how to do that? If not, then why are you doing it? You're teacher will be suspicious.

The point is, it's okay to learn outside of the classroom. In fact, it's encouraged. Especially with a course like Computer Science, such much of the material can be self taught, and it is often to the student's advantage to self-teach him or herself.

Music.PlayFile or something like that. Check the Music module in the Turing Help manual (press F10 when in the Turing window).

kickflipto50-50tobigspin wrote:
Also when my moon comes down i nthe animation I can get it to come behind the ground but it starts to mix colours with the ground how do I get it to stop that.

I'm not quite sure what you mean. (I'll let you in on a little secret: I haven't even run your code!) I'm guessing the problem is that you're drawing the moon after your drawing the ground. Try drawing it before you draw the ground, so that the ground will overlap the moon.

Okay people in my class have music so he won't be suspicious, I just don't know how to do it, so I put Music.PlayFile in my program but how will I be able to pick the song? Okay I have the moon first and then the ground, but when it starts to come behind the hill it starts to mix colours. do you understand now?

Author:  Cervantes [ Sun Jun 11, 2006 7:29 pm ]
Post subject: 

kickflipto50-50tobigspin wrote:
I put Music.PlayFile in my program but how will I be able to pick the song?

Look at the Turing Help manual. You'll see that this procedure accepts one parameter, and that is a string that is the path and the filename of the file you want to play. You can omit the path and it will search in the directory that your turing program is in.

kickflipto50-50tobigspin wrote:

Okay I have the moon first and then the ground, but when it starts to come behind the hill it starts to mix colours. do you understand now?

No. I don't see how the colours can 'mix'. The only way that could happen is if you are manually mixing the colours using the RGB module, which I'm quite certain you're not.

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 8:28 pm ]
Post subject: 

Okay it still doesn't work, I did this
code:
process DoMusic
    loop
        Music.PlayFile ("@##@$%$^#.mp3")
    end loop
end DoMusic

fork DoMusic

do I have to put the location of the song?

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 8:34 pm ]
Post subject: 

NVM I got it working, but if I send it to my teacher and present it to the class won't there be no music does the the song have to be on the computer?

Author:  TheOneTrueGod [ Sun Jun 11, 2006 8:35 pm ]
Post subject: 

well, does "@##@$%$^#.mp3" exist in the directory that your program is in? if not, then of course it won't work. Read Cervantes' posts.

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 8:48 pm ]
Post subject: 

okay it works for one of my animation but not for good animation with delays will it not work for that one?

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 10:28 pm ]
Post subject: 

Okay when I add View.Set ("graphics,offscreenonly") the program doesn't appear.

Author:  [Gandalf] [ Sun Jun 11, 2006 10:38 pm ]
Post subject: 

Have you read the tutorial thoroughly? You need to use View.Update with offscreenonly.

Author:  kickflipto50-50tobigspin [ Sun Jun 11, 2006 11:05 pm ]
Post subject: 

[Gandalf] wrote:
Have you read the tutorial thoroughly? You need to use View.Update with offscreenonly.

Okay I put that at the end of the program do I have to put it everytiem something new pops up?

Author:  kickflipto50-50tobigspin [ Mon Jun 12, 2006 7:30 am ]
Post subject: 

Okay I think I'm doen my animation, stayed up until 4:00 in the morning to finish it. It still flickers but it's okay. Also how do I get the program to stop and exit ( close the window) when the song is over?

Author:  Hack.saw [ Mon Jun 12, 2006 9:53 am ]
Post subject: 

Use and exit when the fulfil the variable. You could just a a variable at the endof the song (IE. A:=A+1) then exit when a=1 or how ever many times you want it to run (ex. for two runs make it exit when a=2)
[/code]

Author:  kickflipto50-50tobigspin [ Mon Jun 12, 2006 10:46 am ]
Post subject: 

^^^
Okay I have no idea, what you're trying to saw. Sad

Author:  Jimbo 420 [ Mon Jun 12, 2006 12:04 pm ]
Post subject: 

make a variable to count the repetition of the song and put exit when a=2 so it will close as soon and the counter(a) reaches 2

Author:  Hack.saw [ Mon Jun 12, 2006 2:05 pm ]
Post subject: 

Ahhh... are you using a loop for the song or does it just play once?
If you are using a loop just use what i put in my last post otherwise just put an "exit" after the song. Then it will play the song then close the window.

Author:  kickflipto50-50tobigspin [ Wed Jun 14, 2006 6:44 pm ]
Post subject: 

Well I had my exam for my Turing class, the exam was so hard. I stayed up all night drinking energy drinks to study and and still think I didn't do well. Hopefully I still pass the course, I still can make some last minute changes to my animation since I didn't present it yet, it's my last chance to to pass. What should I add to my animation that's easy to do? Crying or Very sad


: