Skip to content

Commit

Permalink
init game
Browse files Browse the repository at this point in the history
  • Loading branch information
firemark committed May 3, 2023
1 parent f77d037 commit 6000aff
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# pyxel-prelection
# pyxel-prelection

Assets: https://guardian5.itch.io/blue-green-and-red-spacecraft-asset (Thx!!)
11 changes: 11 additions & 0 deletions src/game/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from .game import App


def main():
app = App()
app.setup()
app.run()


if __name__ == "__main__":
main()
Binary file added src/game/assets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/game/game.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python3
import pyxel


class App:

def run(self):
pyxel.run(self.update, self.draw)

def setup(self):
pyxel.init(160, 120, title="Hello Pyxel")
#pyxel.image(0).load(0, 0, "assets/pyxel_logo_38x16.png")

def update(self):
if pyxel.btnp(pyxel.KEY_Q):
pyxel.quit()

def draw(self):
pyxel.cls(0)
pyxel.text(55, 41, "Hello, Pyxel!", pyxel.frame_count % 16)
#pyxel.blt(61, 66, 0, 0, 0, 38, 16)

0 comments on commit 6000aff

Please sign in to comment.