Skip to content

Commit a5bb129

Browse files
authored
Merge pull request joshiemoore#60 from joshiemoore/dance
BusDance
2 parents ce85ec3 + 4325cd1 commit a5bb129

File tree

184 files changed

+77
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+77
-5
lines changed

snakeware/config/x86-64-buildroot-config

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Automatically generated file; DO NOT EDIT.
3-
# Buildroot 2020.05-rc3-gd25a572 Configuration
3+
# Buildroot 2020.08-git-g5e25490 Configuration
44
#
55
BR2_HAVE_DOT_CONFIG=y
66
BR2_HOST_GCC_AT_LEAST_4_9=y
@@ -416,7 +416,7 @@ BR2_LINUX_KERNEL_LATEST_VERSION=y
416416
# BR2_LINUX_KERNEL_CUSTOM_GIT is not set
417417
# BR2_LINUX_KERNEL_CUSTOM_HG is not set
418418
# BR2_LINUX_KERNEL_CUSTOM_SVN is not set
419-
BR2_LINUX_KERNEL_VERSION="5.6.14"
419+
BR2_LINUX_KERNEL_VERSION="5.6.15"
420420
BR2_LINUX_KERNEL_PATCH=""
421421
# BR2_LINUX_KERNEL_USE_DEFCONFIG is not set
422422
# BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG is not set
@@ -1551,7 +1551,7 @@ BR2_PACKAGE_FDK_AAC_ARCH_SUPPORTS=y
15511551
# BR2_PACKAGE_LIBSNDFILE is not set
15521552
# BR2_PACKAGE_LIBSOUNDTOUCH is not set
15531553
# BR2_PACKAGE_LIBSOXR is not set
1554-
# BR2_PACKAGE_LIBVORBIS is not set
1554+
BR2_PACKAGE_LIBVORBIS=y
15551555
# BR2_PACKAGE_MP4V2 is not set
15561556
BR2_PACKAGE_OPENAL_ARCH_SUPPORTS=y
15571557
# BR2_PACKAGE_OPENAL is not set
@@ -1964,7 +1964,6 @@ BR2_PACKAGE_EXPAT=y
19641964
# BR2_PACKAGE_TINYXML is not set
19651965
# BR2_PACKAGE_TINYXML2 is not set
19661966
# BR2_PACKAGE_VALIJSON is not set
1967-
# BR2_PACKAGE_XERCES is not set
19681967
# BR2_PACKAGE_YAJL is not set
19691968
# BR2_PACKAGE_YAML_CPP is not set
19701969

@@ -2007,7 +2006,7 @@ BR2_PACKAGE_EXPAT=y
20072006
# BR2_PACKAGE_LIBMATROSKA is not set
20082007
# BR2_PACKAGE_LIBMMS is not set
20092008
# BR2_PACKAGE_LIBMPEG2 is not set
2010-
# BR2_PACKAGE_LIBOGG is not set
2009+
BR2_PACKAGE_LIBOGG=y
20112010
BR2_PACKAGE_LIBOPENH264_ARCH_SUPPORTS=y
20122011
# BR2_PACKAGE_LIBOPENH264 is not set
20132012
# BR2_PACKAGE_LIBOPUSENC is not set
@@ -2478,6 +2477,7 @@ BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET=y
24782477
# BR2_PACKAGE_FREESWITCH is not set
24792478
# BR2_PACKAGE_GERBERA is not set
24802479
# BR2_PACKAGE_GESFTPSERVER is not set
2480+
# BR2_PACKAGE_GLOOX is not set
24812481
# BR2_PACKAGE_GLORYTUN is not set
24822482

24832483
#

snakewm/apps/fun/bus/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from .dance import BusDance
2+
3+
4+
def load(manager, params):
5+
"""
6+
Create and launch a new instal of BusDance.
7+
"""
8+
# default position
9+
pos = (100, 100)
10+
11+
if params is not None and len(params) > 0:
12+
pos = params[0]
13+
14+
BusDance(pos, manager)

snakewm/apps/fun/bus/dance.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import os
2+
3+
import pygame
4+
import pygame_gui
5+
6+
from pygame_gui.elements.ui_image import UIImage
7+
8+
9+
class BusDance(pygame_gui.elements.UIWindow):
10+
DIMS = (320, 240)
11+
12+
FRAMES = []
13+
FRAMES_LEN = 0
14+
FRAME_INDEX = 0
15+
16+
def __init__(self, pos, manager):
17+
super().__init__(
18+
pygame.Rect(pos, (self.DIMS[0] + 32, self.DIMS[1] + 60)),
19+
manager=manager,
20+
window_display_title="BusDance",
21+
object_id="#busdance",
22+
)
23+
24+
self.dsurf = UIImage(
25+
pygame.Rect((0, 0), self.DIMS),
26+
pygame.Surface(self.DIMS).convert(),
27+
manager=manager,
28+
container=self,
29+
parent_element=self,
30+
)
31+
32+
app_path = os.path.dirname(os.path.abspath(__file__))
33+
frames_path = app_path + "/frames/"
34+
35+
for x in range(180):
36+
# load each frame from the GIF into the frame list
37+
frame = pygame.image.load(frames_path + "frame-" + str(x) + ".png")
38+
frame = pygame.transform.scale(frame, self.DIMS)
39+
40+
# add each frame twice for half speed
41+
self.FRAMES.append(frame)
42+
self.FRAMES.append(frame)
43+
44+
self.FRAMES_LEN = len(self.FRAMES)
45+
46+
# load and play the song
47+
pygame.mixer.init()
48+
pygame.mixer.music.load(app_path + "/party.ogg")
49+
pygame.mixer.music.play(loops=-1)
50+
51+
def update(self, delta):
52+
super().update(delta)
53+
self.dsurf.image.blit(self.FRAMES[self.FRAME_INDEX], (0, 0))
54+
self.FRAME_INDEX = (self.FRAME_INDEX + 1) % self.FRAMES_LEN
55+
56+
def kill(self):
57+
pygame.mixer.music.stop()
58+
super().kill()
1.53 KB
1.54 KB
1.54 KB
1.67 KB
1.67 KB
1.67 KB
1.67 KB
1.67 KB
1.67 KB
1.68 KB
1.69 KB
1.68 KB
1.66 KB
1.57 KB
1.66 KB
1.65 KB
1.64 KB
1.64 KB
1.63 KB
1.66 KB
1.64 KB
1.67 KB
1.68 KB
1.68 KB
1.53 KB
1.67 KB
1.68 KB
1.67 KB
1.65 KB
1.64 KB
1.66 KB
1.64 KB
1.64 KB
1.63 KB
1.62 KB
1.52 KB
1.61 KB
1.63 KB
1.62 KB
1.62 KB
1.61 KB
1.58 KB
1.56 KB
1.57 KB
1.61 KB
1.62 KB
1.52 KB
1.61 KB
1.61 KB
1.56 KB
1.56 KB
1.55 KB
1.55 KB
1.59 KB
1.59 KB
1.58 KB
1.59 KB
1.54 KB
1.61 KB
1.56 KB
1.58 KB
1.58 KB
1.58 KB
1.56 KB
1.57 KB
1.57 KB
1.57 KB
1.56 KB
1.57 KB
1.54 KB
1.55 KB
1.56 KB
1.57 KB
1.54 KB
1.54 KB
1.52 KB
1.55 KB
1.56 KB
1.53 KB
1.55 KB
1.56 KB
1.55 KB
1.58 KB
1.56 KB
1.54 KB
1.55 KB
1.56 KB
1.58 KB
1.53 KB
1.55 KB
1.54 KB
1.54 KB
1.57 KB
1.58 KB
1.59 KB
1.59 KB
1.56 KB
1.56 KB
1.56 KB
1.61 KB
1.58 KB
1.55 KB
1.6 KB
1.55 KB
1.57 KB
1.57 KB
1.58 KB
1.59 KB
1.55 KB
1.54 KB
1.57 KB
1.55 KB
1.6 KB
1.6 KB
1.57 KB
1.6 KB
1.61 KB
1.57 KB
1.57 KB
1.58 KB
1.6 KB
1.61 KB
1.63 KB
1.63 KB
1.6 KB
1.54 KB
1.61 KB
1.63 KB
1.64 KB
1.65 KB
1.65 KB
1.65 KB
1.66 KB
1.66 KB
1.68 KB
1.66 KB
1.57 KB
1.66 KB
1.69 KB
1.67 KB
1.64 KB
1.63 KB
1.63 KB
1.64 KB
1.65 KB
1.66 KB
1.67 KB
1.57 KB
1.66 KB
1.69 KB
1.7 KB
1.67 KB
1.67 KB
1.67 KB
1.67 KB
1.68 KB
1.67 KB
1.67 KB
1.55 KB
1.66 KB
1.69 KB
1.66 KB
1.68 KB
1.68 KB
1.68 KB
1.68 KB
1.67 KB
1.66 KB
1.66 KB
1.54 KB
1.65 KB
1.66 KB
1.67 KB
1.68 KB
1.68 KB
1.69 KB
1.69 KB
1.67 KB
1.69 KB
1.66 KB

snakewm/apps/fun/bus/party.ogg

1.95 MB
Binary file not shown.

0 commit comments

Comments
 (0)