window.basic 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. print("hi\n")
  2. initWindow(300, 400)
  3. function big(x, y)
  4. c = color(20, 0, 31)
  5. for ax = 0 to 2
  6. for ay = 0 to 2
  7. setPixel(x + ax, y + ay, c)
  8. end
  9. end
  10. end
  11. x = 0
  12. y = 0
  13. while !shouldClose()
  14. nextFrame()
  15. clearWindow(color(0, 18, 15))
  16. c = color(20, 0, 31)
  17. if isButtonDown(BT_LEFT)
  18. x = x - 1
  19. end
  20. if isButtonDown(BT_RIGHT)
  21. x = x + 1
  22. end
  23. if isButtonDown(BT_UP)
  24. y = y - 1
  25. end
  26. if isButtonDown(BT_DOWN)
  27. y = y + 1
  28. end
  29. if isButtonDown(BT_START)
  30. big(100, 80)
  31. end
  32. if isButtonDown(BT_SELECT)
  33. big(100, 90)
  34. end
  35. if isButtonDown(BT_A)
  36. big(100, 100)
  37. end
  38. if isButtonDown(BT_B)
  39. big(100, 110)
  40. end
  41. if isButtonDown(BT_X)
  42. big(100, 120)
  43. end
  44. if isButtonDown(BT_Y)
  45. big(100, 130)
  46. end
  47. if isButtonDown(BT_L)
  48. big(100, 140)
  49. end
  50. if isButtonDown(BT_R)
  51. big(100, 150)
  52. end
  53. if x < 0
  54. x = 0
  55. end
  56. if x > 237
  57. x = 237
  58. end
  59. if y < 0
  60. y = 0
  61. end
  62. if y > 157
  63. y = 157
  64. end
  65. big(x, y)
  66. end
  67. printLine("stop")