Skip to content

Instantly share code, notes, and snippets.

@vestige
Last active October 23, 2022 08:10
Show Gist options
  • Save vestige/e9435e5442e919b2fc4540b3d24609ce to your computer and use it in GitHub Desktop.
Save vestige/e9435e5442e919b2fc4540b3d24609ce to your computer and use it in GitHub Desktop.
import pyxel
class App:
def __init__(self):
pyxel.init(160, 120, title="hello")
pyxel.run(self.update, self.draw)
def update(self):
pass
def draw(self):
pyxel.cls(0)
if __name__ == "__main__":
App()
@vestige
Copy link
Author

vestige commented Oct 23, 2022

import pyxel
      
def sound_set():
   pyxel.sound(0).set(
      "C2D2E2R",
      "t",
      "7",
      "n",
      60,
   )

class App:
   def __init__(self):
      pyxel.init(160, 120, title="music")

      sound_set()
      pyxel.play(0, 0)
      pyxel.run(self.update, self.draw)
   
   def update(self):
      if pyxel.play_pos(0) is None:
         pyxel.quit()

   def draw(self):
      pyxel.cls(0)

if __name__ == "__main__":
   App()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment