Computer Science Canada help with animation to move the car into the garage. |
Author: | asianrandy [ Fri Oct 17, 2008 4:12 pm ] | ||||
Post subject: | help with animation to move the car into the garage. | ||||
i trying to move the car into the garage. but i dont know where to put the code
|
Author: | Tony [ Fri Oct 17, 2008 4:49 pm ] |
Post subject: | RE:help with animation to move the car into the garage. |
delays, typically, go inside animation loops. |
Author: | Insectoid [ Fri Oct 17, 2008 4:55 pm ] |
Post subject: | RE:help with animation to move the car into the garage. |
Your animation needs to be in a loop, with a modification to the car's X value to make it move. The very last part of the animation should be a View.Update (check the Turing Walkthrough), followed by a delay and then a 'cls'. |
Author: | asianrandy [ Fri Oct 17, 2008 7:37 pm ] | ||
Post subject: | Re: help with animation to move the car into the garage. | ||
k i got this example from view,update (tutorial) and i just need to take out the y or radius. and put the car's X value. so my car can move?
|
Author: | Insectoid [ Fri Oct 17, 2008 7:47 pm ] |
Post subject: | RE:help with animation to move the car into the garage. |
Uh, no. This is for character control. You need to make your own. Yes, you do only manipulate yor car's X value. The important thing is that you understand View.Update. I hope. |
Author: | asianrandy [ Fri Oct 17, 2008 10:17 pm ] |
Post subject: | Re: help with animation to move the car into the garage. |
lol i don't , so that means l'm screwed. i need like more examples on view.update. so what should i do then. |
Author: | andrew. [ Fri Oct 17, 2008 11:55 pm ] |
Post subject: | RE:help with animation to move the car into the garage. |
Well, basically View.Update just draws everything onscreen at once. So if you don't use it, then nothing on your screen is drawn. Think of it like this: the computer draws what you want in it's head, but will only display that on your screen when you call View.Update. Hope that helps with your View.Update dilemma. Now about moving the car. Think about what you want it to do. You want it to move sideways. That means you're doing something to the X values, right? Well you know that when you drew the car, you used X and Y values to locate the pieces. So to move the car left, you would subtract from those X values. And you would add to those X values to move to the right. Well, how would you keep adding on to the X values? With a variable of course. I think I will stop there and let you figure out the rest ![]() |
Author: | Ktomislav [ Sat Oct 18, 2008 8:39 am ] | ||
Post subject: | Re: help with animation to move the car into the garage. | ||
You probably don't understand this but maybe it can help you. Pic.New (x1, y1, x2, y2) is saving a picture from screen into a variable so you can just draw that picture as a background. Pic.Draw (backgroung, 0, 0, picCopy) - it draws that background picture - 0, 0 are coordinates and picCopy just picCopy you don't need anything else. drawfillbox (560-i*3, 50, 760-i*3, 100, black) -> 560-i*3 that means that that box's x coordinate will go smaller so it will move from right to left side. ![]() ![]() ![]() If you don't understand this than you should take a look at some tutorial. |
Author: | asianrandy [ Tue Oct 21, 2008 12:19 pm ] | ||
Post subject: | RE:help with animation to move the car into the garage. | ||
lm trying to make the sun go left, and i don't no where to put the loop. and does loop make the program keep going. |
Author: | copthesaint [ Sat Nov 08, 2008 5:20 pm ] |
Post subject: | Re: help with animation to move the car into the garage. |
If you use process you can do multiple things at one time for example: var num:=1 %the line that travels to the right process box1 for i:1..maxx+10 drawfillbox (0,(maxy div 2)-5,i+10,(maxy div 2)+5,white) View.Update delay(5) end for num:=1 end box1 %the box that travels to the left process box2 for i:1..maxx+10 drawfillbox (maxx,(maxy div 2)-15,(maxx-10)-i,(maxy div 2)-5,white) View.Update delay(5) end for num:=1 end box2 %the box that expands process box3 for i:1..maxx+10 drawfillbox ((maxx div 2)-i,(maxy div 2)-i,(maxx div 2)+i,(maxy div 2)+i,black) View.Update delay(5) end for num:=1 end box3 loop if num=1 then cls fork box3 fork box1 fork box2 delay(1) num:=0 end if end loop so useing a process you could move then sun at the same time |
Author: | syntax_error [ Sat Nov 08, 2008 5:30 pm ] |
Post subject: | RE:help with animation to move the car into the garage. |
Never fork. Never. |