Advertisement
br1wr2el3

Code 07 - CircleTest

Apr 19th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. -- Code 07 - CircleTest
  2. -- will upload to Codea
  3.  
  4. -- Bruce Elliott
  5. -- April 2013
  6.  
  7. -- Use this function to perform your initial setup
  8. function setup()
  9. print("Circle Test")
  10. print("Touch the screen to move the circle")
  11. print("Drag the circle and it will follow")
  12.  
  13. -- Set the starting point for the circle
  14. X = 50
  15. Y = 50()
  16. end
  17.  
  18. -- This function gets called once every frame
  19. function draw()
  20.  
  21. -- Set up the screen for drawing
  22. background(40, 40, 50)
  23. fill(35, 82, 208, 255)
  24. -- This sets the line thickness
  25. stroke(28, 203, 20, 255)
  26. strokeWidth(5)
  27.  
  28. -- Draw the circle
  29. ellipse(X, Y,100)
  30.  
  31. end
  32.  
  33. function touched(touch)
  34. -- Check for a touch
  35. -- X and Y will update
  36. -- if you touch the screen
  37. -- or as you drag across the screen
  38.  
  39. if touch.state == BEGAN or touch.state == MOVING then
  40. X = touch.x
  41. Y = touch.y
  42. end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement