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

Username:   Password: 
 RegisterRegister   
 cant figure out how to move my image with out it dragging
Index -> Programming, Turing -> Turing Tutorials
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ShockingRotom




PostPosted: Thu Oct 04, 2018 8:12 pm   Post subject: cant figure out how to move my image with out it dragging

whenever the image moves it drags and leaves multiple versions of itself. How do i fix this? here is the part of my code that i am having problems with.


%I set the location
blockx := 300
blocky := 190
loop
%draw my background
Pic.Draw (start,0,0, picCopy)
Pic.Draw (genderblock,blockx,blocky, picCopy)
%draw the image that i want to move before because it is my character
Mouse.Where (x, y, button)
if button = 1 and x >= 280 and x <= 360 and y >= 325 then
%this checks when i click the arrow to the next room. after this i want it to play the animation of the character moving over to the exit which is straight ahead
loop
Pic.Draw (genderblock,blockx,blocky, picCopy)
%i draw it again in the loop so it moves (I know that even after i fix the dragging there will be a problem with the first image drawn outside the loop but i first want to figure out this
blocky += 1
%I add to the y so it moves up
delay (10)
if blocky = 370 then
%this is the end of the room so i want it so exit the loop and move on.
exit
end if
end loop
exit
end if
end loop
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Sat Oct 06, 2018 11:07 am   Post subject: RE:cant figure out how to move my image with out it dragging

You aren't moving the picture, you're drawing it again in a different spot. The old image needs to be erased before the new one is drawn.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: