mirror of
https://github.com/csd4ni3l/game-of-life.git
synced 2026-01-01 04:23:42 +01:00
Optimize game of life implementation to bitwise operations to achieve 450-500 fps for a glider gun, use int instead of math.ceil for positions and fix generation fps reset after file manager
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import arcade.gui, arcade
|
||||
from game.game_of_life import precompute_neighbor_masks
|
||||
|
||||
button_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button.png"))
|
||||
button_hovered_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture("assets/graphics/button_hovered.png"))
|
||||
@@ -6,3 +7,5 @@ button_hovered_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4,
|
||||
create_sound = arcade.Sound("assets/sound/create.mp3")
|
||||
destroy_sound = arcade.Sound("assets/sound/destroy.mp3")
|
||||
theme_sound = arcade.Sound("assets/sound/music.mp3")
|
||||
|
||||
NEIGHBOUR_MASKS = precompute_neighbor_masks()
|
||||
|
||||
Reference in New Issue
Block a user