Dodanie gridElement
This commit is contained in:
parent
8844adaaa0
commit
a1ab3c9c4a
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -1,7 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="152ea650-8e02-4ed6-aa8c-04d44b275be4" name="Default Changelist" comment="" />
|
||||
<list default="true" id="152ea650-8e02-4ed6-aa8c-04d44b275be4" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/Images/order.py" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/gridElement.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/run.py" beforeDir="false" afterPath="$PROJECT_DIR$/run.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/table.py" beforeDir="false" afterPath="$PROJECT_DIR$/table.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/waiter.py" beforeDir="false" afterPath="$PROJECT_DIR$/waiter.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -13,8 +21,8 @@
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/table.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="289">
|
||||
<caret line="17" column="9" selection-start-line="17" selection-start-column="9" selection-end-line="17" selection-end-column="9" />
|
||||
<state relative-caret-position="306">
|
||||
<caret line="18" column="49" selection-start-line="18" selection-start-column="49" selection-end-line="18" selection-end-column="49" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@ -22,8 +30,8 @@
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/waiter.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="272">
|
||||
<caret line="16" column="19" lean-forward="true" selection-start-line="16" selection-start-column="19" selection-end-line="16" selection-end-column="19" />
|
||||
<state relative-caret-position="510">
|
||||
<caret line="30" column="61" selection-start-line="30" selection-start-column="61" selection-end-line="30" selection-end-column="61" />
|
||||
<folding>
|
||||
<element signature="e#0#13#0" expanded="true" />
|
||||
</folding>
|
||||
@ -31,11 +39,20 @@
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/gridElement.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="187">
|
||||
<caret line="11" column="58" selection-start-line="11" selection-start-column="58" selection-end-line="11" selection-end-column="58" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/run.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="510">
|
||||
<caret line="30" column="23" lean-forward="true" selection-start-line="30" selection-start-column="23" selection-end-line="30" selection-end-column="23" />
|
||||
<state relative-caret-position="204">
|
||||
<caret line="12" column="24" selection-start-line="12" selection-start-column="24" selection-end-line="12" selection-end-column="24" />
|
||||
<folding>
|
||||
<element signature="e#0#18#0" expanded="true" />
|
||||
</folding>
|
||||
@ -43,20 +60,29 @@
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/Images/order.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="85">
|
||||
<caret line="5" column="4" selection-start-line="5" selection-start-column="4" selection-end-line="5" selection-end-column="4" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$USER_HOME$/Desktop/pygame-elsa/elsa_gra.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="316">
|
||||
<state relative-caret-position="1020">
|
||||
<caret line="66" column="32" selection-start-line="66" selection-start-column="17" selection-end-line="66" selection-end-column="32" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$USER_HOME$/Desktop/pygame-elsa/sprites/elsa.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="238">
|
||||
<caret line="15" lean-forward="true" selection-start-line="15" selection-end-line="15" />
|
||||
<state relative-caret-position="357">
|
||||
<caret line="22" column="26" selection-start-line="22" selection-start-column="26" selection-end-line="22" selection-end-column="26" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@ -70,13 +96,18 @@
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/1" />
|
||||
<option value="$PROJECT_DIR$/run.py" />
|
||||
<option value="$PROJECT_DIR$/table.py" />
|
||||
<option value="$PROJECT_DIR$/waiter.py" />
|
||||
<option value="$PROJECT_DIR$/gridElement.py" />
|
||||
<option value="$PROJECT_DIR$/run.py" />
|
||||
<option value="$PROJECT_DIR$/Images/order.py" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
@ -86,28 +117,31 @@
|
||||
<option name="width" value="1400" />
|
||||
<option name="height" value="1000" />
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator proportions="" version="1">
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="Test" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="Test" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Sztuczna_Inteligencja" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="Sztuczna_Inteligencja" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="Test" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="Test" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Sztuczna_Inteligencja" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="Sztuczna_Inteligencja" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="Images" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
@ -190,7 +224,7 @@
|
||||
<window_info id="Favorites" order="2" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<window_info anchor="bottom" id="Find" order="1" />
|
||||
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.49947312" weight="0.32936078" />
|
||||
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.49947312" visible="true" weight="0.32936078" />
|
||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.3997833" />
|
||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||
@ -236,44 +270,61 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/table.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="289">
|
||||
<caret line="17" column="9" selection-start-line="17" selection-start-column="9" selection-end-line="17" selection-end-column="9" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$USER_HOME$/Desktop/pygame-elsa/elsa_gra.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="316">
|
||||
<state relative-caret-position="1020">
|
||||
<caret line="66" column="32" selection-start-line="66" selection-start-column="17" selection-end-line="66" selection-end-column="32" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/run.py">
|
||||
<entry file="file://$PROJECT_DIR$/Images/tlo.jpg">
|
||||
<provider selected="true" editor-type-id="images" />
|
||||
</entry>
|
||||
<entry file="file://$USER_HOME$/Desktop/pygame-elsa/sprites/elsa.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="510">
|
||||
<caret line="30" column="23" lean-forward="true" selection-start-line="30" selection-start-column="23" selection-end-line="30" selection-end-column="23" />
|
||||
<folding>
|
||||
<element signature="e#0#18#0" expanded="true" />
|
||||
</folding>
|
||||
<state relative-caret-position="357">
|
||||
<caret line="22" column="26" selection-start-line="22" selection-start-column="26" selection-end-line="22" selection-end-column="26" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/table.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="306">
|
||||
<caret line="18" column="49" selection-start-line="18" selection-start-column="49" selection-end-line="18" selection-end-column="49" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/gridElement.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="187">
|
||||
<caret line="11" column="58" selection-start-line="11" selection-start-column="58" selection-end-line="11" selection-end-column="58" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/waiter.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="272">
|
||||
<caret line="16" column="19" lean-forward="true" selection-start-line="16" selection-start-column="19" selection-end-line="16" selection-end-column="19" />
|
||||
<state relative-caret-position="510">
|
||||
<caret line="30" column="61" selection-start-line="30" selection-start-column="61" selection-end-line="30" selection-end-column="61" />
|
||||
<folding>
|
||||
<element signature="e#0#13#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$USER_HOME$/Desktop/pygame-elsa/sprites/elsa.py">
|
||||
<entry file="file://$PROJECT_DIR$/run.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="238">
|
||||
<caret line="15" lean-forward="true" selection-start-line="15" selection-end-line="15" />
|
||||
<state relative-caret-position="204">
|
||||
<caret line="12" column="24" selection-start-line="12" selection-start-column="24" selection-end-line="12" selection-end-column="24" />
|
||||
<folding>
|
||||
<element signature="e#0#18#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/Images/order.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="85">
|
||||
<caret line="5" column="4" selection-start-line="5" selection-start-column="4" selection-end-line="5" selection-end-column="4" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
|
12
gridElement.py
Normal file
12
gridElement.py
Normal file
@ -0,0 +1,12 @@
|
||||
import pygame
|
||||
|
||||
class GridEleemnt(object):
|
||||
def __init__(self,x,y,game):
|
||||
self.game = game
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.image = pygame.image.load("./Images/plytka.png")
|
||||
|
||||
def draw(self):
|
||||
self.rect = pygame.Rect(self.x, self.y, 50, 50)
|
||||
self.game.screen.blit(self.image, (self.x, self.y))
|
5
order.py
Normal file
5
order.py
Normal file
@ -0,0 +1,5 @@
|
||||
class Order(object):
|
||||
def __init__(self, game):
|
||||
self.game = game
|
||||
game.idOrder += 1
|
||||
self.id = game.idOrder
|
11
run.py
11
run.py
@ -1,6 +1,7 @@
|
||||
import pygame, sys
|
||||
from waiter import Waiter
|
||||
from table import Table
|
||||
from gridElement import GridEleemnt
|
||||
|
||||
class Game(object):
|
||||
def __init__(self):
|
||||
@ -9,12 +10,16 @@ class Game(object):
|
||||
self.screen = pygame.display.set_mode((1000, 900))
|
||||
self.fpsClock = pygame.time.Clock()
|
||||
self.idTable = 0
|
||||
self.idOrder = 0
|
||||
pygame.display.set_caption('Automatic Waiter')
|
||||
self.background = pygame.image.load("./Images/tlo.jpg")
|
||||
|
||||
self.waiter = Waiter(self)
|
||||
self.tables = [Table(50, 50, self), Table(400, 50, self), Table(750, 50, self), Table(50, 450, self), Table(400, 450, self), Table(750, 450, self)]
|
||||
|
||||
self.grid = []
|
||||
for i in range(20):
|
||||
for b in range(18):
|
||||
self.grid.append(GridEleemnt(i*50, b*50, self))
|
||||
|
||||
|
||||
for t in self.tables:
|
||||
@ -27,7 +32,7 @@ class Game(object):
|
||||
sys.exit(0)
|
||||
|
||||
#self.screen.fill((0, 0, 0))
|
||||
self.screen.blit(self.background, (0, 0))
|
||||
#self.screen.blit(self.background, (0, 0))
|
||||
self.draw()
|
||||
self.waiter.move()
|
||||
pygame.display.flip()
|
||||
@ -36,6 +41,8 @@ class Game(object):
|
||||
|
||||
|
||||
def draw(self):
|
||||
for gridElement in self.grid:
|
||||
gridElement.draw()
|
||||
self.waiter.draw()
|
||||
for table in self.tables:
|
||||
table.draw()
|
||||
|
4
table.py
4
table.py
@ -14,6 +14,6 @@ class Table(object):
|
||||
self.image = pygame.image.load("./Images/tableSmall.png")
|
||||
|
||||
def draw(self):
|
||||
table = pygame.Rect(self.x, self.y, 50 * self.width, 50 * self.height)
|
||||
#pygame.draw.rect(self.game.screen, (100, 0, 100,), table)
|
||||
self.table = pygame.Rect(self.x, self.y, 50, 50)
|
||||
pygame.draw.rect(self.game.screen, (100, 0, 100,), self.table)
|
||||
self.game.screen.blit(self.image, (self.x, self.y))
|
||||
|
@ -26,6 +26,6 @@ class Waiter(object):
|
||||
self.changePosition(Vector2(-50,0))
|
||||
|
||||
def draw(self):
|
||||
rect1 = pygame.Rect(self.position.x, self.position.y, 100, 200)
|
||||
#pygame.draw.rect(self.game.screen, (0, 150, 255), rect1)
|
||||
self.game.screen.blit(self.image, (self.position.x, self.position.y))
|
||||
self.rect1 = pygame.Rect(self.position.x, self.position.y, 50, 100)
|
||||
pygame.draw.rect(self.game.screen, (0, 150, 255), self.rect1)
|
||||
self.game.screen.blit(self.image, (self.position.x-50, self.position.y))
|
||||
|
Loading…
Reference in New Issue
Block a user