Advertisement
br1wr2el3

Code 01 - Box

Apr 18th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. -- Code 01 - Box
  2. -- Tested to copy and word in Codea
  3.  
  4. -- Just draw a box on the screen. A first step to Codea programs.
  5.  
  6. -- Use this function to perform your initial setup
  7. function setup()
  8. print("Draw box on screen")
  9.  
  10. --Store the location of our box in two variables
  11.  
  12. x = 100
  13. y = 200
  14. end
  15.  
  16. -- This function gets called once every frame
  17. function draw()
  18. -- This sets a dark background color
  19. background(40, 40, 50)
  20.  
  21. -- This sets the line thickness
  22. strokeWidth(5)
  23.  
  24. -- Do your drawing here
  25.  
  26. rect(x, y, WIDTH/2, HEIGHT/2)
  27.  
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement