Computer Science Canada animation |
Author: | pwnapple [ Thu Dec 29, 2005 4:53 pm ] | ||
Post subject: | animation | ||
i'm working on this thing and i need to know how to make the fish go back and forth, up and down etc. thx
|
Author: | ecliptical [ Thu Dec 29, 2005 6:09 pm ] |
Post subject: | How so? |
Do you need to be able to control the fish with buttons or the mouse? or Do you just need to be able to animate the fish? |
Author: | pwnapple [ Thu Dec 29, 2005 6:12 pm ] |
Post subject: | |
just animate the fish |
Author: | pavol [ Thu Dec 29, 2005 6:35 pm ] | ||||
Post subject: | |||||
the same way you animated the background:
you can animate the fish. just add the value of i (in a for loop) to the x and y coordinates of your shapes.
this is an example in which the fish should move 100 to the right |
Author: | ecliptical [ Thu Dec 29, 2005 6:55 pm ] | ||
Post subject: | |||
I wouldn't suggest using that method... I would rather do it this way...
I hope I haven't given away to much but you seem to have a solid understanding of the draw commands. If you understand this type of procedure then you should be able to modifiy it enough so that you can edit the bodyColor, outlineColor, and eyeColor of the fish. |
Author: | pwnapple [ Thu Dec 29, 2005 10:18 pm ] |
Post subject: | |
thx for the help BUT pavols way does not work and i don't understand eliptical's way |
Author: | chrispminis [ Thu Dec 29, 2005 10:50 pm ] |
Post subject: | |
pwnapple, neither pavol nor eliptical gave the full soure code that you need. They simply outlined the logic and basic programming needed. Try to figure out some of it on your own. I was thinking of doing Fishy as well |
Author: | pwnapple [ Thu Dec 29, 2005 11:26 pm ] |
Post subject: | |
oh i see, could you possibly explain it? |
Author: | ecliptical [ Thu Dec 29, 2005 11:45 pm ] |
Post subject: | |
pwnapple, like chrispminis said we just created the outline... and if you don't understand something play with it change things, change them back, check the reference, ask questions...etc. It's a great way to learn ! And this forum is probably the best place you'll find the best of Turing is here. |
Author: | ecliptical [ Fri Dec 30, 2005 12:01 am ] | ||||||
Post subject: | |||||||
Here's how it works.... Lets say I want to draw a circle, not an oval that requires a x Radius and a y Radius just a circle. Currently turing doesn't have a built in "drawcircle"...that sucks... so lets MAKE ONE!
ok well that works pretty much in the same way that you fish does. But what if I want to move this circle to draw it in a different location? Does this mean I have to create a new procedure with a new location ? NO! Now some of this code is alright the circle (actually an oval - much like you fish isn't really a fish but a combination of arcs, lines and ovals..) is a circle that is it's perfectly round, so that concept will stay the same. But we need to be able to draw it at different locations, and while we're at it draw it with different colors too!
See what we did? When we created the procedure we also gave it some values you can change... So what this procedure is really saying is... when the "drawcircle" procedure is called get the x,y, and color values from the user of where we draw the oval with a x and y radius of 50. but of course we won't always want a circle that has a Radius of 50 will we... so lets make some additional changes so we have total control over drawing a circle.
And THAT is all... now I can user drawcircle where ever I have included this procedure. |
Author: | Mr. T [ Fri Dec 30, 2005 12:45 am ] |
Post subject: | Alex's Opinion |
I've seen an animation like this before on compsci. I think this code might be stolen. |
Author: | ecliptical [ Fri Dec 30, 2005 10:55 am ] |
Post subject: | |
Or teachers could be handing out similair assignments... i know there are some Turing Teacher guides or something...so lets not assume the worst first. |
Author: | Saad85 [ Fri Dec 30, 2005 11:10 am ] |
Post subject: | |
does it really matter if its stolen? hes not trying to take credit for it, hes trying to learn from it |
Author: | ecliptical [ Fri Dec 30, 2005 3:37 pm ] |
Post subject: | |
and the source code to a fish isn't all that of an impressive thing to steal anyway =) |
Author: | jeo77 [ Sun Jan 01, 2006 3:13 pm ] | ||
Post subject: | |||
Here's ecliptical's way put into you'r source code, mabey it'll make more sence when you see it there
|
Author: | MysticVegeta [ Sun Jan 01, 2006 5:13 pm ] | ||
Post subject: | |||
You know there is a more efficient way to do it. Instead of looping the background again and again why not call it once and then just loop 1 box required to cover the previously drawn fish Also, this way is better, compare the speeds if you need to
|
Author: | ecliptical [ Sun Jan 01, 2006 7:42 pm ] | ||
Post subject: | |||
And here is another example where I've varied the speed of the fish as well as added some background and foreground objects to give the scene more depth.
|
Author: | MysticVegeta [ Sun Jan 01, 2006 10:16 pm ] |
Post subject: | |
You know you still could have used my technique to make the animation even smoother.... |
Author: | iker [ Fri Jan 06, 2006 7:40 pm ] |
Post subject: | |
MysticVegeta wrote: You know you still could have used my technique to make the animation even smoother....
but what about when the fish goes behind or infront of the seaweeds, with you method it would leave a blue box right on top of the seaweeds |
Author: | RedRogueXIII [ Sun Jan 08, 2006 10:32 am ] |
Post subject: | |
true, mystic's technique only works on a bare background, or a grid where your know exactly where the last sprite was. It's not well suited to the fishy game where you have the whole screen covered in fish, and doesnt really matter if you refresh the whole background or not. BTW: how come your drawing the fish in Turing, i would assume importing pictures would be easier. |