Before periodic planet generation refactor
This commit is contained in:
1 parent
90e421909a
commit
fe9fc14849
4 files changed
+7
-9
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
from pyglet.shapes import Circle, Line
|
||||
from libs.ecs import World
|
||||
from libs.ecs.world import World
|
||||
from components import (
|
||||
Color,
|
||||
PlanetMarker,
|
||||
|
||||
+1
-1
Submodule libs/ecs updated: cf87f073e7...4769b8d707.
+1
-1
@@ -1,6 +1,6 @@
|
||||
from pyglet.shapes import Circle
|
||||
|
||||
from libs.ecs import World
|
||||
from libs.ecs.world import World
|
||||
from components import (
|
||||
PlanetMarker,
|
||||
Position,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from functools import partial
|
||||
from random import randint
|
||||
|
||||
import pyglet
|
||||
from pyglet.shapes import Circle, Line
|
||||
from components import PlanetMarker, SpaceShipMarker
|
||||
from helpers import generate_random_planet, generate_random_spaceship
|
||||
from libs.ecs import World
|
||||
from libs.ecs.world import World
|
||||
from libs.ecs.event import EventBus
|
||||
from systems import (
|
||||
PlanetRenderSyncSystem,
|
||||
SpaceShipKillSystem,
|
||||
@@ -24,6 +24,7 @@ world.systems.extend(
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
window = pyglet.window.Window(
|
||||
caption="SpaceTrader",
|
||||
width=SCREEN_WIDTH,
|
||||
@@ -34,9 +35,6 @@ window = pyglet.window.Window(
|
||||
for _ in range(12):
|
||||
generate_random_planet(world)
|
||||
|
||||
for i in range(10):
|
||||
generate_random_spaceship(world)
|
||||
|
||||
|
||||
@window.event
|
||||
def on_draw():
|
||||
@@ -56,7 +54,7 @@ def on_update(dt):
|
||||
|
||||
|
||||
def periodic_random_spaceship_generation(*args, **kwargs):
|
||||
for i in range(randint(1, 5)):
|
||||
for i in range(randint(0, 5)):
|
||||
generate_random_spaceship(world=world)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user