17 lines
602 B
Python
17 lines
602 B
Python
import random
|
|
from Global_variables import Global_variables as G_var
|
|
from Package import Package
|
|
from Package_types import Package_types
|
|
|
|
|
|
class Packages_spawner:
|
|
def __init__(self, window,enviroment_2d):
|
|
self.window = window
|
|
self.enviroment_2d = enviroment_2d
|
|
|
|
def spawn_package(self):
|
|
package_x = random.randrange(22,26)
|
|
package_y = random.randrange(1,13)
|
|
package_type = random.choice(list(Package_types))
|
|
new_package = Package(self.window,package_x,package_y,package_type)
|
|
self.enviroment_2d[package_x][package_y] = new_package |