Skip to content
Snippets Groups Projects
Commit 18d4e8da authored by pippin's avatar pippin
Browse files

clouds: make runnable with mpremote

parent bf2b6756
No related branches found
No related tags found
No related merge requests found
import st3m.run, random
from st3m.application import Application, ApplicationContext from st3m.application import Application, ApplicationContext
from st3m.input import InputState from st3m.input import InputState
from ctx import Context from ctx import Context
import random
class Cloud: class Cloud:
def __init__(self, x: float, y: float, z: float) -> None: def __init__(self, x: float, y: float, z: float) -> None:
...@@ -26,7 +25,7 @@ class Cloud: ...@@ -26,7 +25,7 @@ class Cloud:
) )
class CloudsApp(Application): class Clouds(Application):
def __init__(self, app_ctx: ApplicationContext) -> None: def __init__(self, app_ctx: ApplicationContext) -> None:
super().__init__(app_ctx) super().__init__(app_ctx)
self.clouds = [] self.clouds = []
...@@ -58,3 +57,8 @@ class CloudsApp(Application): ...@@ -58,3 +57,8 @@ class CloudsApp(Application):
for c in self.clouds: for c in self.clouds:
c.draw(ctx) c.draw(ctx)
if __name__ == "__main__":
# Continue to make runnable via mpremote run.
st3m.run.run_view(Clouds(ApplicationContext()))
...@@ -3,7 +3,7 @@ name = "Clouds" ...@@ -3,7 +3,7 @@ name = "Clouds"
menu = "Apps" menu = "Apps"
[entry] [entry]
class = "CloudsApp" class = "Clouds"
[metadata] [metadata]
author = "Flow3r Badge Authors" author = "Flow3r Badge Authors"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment