On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit) (+1)

I believe I have located what is causing the lag. The `Soldier` and `Shadow` classes are being instantiated inside of the `draw_window` function.

#  line 73 of main.py
def draw_window():
    for i in range(0, 31):
        window.blit(tile1, (tilepos[i]))
    sold1 = Soldier(0, Soldier_positions[0])

This is a large memory allocation to occur on every single frame, so ideally, it could be moved to where you are assigning the lists of positions `Soldier_positions` and `shadow_positions`. Then, the necessary code from those constructors could be moved into the `draw_window` function directly.

After making these changes locally, this is how the game runs on my machine:

Omg thank you I thought it was the collision detection, ya I’ll fix it up and I’ll decrease the speed. 

Uhh, after making those changes the keypresses somehow aren't working, so I still have some fixing up to do, ig

(1 edit)

The `play` property inside of the soldiers and shadows needs to be updated  to the global value every frame and the `playlevel()` method also needs to be called at the same time. If you are missing either of those things the input won't work.

got it, thx