
-----------------------------------
kirbyeatu
Wed May 29, 2013 6:39 pm

Turing: controlling the movement of a picture
-----------------------------------
Can someone explain how to make a picture you have put in your program, move?



What is the problem you are having?



Describe what you have tried to solve this problem



Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)








Please specify what version of Turing you are using


-----------------------------------
Nathan4102
Wed May 29, 2013 6:41 pm

RE:Turing: controlling the movement of a picture
-----------------------------------
What's your question?

-----------------------------------
kirbyeatu
Wed May 29, 2013 6:54 pm

RE:Turing: controlling the movement of a picture
-----------------------------------
What i mean is, if i input a picture into my program using the "PicDraw" function, how do i make that image move. And by move, i mean how do i assign the arrow keys to move it?

-----------------------------------
Nathan4102
Wed May 29, 2013 7:12 pm

RE:Turing: controlling the movement of a picture
-----------------------------------
In the turing docs (http://compsci.ca/holtsoft/doc/), look up:

Input.Keydown
Pic.Draw
cls
View.Set (offscreenonly section)
View.Update

The input.Keydown page should give you a good idea on how to use arrow keys to do things. Then, to animate the picture, follow this format:

loop
    calculate new picture coords
    draw picture
    View.Update
    cls
end loop

Let me know if you have more questions!

-----------------------------------
kirbyeatu
Wed May 29, 2013 7:17 pm

RE:Turing: controlling the movement of a picture
-----------------------------------
Thank you so much. This is working!
