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

Username:   Password: 
 RegisterRegister   
 Can Someone how me on my program?
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
audi123




PostPosted: Tue Dec 14, 2010 9:58 am   Post subject: Can Someone how me on my program?

setscreen ("graphics")
var x,y:int
var headx,heady,bodyx,bodyy, leftlegx,leftlegy,rightlegx,rightlegy,leftarmx,leftarmy,rightarmx,rightarmy:int
var chars : array char of boolean
Input.KeyDown(chars)
loop
if chars (KEY_UP_ARROW) then
heady:=heady+5
end if
if chars (KEY_RIGHT_ARROW) then
headx:=headx+5
end if
if chars (KEY_DOWN_ARROW) then
heady:=heady-5
end if
if chars (KEY_LEFT_ARROW)then
headx:=headx-5
end if
headx:=100
heady:=100
bodyx:=100
bodyy:=45
leftlegx:=80
leftlegy:=14
rightlegx:=125
rightlegy:=12
leftarmx:=75
leftarmy:=60
rightarmx:=130
rightarmy:=60
drawfilloval (headx,heady , 15, 15, green) %Head%
drawline (bodyx,bodyy , 100, 100, green)%Body%
drawline (leftlegx, leftlegy, 100, 45, green)%Left Leg%
drawline (rightlegx,rightlegy , 100, 45, green)%Right Leg%
drawline ( leftarmx,leftarmy , 100, 75, green)%LeftArm%
drawline ( rightarmx,rightarmy , 100, 75, green)%Right Arm%
end loop


Basically it doesnt move around when i press the arrow keys -,-
Sponsor
Sponsor
Sponsor
sponsor
TheGuardian001




PostPosted: Tue Dec 14, 2010 1:24 pm   Post subject: Re: Can Someone how me on my program?

Your "Input.Keydown" call is not inside the loop. You only actually read input once.
Display posts from previous:   
   Index -> General Programming
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: