Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. #define DisplaySerial Serial
  2.  
  3. #include <Picaso_Const4D.h>
  4. #include <Picaso_Serial_4DLib.h>
  5.  
  6. Picaso_Serial_4DLib Display(&DisplaySerial); //Serial0 kommunikoi näytön kanssa.
  7.  
  8. int kenttakoko[2] = {320,240};
  9. int pallo[2] = {20,(kenttakoko[1]/2)};
  10.  
  11. int pikselikoko = 20;
  12. int seinanLeveys = 5;
  13. int mailaX = 5;
  14. int mailaY = 10;
  15. int pallonKoko = 7;
  16. int nopeus = 3;
  17.  
  18. int pelaajaApisteet = 0;
  19. int pelaajaBpisteet = 0;
  20. int pelaajaApaikka = 0;
  21. int pelaajaBpaikka = 0;
  22.  
  23. char palloSuuntaVaaka = 'R';
  24. char palloSuuntaPysty = 'S';
  25.  
  26. boolean peliPyorii = true;
  27.  
  28.  
  29. void setup() {
  30.  
  31. Display.TimeLimit4D = 5000 ; //Viiden sekunnin viive kaikkiin komentoihin.
  32.  
  33. DisplaySerial.begin(9600) ;
  34.  
  35. delay (5000); //Annetaan näytölle aikaa käynnistyä
  36.  
  37. Display.gfx_ScreenMode(LANDSCAPE); //Laitetaan näyttö vaakatasoon.
  38. Display.gfx_Cls(); //Tyhjennetään näyttö.
  39. Display.gfx_RectangleFilled(5,90,15,140,WHITE); //Piirretään "mailat".
  40. Display.gfx_RectangleFilled(315,90,305,140,WHITE);
  41.  
  42. }
  43.  
  44. void palloPiirto(int x, int y) {
  45. Display.gfx_CircleFilled(x,y,pallonKoko,WHITE); //Piirretään pallo
  46. }
  47.  
  48. void palloPoisto(int x, int y) {
  49. Display.gfx_CircleFilled(x,y,pallonKoko,BLACK); //Poistetaan pallo
  50. }
  51.  
  52. void mailaA(int x, int y) {
  53. Display.gfx_RectangleFilled(x,y,
  54. }
  55.  
  56. void loop()
  57. {
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement