Posted: Fri Dec 26, 2008 8:40 pm Post subject: help with animation
i help with animation because i have a problem. first lm trying to do is making robot moves first than move the tanks.
code:
% Randy Phalla TIK 20 - Computer and Information Science Culminationg Activity
%
setscreen ("graphics:1010;670")
View.Set ("offscreenonly")
var background : int;
background := Pic.New (0, 0, maxx, maxy)
for i : 0 .. 50
cls
Pic.Draw (background, 0, 0, picCopy)
%Transfomer
drawfillbox (800-i*2, 300, 670-i*2, 500, red) %body
drawfillbox (540-i*2, 470, 670-i*2, 500, blue) % right arm
drawfillbox (800-i*2, 470, 920-i*2, 500, blue) % left arm
drawfillbox (770-i*2, 570, 700-i*2, 500, black) % Head
drawfillbox (770-i*2, 600, 790-i*2, 500, blue) % ears
drawfillbox (700-i*2, 600, 677-i*2, 500, blue) %ears
drawfillbox (730-i*2, 170, 670-i*2, 300, blue) %right leg
drawfillbox (740-i*2, 170, 800-i*2, 299, blue) % left leg
drawfillbox (770-i*2, 575, 700-i*2, 571, gray) %top of the head
drawfillbox (700-i*2, 530, 770-i*2, 500, gray)% Month
drawfillbox (770-i*2, 505, 700-i*2, 500, black)
drawfillbox (770-i*2, 510, 700-i*2, 515, black)
drawfillbox (770-i*2, 525, 700-i*2, 520, black)
drawfillbox (670-i*2, 180, 730-i*2, 170, gray)% left foot
drawfillbox (740-i*2, 180, 800-i*2, 170, gray)% left foot
View.Update
delay (90)
end for
Sponsor Sponsor
BigBear
Posted: Fri Dec 26, 2008 9:36 pm Post subject: Re: help with animation
Make a seperate loop to move the tanks the same way you moved the robot
asianrandy
Posted: Sat Dec 27, 2008 8:47 pm Post subject: RE:help with animation
i got an error.
code:
% Randy Phalla TIK 20 - Computer and Information Science Culminationg Activity
%
setscreen ("graphics:1010;670")
View.Set ("offscreenonly")
var background : int;
Posted: Mon Dec 29, 2008 7:05 pm Post subject: RE:help with animation
inside the loop, their are movement first l'm trying is making the transformer moved first and than moved the tank toward to the transformer. and that how the loop should end.
Tony
Posted: Mon Dec 29, 2008 7:18 pm Post subject: Re: RE:help with animation
asianrandy @ Mon Dec 29, 2008 7:05 pm wrote:
and that how the loop should end.
A computer does not try to guess what you want it to do. It blindly executes all of the instructions, precisely, trusting you not to make it do anything stupid.
With that in mind, give the above questions another go.
Posted: Mon Dec 29, 2008 7:34 pm Post subject: RE:help with animation
i need help because their no movement, first the transformer moves first and then the tanks move after. when i start the program, their is no movement. Need some tips to improve this program.
code:
% Randy Phalla TIK 20 - Computer and Information Science Culminationg Activity
setscreen ("graphics:1010;670")
View.Set ("offscreenonly")
var background : int;
Posted: Mon Dec 29, 2008 11:25 pm Post subject: RE:help with animation
You don't need the loop, remove it and try it again.
A.J
Posted: Tue Dec 30, 2008 1:17 pm Post subject: Re: help with animation
I'd really advise u to look into procedures, so that you can arrange your code into the smaller chunks of code with specific goals instead of drawing all the boxes in the main animation loop...
secondly, I'll advise u to not draw the boxes with specific numbers. Rather, try drawing them with respect to the center of the screen.
That way, it will be easier to figure out what direction to go, and it will also be easier to make changes (or debug).
asianrandy
Posted: Tue Dec 30, 2008 11:59 pm Post subject: RE:help with animation
i don't know how to use procedures like drawing boxes.