Advertisement
drakon-firestone

Untitled

Oct 27th, 2024
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. using Raylib_cs;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Numerics;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8.  
  9. namespace Snake
  10. {
  11. internal class Waz
  12. {
  13.  
  14. private List<Vector2> cialo;
  15. private Vector2 kierunek;
  16. private int rozmiarSiatki;
  17. private int szerokoscEkranu;
  18. private int wysokoscEkranu;
  19. private bool rosnij;
  20.  
  21. public Waz(int rozmiarSiatki, int szerokoscEkranu, int wysokoscEkranu)
  22. {
  23. this.rozmiarSiatki = rozmiarSiatki;
  24. this.szerokoscEkranu = szerokoscEkranu;
  25. this.wysokoscEkranu = wysokoscEkranu;
  26.  
  27. cialo = new List<Vector2>();
  28. cialo.Add(new Vector2(szerokoscEkranu / 2, wysokoscEkranu / 2));
  29. kierunek = new Vector2(1, 0);
  30. rosnij = false;
  31. }
  32.  
  33.  
  34.  
  35. public void Rysuj()
  36. {
  37. foreach (var segment in cialo)
  38. {
  39. Raylib.DrawRectangle((int)segment.X, (int)segment.Y,
  40. rozmiarSiatki, rozmiarSiatki, Color.Green);
  41. }
  42. }
  43.  
  44. }
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement