window.basic 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. white = color(31, 31, 31)
  30. render(0, 0, white, "Start: ", getButtonDownTime(BT_START))
  31. render(0, 8, white, "Select: ", getButtonDownTime(BT_SELECT))
  32. render(0, 16, white, "A: ", getButtonDownTime(BT_A))
  33. render(0, 24, white, "B: ", getButtonDownTime(BT_B))
  34. render(0, 32, white, "X: ", getButtonDownTime(BT_X))
  35. render(0, 40, white, "Y: ", getButtonDownTime(BT_Y))
  36. render(0, 48, white, "L: ", getButtonDownTime(BT_L))
  37. render(0, 56, white, "R: ", getButtonDownTime(BT_R))
  38. render(0, 64, white, "äüößÄÜÖ")
  39. if x < 0
  40. x = 0
  41. end
  42. if x > 237
  43. x = 237
  44. end
  45. if y < 0
  46. y = 0
  47. end
  48. if y > 157
  49. y = 157
  50. end
  51. big(x, y)
  52. #render(0, 0, c, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
  53. #render(0, 8, c, "abcdefghijklmnopqrstuvwxyz")
  54. #render(0, 16, c, "0123456789()[]{}<>/\\?")
  55. #render(0, 24, c, "\"$%^&*-_=+#~.,;:|")
  56. end
  57. printLine("stop")