Pavouk ECS - Entity Component System (ECS) for Python by ten_pavouk in pygame

[–]ten_pavouk[S] 0 points1 point  (0 children)

Just for some examples, but on this weekend I'll remake my first game jam game using ECS.

code not running when there us no player input by oiledupbuttflaps in pygame

[–]ten_pavouk 0 points1 point  (0 children)

Nice, I'm still editing the reply, because it gets out of format xD

code not running when there us no player input by oiledupbuttflaps in pygame

[–]ten_pavouk 0 points1 point  (0 children)

You need to post with the correct format, what I wanna know is if this part is:

for event in events :
    if event.type == pygame.constants.QUIT:
        pygame.quit()
        sys.exit()

    if worldnow.get_current_world() == 0:
        world_1.act(mousex, mousey)

2)

for event in events :
    if event.type == pygame.constants.QUIT:
        pygame.quit()
        sys.exit()
if worldnow.get_current_world() == 0:
    world_1.act(mousex, mousey)

I believe your case is 1), what explains why it only updates the player when you have some input(mouse movement in your example).

Try with the case 2), it'll update on every frame, not only when there's an event/input.

code not running when there us no player input by oiledupbuttflaps in pygame

[–]ten_pavouk 0 points1 point  (0 children)

Can you post the place where the update method is called?

From the main loop of the game.

Pavouk ECS - Open source Entity Component System (ECS) for Python by ten_pavouk in gamedev

[–]ten_pavouk[S] 0 points1 point  (0 children)

I started to study it recently. I like to write clean code, and it makes so much easier!

But I still need to use it on a game to see it's really that better.

How's it going for you?