Computer Science Canada Summative Assignment Assistance - Basic Animation w/ Basic Pixel Graphics |
Author: | Godess The Hyper Fangirl [ Sat Apr 25, 2009 9:42 pm ] | ||
Post subject: | Summative Assignment Assistance - Basic Animation w/ Basic Pixel Graphics | ||
Alright, so I'm working on my summative assignment. What I want to do is have my stars blink, as well as the flames from the engine. However, the ship will be also going up. I don't know if I can achieve the flames blinking at the same time as the shop moving, however. That's a totally different issue. If no one can help me with that, or if it's not able to be done, that's fine. The main problem I'm having is that I can get the oval to go up, but I can't get the rest of the components of the ship to go up. I've tried applying the same method I did with the ship to the rest of the components(using a 'for count' loop), however it either doesn't do anything or it doesn't do what I'd like it to do. Here is what I have of the code, including the portions which don't work. I have tried several methods, such as putting the counts in different spots and changing coordinates but this is just where I left it. Please keep in mind that I'm only in a 10th grade Turing course, so when commenting keep in mind I may or may not be able to use certain things quite yet. ><
Unfortunately, I don't know which version of Turing we use. If it's extremely important, I can let you know on Monday when I have my class. |
Author: | Euphoracle [ Sat Apr 25, 2009 11:12 pm ] |
Post subject: | RE:Summative Assignment Assistance - Basic Animation w/ Basic Pixel Graphics |
I have no idea what you're trying to do with that code. Have they taught you nothing? |
Author: | Tony [ Sun Apr 26, 2009 12:57 am ] | ||
Post subject: | RE:Summative Assignment Assistance - Basic Animation w/ Basic Pixel Graphics | ||
animation comes down to a frame loop
where 1000 is the number of frames in your full animation (~33 seconds at 30 FPS); some_delay is a delay required to set the FPS (technically this should be Delay.SinceLast, but delay should do for simple animations), and draw is a procedure that draws a particular frame. |
Author: | Godess The Hyper Fangirl [ Sun Apr 26, 2009 6:34 pm ] | ||
Post subject: | Re: RE:Summative Assignment Assistance - Basic Animation w/ Basic Pixel Graphics | ||
Tony @ Sun Apr 26, 2009 12:57 am wrote: animation comes down to a frame loop
I have absolutely no idea what this is, so I have a feeling I shouldn't be using it ^^;; We've been taught right now to have it in a for loop, and then re-draw the item in the colour of the background or whatever it happens to be on. It says right in the textbook(just showing you so you know what we've been doing):
where 1000 is the number of frames in your full animation (~33 seconds at 30 FPS); some_delay is a delay required to set the FPS (technically this should be Delay.SinceLast, but delay should do for simple animations), and draw is a procedure that draws a particular frame. "The effect of the animation can be achieved with the Pow program by erasing each circle after a delay before plotting the next circle. To erase a circle you can re-plot it using the background colour, number 0. The predefined procedure delay can be called to waste time between the plot of each circle in magenta and the plot of the same circle in black." You can see where I've done this in the portion with the stars. There, it will blink. The same can be applied to the shuttle, except you need to use 'for count' so that way the y-coordinate will change and appear to go upward. However, when I try to use that method with the drawfillbox, drawarc, and drawline it doesn't seem to work. We may learn that way, but we haven't yet. The teacher approved my design, so it must be able to be done this way. Your way is probably easier, but I don't want to get it wrong simply because I used things that weren't in the chapter. |
Author: | saltpro15 [ Sun Apr 26, 2009 8:09 pm ] |
Post subject: | RE:Summative Assignment Assistance - Basic Animation w/ Basic Pixel Graphics |
Quote: This program depics a space shittle flying through space.
hehehe your code makes no sense btw |
Author: | Godess The Hyper Fangirl [ Mon Apr 27, 2009 10:46 am ] |
Post subject: | Re: RE:Summative Assignment Assistance - Basic Animation w/ Basic Pixel Graphics |
saltpro15 @ Sun Apr 26, 2009 8:09 pm wrote: Quote: This program depics a space shittle flying through space.
hehehe your code makes no sense btw And you're the second person to say that, so perhaps you could tell me how it makes no sense? That could help me find the problem. |
Author: | DifinityRJ [ Mon Apr 27, 2009 11:06 am ] | ||
Post subject: | Re: Summative Assignment Assistance - Basic Animation w/ Basic Pixel Graphics | ||
You need to keep track of your shuttle's x position and y position in order to move the shuttle and the flames. shuttle_x is for the x-position shuttle_y is for the y-position Use those variables when drawing, and that way you can track of its position and draw the flames below the shuttle by subtracting whatever amount is needed. For blinking, you can use something as simple as a 'counter' There is a tutorial on that in the tutorial section, but I think its self-explanatory. counters work by adding any amount (for example '1') to a variable such as 'starcounter'. Every time it loops, it adds 1 to that variable, and you can set up an if-statement saying: if counter is between 0 and 20 then draw whatever end if Good luck. |