mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
fix double free bug, add logging, update to python 3.14
This commit is contained in:
@@ -1,38 +1,17 @@
|
||||
import pyray as ray
|
||||
|
||||
from libs.utils import get_current_ms
|
||||
from libs.texture import tex
|
||||
from scenes.game import JudgeCounter
|
||||
from libs.screen import Screen
|
||||
|
||||
|
||||
class DevScreen:
|
||||
def __init__(self):
|
||||
self.width = 1280
|
||||
self.height = 720
|
||||
self.screen_init = False
|
||||
self.length = 100
|
||||
|
||||
def on_screen_start(self):
|
||||
if not self.screen_init:
|
||||
self.screen_init = True
|
||||
tex.load_screen_textures('game')
|
||||
self.obj = JudgeCounter()
|
||||
class DevScreen(Screen):
|
||||
def on_screen_start(self, screen_name: str):
|
||||
super().on_screen_start(screen_name)
|
||||
|
||||
def on_screen_end(self, next_screen: str):
|
||||
self.screen_init = False
|
||||
return next_screen
|
||||
return super().on_screen_end(next_screen)
|
||||
|
||||
def update(self):
|
||||
self.on_screen_start()
|
||||
self.obj.update(0, 0, 0, 0)
|
||||
if ray.is_key_pressed(ray.KeyboardKey.KEY_ENTER):
|
||||
return self.on_screen_end('GAME')
|
||||
if ray.is_key_pressed(ray.KeyboardKey.KEY_SPACE):
|
||||
self.obj = JudgeCounter()
|
||||
super().update()
|
||||
|
||||
def draw(self):
|
||||
ray.draw_rectangle(0, 0, 1280, 720, ray.GREEN)
|
||||
self.obj.draw()
|
||||
|
||||
def draw_3d(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user