basilisk-engine 0.1.7__py3-none-any.whl → 0.1.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of basilisk-engine might be problematic. Click here for more details.

File without changes
@@ -0,0 +1,28 @@
1
+ import os
2
+ import pygame as pg
3
+
4
+ class Sound:
5
+ def __init__(self, path: str | os.PathLike):
6
+ """
7
+ Sound object that can be played
8
+ """
9
+
10
+ if not (isinstance(path, str) or isinstance(path, os.PathLike)):
11
+ raise ValueError(f'bsk.Sound: Invalid source path type {type(path)}. Expected string or os.PathLike')
12
+
13
+ self.source = pg.mixer.Sound(path)
14
+
15
+ def play(self, volume: float=1.0):
16
+ """
17
+ Play the sound at the given volume level. Full volume if none given
18
+ """
19
+
20
+ self.source.set_volume(volume)
21
+ self.source.play()
22
+
23
+ def stop(self):
24
+ """
25
+ Stops the sound
26
+ """
27
+
28
+ self.source.stop()
basilisk/engine.py CHANGED
@@ -11,7 +11,6 @@ from .input.mouse import Mouse
11
11
  from .mesh.cube import Cube
12
12
  from .render.shader import Shader
13
13
  import glcontext
14
- import openal
15
14
 
16
15
  class Engine():
17
16
  win_size: tuple
@@ -76,6 +75,12 @@ class Engine():
76
75
  else:
77
76
  pg.display.set_mode(self.win_size, vsync=vsync, flags=pg.OPENGL | pg.DOUBLEBUF | pg.RESIZABLE)
78
77
  pg.display.set_caption(title)
78
+
79
+ # Init sound
80
+ pg.mixer.pre_init(44100, -16, 2, 512)
81
+ pg.mixer.init()
82
+ pg.mixer.set_num_channels(64)
83
+ pg.mixer.music.set_volume(100/100)
79
84
 
80
85
  # MGL context setup
81
86
  self.ctx = mgl.create_context()
@@ -132,7 +137,6 @@ class Engine():
132
137
  # Loop through all pygame events
133
138
  for event in self.events:
134
139
  if event.type == pg.QUIT: # Quit the engine
135
- openal.oalQuit()
136
140
  self.quit()
137
141
  return
138
142
  if event.type == pg.VIDEORESIZE:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: basilisk-engine
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: Python 3D Framework
5
5
  Home-page: https://basilisk-website.vercel.app/
6
6
  Author: Name
@@ -12,7 +12,6 @@ Requires-Dist: pygame-ce
12
12
  Requires-Dist: moderngl
13
13
  Requires-Dist: PyGLM
14
14
  Requires-Dist: numba
15
- Requires-Dist: PyOpenAL
16
15
 
17
16
  # Basilisk Engine
18
17
  ![image](https://github.com/user-attachments/assets/5e39445c-e0da-452c-9f18-e590cca948c4)
@@ -1,7 +1,9 @@
1
1
  basilisk/__init__.py,sha256=38Rmitj-4yslVnv6Gik9AHoArXMvCJRh4HcoZVKK48c,545
2
2
  basilisk/config.py,sha256=ynTRlX633DGoEtZOeAK8KNJF6offV3k3XFD7cia3Keg,61
3
- basilisk/engine.py,sha256=1a7aGZW2IRp-h-XO15CLWzZtwFC3SXXp0OOOil3r4II,6774
3
+ basilisk/engine.py,sha256=y15OdTsTjDk51Q06nLkVOx4KlJVM_6_owGdSGh92gBQ,6912
4
4
  basilisk/scene.py,sha256=RCrN0mD0vbZFAf4wY2D5D6okefMaZ-Q0t8Ls7YQGFnw,11602
5
+ basilisk/audio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ basilisk/audio/sound.py,sha256=BjqaPv_07iD_-NDRy1cc0TS4PJzAnQc4hfsW9ntNjGQ,719
5
7
  basilisk/bsk_assets/Roboto-Regular.ttf,sha256=kqYnZjMRQMpbyLulIChCLSdgYa1XF8GsUIoRi2Gcauw,168260
6
8
  basilisk/bsk_assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
9
  basilisk/bsk_assets/basilisk.png,sha256=1xePD8qDycxlRQ7hjEmfuw900BRykhRyumJePi6hxi8,21299
@@ -95,7 +97,7 @@ basilisk/shaders/particle.frag,sha256=Cv8cWQpVVQvhZeWj3NqL0D5nLtSO3EWV0VzOU-ZVL4
95
97
  basilisk/shaders/particle.vert,sha256=ElXzT7ywiZ0SjrFcUistVDBi4wOobQ7_J5O7XVxrsVs,3027
96
98
  basilisk/shaders/sky.frag,sha256=vTmZ1Xsd601_gmeBRfLYodHuBoBDI-M_1IybRt0ZDFk,178
97
99
  basilisk/shaders/sky.vert,sha256=v_BSdnMiljSJGPqno-J_apAiom38IrBzbDoxM7pIgwI,345
98
- basilisk_engine-0.1.7.dist-info/METADATA,sha256=p5t9Y688_t_DPAvZUfE01afLv7zmJp4CGjr4EwbQIXU,1171
99
- basilisk_engine-0.1.7.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
100
- basilisk_engine-0.1.7.dist-info/top_level.txt,sha256=enlSYSf7CUyAly1jmUCNNGInTbaFUjGk4SKwyckZQkw,9
101
- basilisk_engine-0.1.7.dist-info/RECORD,,
100
+ basilisk_engine-0.1.9.dist-info/METADATA,sha256=h1Q6Ltn2WzgCrewFwg6q1zW4CmWGuj-HxKxWhYGoJlA,1146
101
+ basilisk_engine-0.1.9.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
102
+ basilisk_engine-0.1.9.dist-info/top_level.txt,sha256=enlSYSf7CUyAly1jmUCNNGInTbaFUjGk4SKwyckZQkw,9
103
+ basilisk_engine-0.1.9.dist-info/RECORD,,