Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Questions on HW6-Spring2006

Got questions about animations?
About Pair Programming?

Ask 'em here!

Offer still stands – mail me your code and sounds/images, and I'll make you a movie! Mark Guzdial

anyone want to be my partner?
available MWF 12-whenever
T - 1100-1330, 1500-2200
R- 1800-2100

Do I need to have ScaleBranch in my sound tree? I don't know exactly why it is there......
Nope – not even a requirement to use a sound tree (e.g., linked list would be fine). Mark Guzdial

Will using the bluescreennode node remove the background color of the pictures or make them blend
If the background color is blue, remove. No blending in that code (though you could easily make one that does blend.) Mark Guzdial

I can't get both the animation and the sound to run! Is it because I intertwined the sound and animation code inside the set up? Is it suppose to be seperate?
THAT is the hard part of this assignment. Yes, the code should be deeply intertwingled. Mark Guzdial

Well, there ought to be 2 data structures, one that holds images and one that holds pictures
If you use Mark's method, it's pretty straightforward:
1) call, which will show any frames as they're added,
2) draw the frame on a bg,
3) place it in your FrameSequence (thus causing it to be drawn)
4) play the 'current' sound
5) set current to next
6) manipulate the data structure
7) repeat from step 2

The problem is that your framerate is essentially the speed at which your computer shows things.
Also, you'll get sounds running into each other.

Fixing those things are a bit harder. We had to change FrameSequence and SoundNode, and create a special class to handle extra sound playing stuff. But just stick to Mark's suggestion, and you'll stay out of trouble :)

What does it mean when Java "cannot find symbol"? I have about 20 symbol errors.
Spelling could be wrong, or you've declared something in one place and used it another where it's out-of-scope. Mark Guzdial

So I should have 2 set up methods: One for sound and one for the pictures?
Absolutlely not! ONE setup method that does everything. Mark Guzdial

Could someone recommend a sound class I could refer to for an idea of what the sound part of the code should look like?
SoundNode is a good starting point. Mark Guzdial

I think SoundTreeExample is what the code is suppose to look like, but parts of it should be put together within the frame animation code. I'm still working on it though....
You can use SoundTree, but it's really more complicated than you need. Mark Guzdial

Use SoundNode–It's basically all set up for us.

SoundNode? Thanks Jim!

My sound code did NOT look like SoundNode...which might explain why it doesn't work.......

I might not be looking close enough, but does soundNode have the linking list part already there, or do we have to put that part in?

It extends CollectableNode. So yes. But you might have to use some casting here and there;
Basically, if you get type mismatch error, expected SoundNode, got CollectableNode, you need to cast.
REMOVEDke Jim said. Mark Guzdial

Does this section of code need an identifier?
SoundNode soundlist = new SoundNode(chirp);
    soundlist.setNext(new SoundNode(clap));

I get errors in the last two lines, about an indentifer expected, but I thought after declaring soundlist as a soundNode, it would work. Any suggestions

I don't know about the identifier error, but won't that code give you an infinite loop?
soundlistnew SoundNode(clap)

It will? I did not know that.
The infinite loop is okay since the for loop I set up for the animation will only allow it to play X amount of times. But if I can't get the loop to work in the first place...that's the real problem.

Link to this Page