Intelligent_Tractor/config.py

59 lines
1.8 KiB
Python
Raw Normal View History

2020-06-17 21:38:13 +02:00
import pygame as pg
import numpy as np
2020-06-29 10:59:56 +02:00
screen_height = 890
screen_width = 720
2020-06-17 21:38:13 +02:00
tile_size = 80
screen = pg.display.set_mode([screen_width, screen_height])
2020-06-29 10:59:56 +02:00
black_surface = pg.Surface((720, 170))
black_surface.fill((0, 0, 0))
2020-06-17 21:38:13 +02:00
2020-06-29 10:59:56 +02:00
# # agent
# agent_img = pg.image.load('tractor.png').convert_alpha()
2020-06-17 21:38:13 +02:00
# background
road = 0
ground = 1
2020-06-29 10:59:56 +02:00
wall = 2
2020-06-17 21:38:13 +02:00
bg_textures = {
road: pg.image.load('road.png').convert(),
2020-06-29 10:59:56 +02:00
ground: pg.image.load('ground.png').convert(),
wall: pg.image.load('wall.png').convert()}
background = np.array([[1, 1, 1, 0, 0, 0, 1, 1, 1],
[1, 1, 1, 2, 0, 2, 1, 1, 1],
[1, 1, 1, 2, 0, 2, 1, 1, 1],
[0, 2, 2, 2, 0, 2, 2, 2, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 2, 2, 2, 0, 2, 2, 2, 0],
[1, 1, 1, 2, 0, 2, 1, 1, 1],
[1, 1, 1, 2, 0, 2, 1, 1, 1],
[1, 1, 1, 0, 0, 0, 1, 1, 1]])
2020-06-17 21:38:13 +02:00
# objects
2020-06-29 10:59:56 +02:00
rose = 3
tulip = 4
orchid = 5
sunflower = 6
barn = 7
2020-06-17 21:38:13 +02:00
ob_textures = {
0: pg.image.load('none.png').convert_alpha(),
rose: pg.image.load('rose.png').convert_alpha(),
tulip: pg.image.load('tulip.png').convert_alpha(),
orchid: pg.image.load('orchid.png').convert_alpha(),
sunflower: pg.image.load('sunflower.png').convert_alpha(),
2020-06-29 10:59:56 +02:00
barn: pg.image.load('barn.png').convert()}
objects = np.array([[3, 3, 3, 0, 0, 0, 4, 4, 4],
[3, 3, 3, 0, 0, 0, 4, 4, 4],
[3, 3, 3, 0, 0, 0, 4, 4, 4],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 7, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[5, 5, 5, 0, 0, 0, 6, 6, 6],
[5, 5, 5, 0, 0, 0, 6, 6, 6],
[5, 5, 5, 0, 0, 0, 6, 6, 6]])