Skip to content

Commit 53b6e0d

Browse files
authored
Merge pull request #1609 from lesamouraipourpre/cp-sailer-moon
Circuit_Playground_Sailor_Moon_Star_Locket: Update for CP7
2 parents 2562c2c + 196de29 commit 53b6e0d

File tree

1 file changed

+20
-14
lines changed
  • Circuit_Playground_Sailor_Moon_Star_Locket

1 file changed

+20
-14
lines changed

Circuit_Playground_Sailor_Moon_Star_Locket/code.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,40 @@
99
display = tft_gizmo.TFT_Gizmo()
1010

1111
# loading the background image
12-
bg_bitmap, bg_palette = adafruit_imageload.load("/clouds_bg.bmp",
13-
bitmap=displayio.Bitmap,
14-
palette=displayio.Palette)
12+
bg_bitmap, bg_palette = adafruit_imageload.load(
13+
"/clouds_bg.bmp", bitmap=displayio.Bitmap, palette=displayio.Palette
14+
)
1515
bg_grid = displayio.TileGrid(bg_bitmap, pixel_shader=bg_palette)
1616

1717
# loading the crescent moon bitmap sequence
18-
bitmap, palette = adafruit_imageload.load("/moon_anime.bmp",
19-
bitmap=displayio.Bitmap,
20-
palette=displayio.Palette)
18+
bitmap, palette = adafruit_imageload.load(
19+
"/moon_anime.bmp", bitmap=displayio.Bitmap, palette=displayio.Palette
20+
)
2121
# makes the black background transparent so we only see the cresent moon
2222
palette.make_transparent(0)
2323

24-
tile_grid = displayio.TileGrid(bitmap, pixel_shader=palette, width = 1, height = 1,
25-
tile_height = 120, tile_width = 120,
26-
default_tile = 0)
24+
tile_grid = displayio.TileGrid(
25+
bitmap,
26+
pixel_shader=palette,
27+
width=1,
28+
height=1,
29+
tile_height=120,
30+
tile_width=120,
31+
default_tile=0,
32+
)
2733

2834
# two circles for the center "jewel"
29-
jewel_outline = Circle(x0=120, y0=120, r=40, fill=0xfbf236)
30-
jewel = Circle(x0=120, y0=120, r=35, fill=0xf70570)
35+
jewel_outline = Circle(x0=120, y0=120, r=40, fill=0xFBF236)
36+
jewel = Circle(x0=120, y0=120, r=35, fill=0xF70570)
3137

3238
# adding the two jewel circle elements to a group
33-
jewel_splash = displayio.Group(max_size=20)
39+
jewel_splash = displayio.Group()
3440
jewel_splash.append(jewel_outline)
3541
jewel_splash.append(jewel)
3642

3743
# making a group for the crescent moon sequence
3844
# scale is 2 because at full 240x240 resolution image is too big
39-
moon_group = displayio.Group(scale = 2)
45+
moon_group = displayio.Group(scale=2)
4046
# group to hold all of the display elements
4147
main_group = displayio.Group()
4248

@@ -74,7 +80,7 @@
7480
# runs crescent moon animation
7581
if not music_playing and not animation_pause:
7682
# every .8 seconds...
77-
if (crescent + .8) < time.monotonic():
83+
if (crescent + 0.8) < time.monotonic():
7884
# the moon animation cycles
7985
tile_grid[0] = moon
8086
# moon is the tilegrid index location

0 commit comments

Comments
 (0)