Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 animation help!!! *desparate*
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
moomoocow




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
StarGateSG-1




PostPosted: Mon Jun 06, 2005 10:54 am   Post subject: (No 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: