-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpopstar.py
More file actions
38 lines (28 loc) · 807 Bytes
/
popstar.py
File metadata and controls
38 lines (28 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import sys
import pyxel
from mode import ClassicMode
from text import Text, draw_title
class App:
def __init__(self):
pyxel.init(160, 288, title="popstar")
pyxel.load("my_resource.pyxres")
if "pyodide" not in sys.modules:
pyxel.mouse(True)
self.mode = None
pyxel.run(self.update, self.draw)
def update(self):
if self.mode:
self.mode.update()
else:
if pyxel.btnp(pyxel.MOUSE_BUTTON_LEFT):
self.mode = ClassicMode()
def draw(self):
if self.mode:
self.mode.draw()
else:
pyxel.cls(0)
draw_title(
Text("POPSTAR", pyxel.COLOR_YELLOW),
Text("- PRESS START -", pyxel.COLOR_WHITE),
)
App()