nowe grafiki

This commit is contained in:
Tomasz Adamczyk 2021-04-02 16:30:11 +02:00
parent bdcc794dc2
commit dc5a04a069
47 changed files with 129 additions and 96 deletions

View File

@ -5,10 +5,26 @@
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/definitions.py" beforeDir="false" afterPath="$PROJECT_DIR$/definitions.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/py.py" beforeDir="false" afterPath="$PROJECT_DIR$/py.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/potatoes_stage1.png" beforeDir="false" afterPath="$PROJECT_DIR$/resources/potatoes_stage1.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/potatoes_stage2.png" beforeDir="false" afterPath="$PROJECT_DIR$/resources/potatoes_stage2.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/potatoes_stage3.png" beforeDir="false" afterPath="$PROJECT_DIR$/resources/potatoes_stage3.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tractor.py" beforeDir="false" afterPath="$PROJECT_DIR$/tractor.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/beetroots_stage1.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/beetroots_stage2.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/beetroots_stage3.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/beetroots_stage4.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/carrots_stage1.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/carrots_stage2.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/carrots_stage3.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/carrots_stage4.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/farmland.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/farmland_moist.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/potatoes_stage1.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/potatoes_stage2.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/potatoes_stage3.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/potatoes_stage4.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/tractor.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/wheat_stage1.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/wheat_stage2.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/wheat_stage3.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/wheat_stage4.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/wheat_stage5.png" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -96,6 +112,9 @@
<workItem from="1617179845457" duration="82000" />
<workItem from="1617183365349" duration="4399000" />
<workItem from="1617188855897" duration="3185000" />
<workItem from="1617367883128" duration="2815000" />
<workItem from="1617370723478" duration="1838000" />
<workItem from="1617372800679" duration="949000" />
</task>
<servers />
</component>
@ -103,44 +122,44 @@
<option name="version" value="1" />
</component>
<component name="WindowStateProjectService">
<state width="1879" height="295" key="GridCell.Tab.0.bottom" timestamp="1617192068909">
<state width="1879" height="364" key="GridCell.Tab.0.bottom" timestamp="1617373756802">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state width="1879" height="295" key="GridCell.Tab.0.bottom/0.0.1920.1080@0.0.1920.1080" timestamp="1617192068909" />
<state width="1879" height="295" key="GridCell.Tab.0.center" timestamp="1617192068909">
<state width="1879" height="364" key="GridCell.Tab.0.bottom/0.0.1920.1080@0.0.1920.1080" timestamp="1617373756802" />
<state width="1879" height="364" key="GridCell.Tab.0.center" timestamp="1617373756802">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state width="1879" height="295" key="GridCell.Tab.0.center/0.0.1920.1080@0.0.1920.1080" timestamp="1617192068909" />
<state width="1879" height="295" key="GridCell.Tab.0.left" timestamp="1617192068909">
<state width="1879" height="364" key="GridCell.Tab.0.center/0.0.1920.1080@0.0.1920.1080" timestamp="1617373756802" />
<state width="1879" height="364" key="GridCell.Tab.0.left" timestamp="1617373756802">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state width="1879" height="295" key="GridCell.Tab.0.left/0.0.1920.1080@0.0.1920.1080" timestamp="1617192068909" />
<state width="1879" height="295" key="GridCell.Tab.0.right" timestamp="1617192068909">
<state width="1879" height="364" key="GridCell.Tab.0.left/0.0.1920.1080@0.0.1920.1080" timestamp="1617373756802" />
<state width="1879" height="364" key="GridCell.Tab.0.right" timestamp="1617373756802">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state width="1879" height="295" key="GridCell.Tab.0.right/0.0.1920.1080@0.0.1920.1080" timestamp="1617192068909" />
<state width="1879" height="364" key="GridCell.Tab.1.bottom" timestamp="1616326478876">
<state width="1879" height="364" key="GridCell.Tab.0.right/0.0.1920.1080@0.0.1920.1080" timestamp="1617373756802" />
<state width="1879" height="364" key="GridCell.Tab.1.bottom" timestamp="1617373756803">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state width="1879" height="364" key="GridCell.Tab.1.bottom/0.0.1920.1080@0.0.1920.1080" timestamp="1616326478876" />
<state width="1879" height="364" key="GridCell.Tab.1.center" timestamp="1616326478875">
<state width="1879" height="364" key="GridCell.Tab.1.bottom/0.0.1920.1080@0.0.1920.1080" timestamp="1617373756803" />
<state width="1879" height="364" key="GridCell.Tab.1.center" timestamp="1617373756802">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state width="1879" height="364" key="GridCell.Tab.1.center/0.0.1920.1080@0.0.1920.1080" timestamp="1616326478875" />
<state width="1879" height="364" key="GridCell.Tab.1.left" timestamp="1616326478875">
<state width="1879" height="364" key="GridCell.Tab.1.center/0.0.1920.1080@0.0.1920.1080" timestamp="1617373756802" />
<state width="1879" height="364" key="GridCell.Tab.1.left" timestamp="1617373756802">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state width="1879" height="364" key="GridCell.Tab.1.left/0.0.1920.1080@0.0.1920.1080" timestamp="1616326478875" />
<state width="1879" height="364" key="GridCell.Tab.1.right" timestamp="1616326478875">
<state width="1879" height="364" key="GridCell.Tab.1.left/0.0.1920.1080@0.0.1920.1080" timestamp="1617373756802" />
<state width="1879" height="364" key="GridCell.Tab.1.right" timestamp="1617373756802">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state width="1879" height="364" key="GridCell.Tab.1.right/0.0.1920.1080@0.0.1920.1080" timestamp="1616326478875" />
<state x="0" y="0" key="com.intellij.ide.util.TipDialog" timestamp="1617188855826">
<state width="1879" height="364" key="GridCell.Tab.1.right/0.0.1920.1080@0.0.1920.1080" timestamp="1617373756802" />
<state x="0" y="0" key="com.intellij.ide.util.TipDialog" timestamp="1617372800402">
<screen x="0" y="0" width="1920" height="1080" />
</state>
<state x="0" y="0" key="com.intellij.ide.util.TipDialog/0.0.1920.1080@0.0.1920.1080" timestamp="1617188855826" />
<state x="0" y="0" key="com.intellij.ide.util.TipDialog/0.0.1920.1080@0.0.1920.1080" timestamp="1617372800402" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/SmartTractor$py.coverage" NAME="py Coverage Results" MODIFIED="1617191945730" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/SmartTractor$py.coverage" NAME="py Coverage Results" MODIFIED="1617373729734" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
</component>
</project>

View File

@ -2,45 +2,45 @@ import os
import pygame
BLOCK_SIZE = 100
BEETROOTS_GROW_TIME = 5
BEETROOTS_MAXIMUM_STATE = 16
BEETROOTSTAGE1 = pygame.image.load(os.path.join('resources', 'beetroots_stage1.png'))
BEETROOTSTAGE1 = pygame.transform.scale(BEETROOTSTAGE1, (BLOCK_SIZE, BLOCK_SIZE))
BEETROOTSTAGE2 = pygame.image.load(os.path.join('resources', 'beetroots_stage2.png'))
BEETROOTSTAGE2 = pygame.transform.scale(BEETROOTSTAGE2, (BLOCK_SIZE, BLOCK_SIZE))
BEETROOTSTAGE3 = pygame.image.load(os.path.join('resources', 'beetroots_stage3.png'))
BEETROOTSTAGE3 = pygame.transform.scale(BEETROOTSTAGE3, (BLOCK_SIZE, BLOCK_SIZE))
BEETROOTSTAGE4 = pygame.image.load(os.path.join('resources', 'beetroots_stage4.png'))
BEETROOTSTAGE4 = pygame.transform.scale(BEETROOTSTAGE4, (BLOCK_SIZE, BLOCK_SIZE))
BEETROOTS_MAXIMUM_STATE = BEETROOTS_GROW_TIME * 3 + 1
BEETROOTS_STAGE_0 = pygame.image.load(os.path.join('resources', 'beetroots_stage_0.png'))
BEETROOTS_STAGE_0 = pygame.transform.scale(BEETROOTS_STAGE_0, (BLOCK_SIZE, BLOCK_SIZE))
BEETROOTS_STAGE_1 = pygame.image.load(os.path.join('resources', 'beetroots_stage_1.png'))
BEETROOTS_STAGE_1 = pygame.transform.scale(BEETROOTS_STAGE_1, (BLOCK_SIZE, BLOCK_SIZE))
BEETROOTS_STAGE_2 = pygame.image.load(os.path.join('resources', 'beetroots_stage_2.png'))
BEETROOTS_STAGE_2 = pygame.transform.scale(BEETROOTS_STAGE_2, (BLOCK_SIZE, BLOCK_SIZE))
BEETROOTS_STAGE_3 = pygame.image.load(os.path.join('resources', 'beetroots_stage_3.png'))
BEETROOTS_STAGE_3 = pygame.transform.scale(BEETROOTS_STAGE_3, (BLOCK_SIZE, BLOCK_SIZE))
CARROTS_GROW_TIME = 5
CARROTS_MAXIMUM_STATE = 16
CARROTSTAGE1 = pygame.image.load(os.path.join('resources', 'carrots_stage1.png'))
CARROTSTAGE1 = pygame.transform.scale(CARROTSTAGE1, (BLOCK_SIZE, BLOCK_SIZE))
CARROTSTAGE2 = pygame.image.load(os.path.join('resources', 'carrots_stage2.png'))
CARROTSTAGE2 = pygame.transform.scale(CARROTSTAGE2, (BLOCK_SIZE, BLOCK_SIZE))
CARROTSTAGE3 = pygame.image.load(os.path.join('resources', 'carrots_stage3.png'))
CARROTSTAGE3 = pygame.transform.scale(CARROTSTAGE3, (BLOCK_SIZE, BLOCK_SIZE))
CARROTSTAGE4 = pygame.image.load(os.path.join('resources', 'carrots_stage4.png'))
CARROTSTAGE4 = pygame.transform.scale(CARROTSTAGE4, (BLOCK_SIZE, BLOCK_SIZE))
CARROTS_MAXIMUM_STATE = CARROTS_GROW_TIME * 3 + 1
CARROTS_STAGE_0 = pygame.image.load(os.path.join('resources', 'carrots_stage_0.png'))
CARROTS_STAGE_0 = pygame.transform.scale(CARROTS_STAGE_0, (BLOCK_SIZE, BLOCK_SIZE))
CARROTS_STAGE_1 = pygame.image.load(os.path.join('resources', 'carrots_stage_1.png'))
CARROTS_STAGE_1 = pygame.transform.scale(CARROTS_STAGE_1, (BLOCK_SIZE, BLOCK_SIZE))
CARROTS_STAGE_2 = pygame.image.load(os.path.join('resources', 'carrots_stage_2.png'))
CARROTS_STAGE_2 = pygame.transform.scale(CARROTS_STAGE_2, (BLOCK_SIZE, BLOCK_SIZE))
CARROTS_STAGE_3 = pygame.image.load(os.path.join('resources', 'carrots_stage_3.png'))
CARROTS_STAGE_3 = pygame.transform.scale(CARROTS_STAGE_3, (BLOCK_SIZE, BLOCK_SIZE))
DIRT = pygame.image.load(os.path.join('resources', 'dirt.png'))
DIRT = pygame.transform.scale(DIRT, (BLOCK_SIZE, BLOCK_SIZE))
FARMLAND = pygame.image.load(os.path.join('resources', 'farmland.png'))
FARMLAND = pygame.transform.scale(FARMLAND, (BLOCK_SIZE, BLOCK_SIZE))
FARMLANDMOIST = pygame.image.load(os.path.join('resources', 'farmland_moist.png'))
FARMLANDMOIST = pygame.transform.scale(FARMLANDMOIST, (BLOCK_SIZE, BLOCK_SIZE))
FARMLAND_DRY = pygame.image.load(os.path.join('resources', 'farmland_dry.png'))
FARMLAND_DRY = pygame.transform.scale(FARMLAND_DRY, (BLOCK_SIZE, BLOCK_SIZE))
FARMLAND_WET = pygame.image.load(os.path.join('resources', 'farmland_wet.png'))
FARMLAND_WET = pygame.transform.scale(FARMLAND_WET, (BLOCK_SIZE, BLOCK_SIZE))
FPS = 1
POTATOES_GROW_TIME = 5
POTATOES_MAXIMUM_STATE = 16
POTATOSTAGE1 = pygame.image.load(os.path.join('resources', 'potatoes_stage1.png'))
POTATOSTAGE1 = pygame.transform.scale(POTATOSTAGE1, (BLOCK_SIZE, BLOCK_SIZE))
POTATOSTAGE2 = pygame.image.load(os.path.join('resources', 'potatoes_stage2.png'))
POTATOSTAGE2 = pygame.transform.scale(POTATOSTAGE2, (BLOCK_SIZE, BLOCK_SIZE))
POTATOSTAGE3 = pygame.image.load(os.path.join('resources', 'potatoes_stage3.png'))
POTATOSTAGE3 = pygame.transform.scale(POTATOSTAGE3, (BLOCK_SIZE, BLOCK_SIZE))
POTATOSTAGE4 = pygame.image.load(os.path.join('resources', 'potatoes_stage4.png'))
POTATOSTAGE4 = pygame.transform.scale(POTATOSTAGE4, (BLOCK_SIZE, BLOCK_SIZE))
POTATOES_MAXIMUM_STATE = POTATOES_GROW_TIME * 3 + 1
POTATOES_STAGE_0 = pygame.image.load(os.path.join('resources', 'potatoes_stage_0.png'))
POTATOES_STAGE_0 = pygame.transform.scale(POTATOES_STAGE_0, (BLOCK_SIZE, BLOCK_SIZE))
POTATOES_STAGE_1 = pygame.image.load(os.path.join('resources', 'potatoes_stage_1.png'))
POTATOES_STAGE_1 = pygame.transform.scale(POTATOES_STAGE_1, (BLOCK_SIZE, BLOCK_SIZE))
POTATOES_STAGE_2 = pygame.image.load(os.path.join('resources', 'potatoes_stage_2.png'))
POTATOES_STAGE_2 = pygame.transform.scale(POTATOES_STAGE_2, (BLOCK_SIZE, BLOCK_SIZE))
POTATOES_STAGE_3 = pygame.image.load(os.path.join('resources', 'potatoes_stage_3.png'))
POTATOES_STAGE_3 = pygame.transform.scale(POTATOES_STAGE_3, (BLOCK_SIZE, BLOCK_SIZE))
WIDTH, HEIGHT = 1000, 1000
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
TRACTOR = pygame.image.load(os.path.join('resources', 'tractor.png'))
WINDOW = pygame.display.set_mode((WIDTH, HEIGHT))
TRACTOR = pygame.image.load(os.path.join('resources', 'minecart_command_block.png'))
TRACTOR = pygame.transform.scale(TRACTOR, (BLOCK_SIZE, BLOCK_SIZE))
TRACTOR_FERTILIZER = 2
TRACTOR_FUEL = 200
@ -48,14 +48,20 @@ TRACTOR_AMOUNT_OF_SEEDS_EACH_TYPE = 20
TRACTOR_MAXIMUM_COLLECTED_PLANTS = 80
TRACTOR_WATER_LEVEL = 40
WHEAT_GROW_TIME = 5
WHEAT_MAXIMUM_STATE = 21
WHEATSTAGE1 = pygame.image.load(os.path.join('resources', 'wheat_stage1.png'))
WHEATSTAGE1 = pygame.transform.scale(WHEATSTAGE1, (BLOCK_SIZE, BLOCK_SIZE))
WHEATSTAGE2 = pygame.image.load(os.path.join('resources', 'wheat_stage2.png'))
WHEATSTAGE2 = pygame.transform.scale(WHEATSTAGE2, (BLOCK_SIZE, BLOCK_SIZE))
WHEATSTAGE3 = pygame.image.load(os.path.join('resources', 'wheat_stage3.png'))
WHEATSTAGE3 = pygame.transform.scale(WHEATSTAGE3, (BLOCK_SIZE, BLOCK_SIZE))
WHEATSTAGE4 = pygame.image.load(os.path.join('resources', 'wheat_stage4.png'))
WHEATSTAGE4 = pygame.transform.scale(WHEATSTAGE4, (BLOCK_SIZE, BLOCK_SIZE))
WHEATSTAGE5 = pygame.image.load(os.path.join('resources', 'wheat_stage5.png'))
WHEATSTAGE5 = pygame.transform.scale(WHEATSTAGE5, (BLOCK_SIZE, BLOCK_SIZE))
WHEAT_MAXIMUM_STATE = WHEAT_GROW_TIME * 7 + 1
WHEAT_STAGE_0 = pygame.image.load(os.path.join('resources', 'wheat_stage_0.png'))
WHEAT_STAGE_0 = pygame.transform.scale(WHEAT_STAGE_0, (BLOCK_SIZE, BLOCK_SIZE))
WHEAT_STAGE_1 = pygame.image.load(os.path.join('resources', 'wheat_stage_1.png'))
WHEAT_STAGE_1 = pygame.transform.scale(WHEAT_STAGE_1, (BLOCK_SIZE, BLOCK_SIZE))
WHEAT_STAGE_2 = pygame.image.load(os.path.join('resources', 'wheat_stage_2.png'))
WHEAT_STAGE_2 = pygame.transform.scale(WHEAT_STAGE_2, (BLOCK_SIZE, BLOCK_SIZE))
WHEAT_STAGE_3 = pygame.image.load(os.path.join('resources', 'wheat_stage_3.png'))
WHEAT_STAGE_3 = pygame.transform.scale(WHEAT_STAGE_3, (BLOCK_SIZE, BLOCK_SIZE))
WHEAT_STAGE_4 = pygame.image.load(os.path.join('resources', 'wheat_stage_4.png'))
WHEAT_STAGE_4 = pygame.transform.scale(WHEAT_STAGE_4, (BLOCK_SIZE, BLOCK_SIZE))
WHEAT_STAGE_5 = pygame.image.load(os.path.join('resources', 'wheat_stage_5.png'))
WHEAT_STAGE_5 = pygame.transform.scale(WHEAT_STAGE_5, (BLOCK_SIZE, BLOCK_SIZE))
WHEAT_STAGE_6 = pygame.image.load(os.path.join('resources', 'wheat_stage_6.png'))
WHEAT_STAGE_6 = pygame.transform.scale(WHEAT_STAGE_6, (BLOCK_SIZE, BLOCK_SIZE))
WHEAT_STAGE_7 = pygame.image.load(os.path.join('resources', 'wheat_stage_7.png'))
WHEAT_STAGE_7 = pygame.transform.scale(WHEAT_STAGE_7, (BLOCK_SIZE, BLOCK_SIZE))

66
py.py
View File

@ -23,52 +23,60 @@ def fill_map():
field = fields[i][j]
rect = field.get_rect()
if field.get_plant().get_name() == "beetroot" and field.get_plant().get_state() > 0 and field.get_plant().get_state() <= 1 * definitions.BEETROOTS_GROW_TIME:
block = definitions.BEETROOTSTAGE1
block = definitions.BEETROOTS_STAGE_0
elif field.get_plant().get_name() == "beetroot" and field.get_plant().get_state() > 1 * definitions.BEETROOTS_GROW_TIME and field.get_plant().get_state() <= 2 * definitions.BEETROOTS_GROW_TIME:
block = definitions.BEETROOTSTAGE2
block = definitions.BEETROOTS_STAGE_1
elif field.get_plant().get_name() == "beetroot" and field.get_plant().get_state() > 2 * definitions.BEETROOTS_GROW_TIME and field.get_plant().get_state() <= 3 * definitions.BEETROOTS_GROW_TIME:
block = definitions.BEETROOTSTAGE3
elif field.get_plant().get_name() == "beetroot" and field.get_plant().get_state() == 3 *definitions.BEETROOTS_GROW_TIME + 1:
block = definitions.BEETROOTSTAGE4
block = definitions.BEETROOTS_STAGE_2
elif field.get_plant().get_name() == "beetroot" and field.get_plant().get_state() == definitions.BEETROOTS_MAXIMUM_STATE:
block = definitions.BEETROOTS_STAGE_3
elif field.get_plant().get_name() == "carrot" and field.get_plant().get_state() > 0 and field.get_plant().get_state() <= 1 * definitions.CARROTS_GROW_TIME:
block = definitions.CARROTSTAGE1
block = definitions.CARROTS_STAGE_0
elif field.get_plant().get_name() == "carrot" and field.get_plant().get_state() > 1 * definitions.CARROTS_GROW_TIME and field.get_plant().get_state() <= 2 * definitions.CARROTS_GROW_TIME:
block = definitions.CARROTSTAGE2
block = definitions.CARROTS_STAGE_1
elif field.get_plant().get_name() == "carrot" and field.get_plant().get_state() > 2 * definitions.CARROTS_GROW_TIME and field.get_plant().get_state() <= 3 * definitions.CARROTS_GROW_TIME:
block = definitions.CARROTSTAGE3
elif field.get_plant().get_name() == "carrot" and field.get_plant().get_state() == 3 *definitions.CARROTS_GROW_TIME + 1:
block = definitions.CARROTSTAGE4
block = definitions.CARROTS_STAGE_2
elif field.get_plant().get_name() == "carrot" and field.get_plant().get_state() == definitions.CARROTS_MAXIMUM_STATE:
block = definitions.CARROTS_STAGE_3
elif field.get_plant().get_name() == "potato" and field.get_plant().get_state() > 0 and field.get_plant().get_state() <= 1 * definitions.POTATOES_GROW_TIME:
block = definitions.POTATOSTAGE1
block = definitions.POTATOES_STAGE_0
elif field.get_plant().get_name() == "potato" and field.get_plant().get_state() > 1 * definitions.POTATOES_GROW_TIME and field.get_plant().get_state() <= 2 * definitions.POTATOES_GROW_TIME:
block = definitions.POTATOSTAGE2
block = definitions.POTATOES_STAGE_1
elif field.get_plant().get_name() == "potato" and field.get_plant().get_state() > 2 * definitions.POTATOES_GROW_TIME and field.get_plant().get_state() <= 3 * definitions.POTATOES_GROW_TIME:
block = definitions.POTATOSTAGE3
elif field.get_plant().get_name() == "potato" and field.get_plant().get_state() == 3 *definitions.POTATOES_GROW_TIME + 1:
block = definitions.POTATOSTAGE4
block = definitions.POTATOES_STAGE_2
elif field.get_plant().get_name() == "potato" and field.get_plant().get_state() == definitions.POTATOES_MAXIMUM_STATE:
block = definitions.POTATOES_STAGE_3
elif field.get_plant().get_name() == "wheat" and field.get_plant().get_state() > 0 and field.get_plant().get_state() <= 1 * definitions.WHEAT_GROW_TIME:
block = definitions.WHEATSTAGE1
block = definitions.WHEAT_STAGE_0
elif field.get_plant().get_name() == "wheat" and field.get_plant().get_state() > 1 * definitions.WHEAT_GROW_TIME and field.get_plant().get_state() <= 2 * definitions.WHEAT_GROW_TIME:
block = definitions.WHEATSTAGE2
block = definitions.WHEAT_STAGE_1
elif field.get_plant().get_name() == "wheat" and field.get_plant().get_state() > 2 * definitions.WHEAT_GROW_TIME and field.get_plant().get_state() <= 3 * definitions.WHEAT_GROW_TIME:
block = definitions.WHEATSTAGE3
block = definitions.WHEAT_STAGE_2
elif field.get_plant().get_name() == "wheat" and field.get_plant().get_state() > 3 * definitions.WHEAT_GROW_TIME and field.get_plant().get_state() <= 4 * definitions.WHEAT_GROW_TIME:
block = definitions.WHEATSTAGE4
elif field.get_plant().get_name() == "wheat" and field.get_plant().get_state() == 4 *definitions.WHEAT_GROW_TIME + 1:
block = definitions.WHEATSTAGE5
block = definitions.WHEAT_STAGE_3
elif field.get_plant().get_name() == "wheat" and field.get_plant().get_state() > 4 * definitions.WHEAT_GROW_TIME and field.get_plant().get_state() <= 5 * definitions.WHEAT_GROW_TIME:
block = definitions.WHEAT_STAGE_4
elif field.get_plant().get_name() == "wheat" and field.get_plant().get_state() > 5 * definitions.WHEAT_GROW_TIME and field.get_plant().get_state() <= 6 * definitions.WHEAT_GROW_TIME:
block = definitions.WHEAT_STAGE_5
elif field.get_plant().get_name() == "wheat" and field.get_plant().get_state() > 6 * definitions.WHEAT_GROW_TIME and field.get_plant().get_state() <= 7 * definitions.WHEAT_GROW_TIME:
block = definitions.WHEAT_STAGE_6
elif field.get_plant().get_name() == "wheat" and field.get_plant().get_state() == definitions.WHEAT_MAXIMUM_STATE:
block = definitions.WHEAT_STAGE_7
elif field.get_soil().get_state() is False:
block = definitions.DIRT
elif field.get_soil().get_state() is True and field.get_soil().get_water_level() is False:
block = definitions.FARMLAND
block = definitions.FARMLAND_DRY
elif field.get_soil().get_state() is True and field.get_soil().get_water_level() is True:
block = definitions.FARMLANDMOIST
definitions.WIN.blit(block, (rect.x, rect.y))
block = definitions.FARMLAND_WET
if (block != definitions.DIRT or block != definitions.FARMLAND_DRY or block != definitions.FARMLAND_WET):
definitions.WINDOW.blit(definitions.FARMLAND_WET, (rect.x, rect.y))
definitions.WINDOW.blit(block, (rect.x, rect.y))
def do_work(tractor1, tractor1_rect):
loop = True
if tractor1.get_all_amount_of_seeds() == 0:
loop = False
x = int(tractor1_rect.x/100)
y = int(tractor1_rect.y/100)
x = int(tractor1_rect.x / 100)
y = int(tractor1_rect.y / 100)
field = fields[x][y]
if field.get_soil().get_state() is False:
field.get_soil().set_state(True)
@ -140,7 +148,7 @@ def do_work(tractor1, tractor1_rect):
tractor1.set_collected_plants("wheat", tractor1.get_collected_plants("wheat") + 1)
def draw_window(tractor1_rect):
fill_map()
definitions.WIN.blit(definitions.TRACTOR, (tractor1_rect.x, tractor1_rect.y))
definitions.WINDOW.blit(definitions.TRACTOR, (tractor1_rect.x, tractor1_rect.y))
pygame.display.update()
def grow_plants():
for i in range(10):
@ -198,7 +206,7 @@ def main():
amount_of_seeds_dict = {"beetroot": definitions.TRACTOR_AMOUNT_OF_SEEDS_EACH_TYPE, "carrot": definitions.TRACTOR_AMOUNT_OF_SEEDS_EACH_TYPE, "potato": definitions.TRACTOR_AMOUNT_OF_SEEDS_EACH_TYPE, "wheat": definitions.TRACTOR_AMOUNT_OF_SEEDS_EACH_TYPE}
collected_plants_dict = {"beetroot": 0, "carrot": 0, "potato": 0, "wheat": 0}
fertilizer_dict = {"beetroot": definitions.TRACTOR_FERTILIZER, "carrot": definitions.TRACTOR_FERTILIZER, "potato": definitions.TRACTOR_FERTILIZER, "wheat": definitions.TRACTOR_FERTILIZER}
tractor1 = tractor.Tractor(amount_of_seeds_dict, collected_plants_dict, fertilizer_dict, definitions.TRACTOR_FUEL, definitions.TRACTOR_WATER_LEVEL ,0, 0)
tractor1 = tractor.Tractor(amount_of_seeds_dict, collected_plants_dict, fertilizer_dict, definitions.TRACTOR_FUEL, definitions.TRACTOR_WATER_LEVEL, 0, 0)
tractor1_rect = pygame.Rect(tractor1.get_x(), tractor1.get_y(), definitions.BLOCK_SIZE, definitions.BLOCK_SIZE)
clock = pygame.time.Clock()
run = True
@ -208,9 +216,9 @@ def main():
if event.type == pygame.QUIT:
run = False
draw_window(tractor1_rect)
grow_plants()
tractor1_handle_movement(tractor1, tractor1_rect)
do_work(tractor1, tractor1_rect)
grow_plants()
pygame.quit()
if __name__ == "__main__":
main()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

View File

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 258 B

View File

Before

Width:  |  Height:  |  Size: 610 B

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 879 B

BIN
resources/wheat_stage_0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

BIN
resources/wheat_stage_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

BIN
resources/wheat_stage_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

BIN
resources/wheat_stage_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

BIN
resources/wheat_stage_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

BIN
resources/wheat_stage_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

BIN
resources/wheat_stage_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

BIN
resources/wheat_stage_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B