64 lines
1.5 KiB
Python
64 lines
1.5 KiB
Python
import random
|
|
import numpy
|
|
import os
|
|
import pygame
|
|
############Dane początkowe#############
|
|
#Szerokość i wysokość okna gry
|
|
ILE_RUCHOW = 0
|
|
SZER = 850
|
|
WYS = 1000
|
|
#Kolor okna
|
|
COL = (0,255,0)
|
|
|
|
#Nasze pole
|
|
POLE_SZER = 700
|
|
POLE_WYS = 700
|
|
POLE_COL = (128,128,0)
|
|
POLE_POZ = (75, 75)
|
|
TRAKTOR_POZ = [POLE_POZ[1], POLE_POZ[0]]
|
|
text_rect = [POLE_POZ[0], POLE_WYS + POLE_POZ[1] + 100]
|
|
|
|
#Nazwa okna
|
|
WINDOW_NAME = "SI Projekt"
|
|
POLE_STAN = numpy.random.randint(0,9,(10,10))
|
|
print("Reprezentacja pola jako macierz:")
|
|
print("###################")
|
|
for i in POLE_STAN:
|
|
for j in i:
|
|
print(j, end=" ")
|
|
print("")
|
|
print("###################")
|
|
images_names = ['gleba_pix.png','gleba_chwasty_pix.png','sadzonka_suchi_pix.png','sadzonka_chwasty_pix.png','gleba_mokra_pix.png','gleba_mokra_chwasty.png','sadzonka_mokra_pix.png','sadzonka_mokra_chwasty_pix.png','gotowy_burak_pix.png']
|
|
images = []
|
|
for i in images_names:
|
|
images.append(pygame.image.load('images/'+i))
|
|
|
|
|
|
def mat_val(traktor_poz,value):
|
|
POLE_STAN[traktor_poz[0],traktor_poz[1]]+=value
|
|
|
|
|
|
class img:
|
|
traktor = ["traktor_d.png","traktor_l.png","traktor_u.png","traktor_r.png"]
|
|
turn = 0
|
|
def traktor_get(self):
|
|
return self.traktor[self.turn]
|
|
|
|
def traktor_turn(self, turn):
|
|
self.turn = turn
|
|
|
|
traktor = img()
|
|
|
|
|
|
class activities:
|
|
modes = ["Nawadnianie", "Odchwaszczanie", "Sadzenie", "Zbiory"]
|
|
mode = 0
|
|
|
|
def activity_val(self,value):
|
|
self.mode = value
|
|
print(self.mode)
|
|
|
|
def activity_get_value(self):
|
|
return self.mode
|
|
|
|
activity = activities() |