Computer Science Canada

animation help!!! *desparate*

Author:  moomoocow [ Mon Jun 06, 2005 9:37 am ]
Post subject:  animation help!!! *desparate*

we want to rotate a cannon so when a left or right arrow is pressed, the direction of the cannon would change accordingly. We saved the cannon as a picture, but it disappears on the left side and bottom.
code:

var arrowx : int := 245
var arrowy : int := 50
var chars : array char of boolean
var pic, picid : int
var angle := 0
var x, y, button : int

Pic.ScreenLoad ("windchime.bmp", arrowx, arrowy, picUnderMerge)
pic := Pic.New (245, 50, 287, 141)
cls

procedure left
picid := Pic.Rotate (pic, angle, 1, 1)
Pic.Draw (picid, 220, 50, picCopy)
angle := angle + 1
end left

procedure right
picid := Pic.Rotate (pic, angle, 1, 1)
Pic.Draw (picid, 220, 50, picCopy)
angle := angle - 1
end right
loop
Input.KeyDown (chars)
locate (1, 1)
if chars (KEY_LEFT_ARROW) then
left
elsif chars (KEY_RIGHT_ARROW) then
right
end if
end loop

The pic would not show up first, you have to press the arrow keys.

Author:  StarGateSG-1 [ Mon Jun 06, 2005 10:54 am ]
Post subject: 

The first thing is we need picture in order to test the program. Second off do you need to use a picture or will lines do? Other than that until we get that stuff then we can begin to help you.


: