Re: Wich library to using in Python?
2017-04-02
Thread
AudioGames . net Forum — Developers room : brian . kurosawa via Audiogames-reflector
Re: Wich library to using in Python? Thank you. URL: http://forum.audiogames.net/viewtopic.php?pid=305157#p305157 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Copying it to the same folder as your script is one way yes. Another method would be to install OpenAL on your system, though that takes a bit of effort to setup properly. If you plan on distributing your script it may be a good idea to include the OpenAL32.dll with it in case the users don't have OpenAL installed.First you would need to install [OpenAL], then download [OpenAL Soft]. Then follow the instructions in the OpenAL Soft archive to rename and copy over the required files. URL: http://forum.audiogames.net/viewtopic.php?pid=305139#p305139 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
2017-04-02
Thread
AudioGames . net Forum — Developers room : brian . kurosawa via Audiogames-reflector
Re: Wich library to using in Python? Do i have to copy the openal.dll to my folder? Cause i had success setting up PyAL but when i import it i got an error saying that openal32.dll is missing. URL: http://forum.audiogames.net/viewtopic.php?pid=305103#p305103 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Fair enough, keep in mind though that there are different ways of writing code, these are just a few of examples. In the Pyglet example the update() function is the main loop, its called continuously by schedule_interval(). Other functions like on_key_press() wait for input and trigger events as needed. Here's a different example:import pyglet from pyglet.window import key #main class class Example(pyglet.window.Window): def __init__(self): super(Example, self).__init__(640, 480, caption="Example") #load a sound self.sound = pyglet.media.load('example.wav',streaming=False) #load an image self.picture = pyglet.image.load('example.png') #run our update function continuously pyglet.clock.schedule_interval(self.update, .01) #primary update loop def update(self,dt): #draw screen self.draw() #draw to the screen def draw(self): self.clear() self.picture.blit(0,0) #capture key presses def on_key_press(self,symbol,modifiers): #if space is pressed, play sound if symbol == key.SPACE: self.sound.play() #if escape pressed, quit if symbol == key.ESCAPE: self.close() window = Example() pyglet.app.run()In the end it really depends on what you have in mind, you should pick and choose which library you want to use based on your current needs. If you feel Pygame is an easier fit, then go for it and see how it goes. URL: http://forum.audiogames.net/viewtopic.php?pid=305065#p305065 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Fair enough, keep in mind though that there are different ways of writing code, these are just a few of examples. In the Pyglet example the update() function is the main loop, its called continuously by schedule_interval(). Other functions like on_key_press() wait for input and trigger events as needed. Here's different example:import pyglet from pyglet.window import key #main class class Example(pyglet.window.Window): def __init__(self): super(Example, self).__init__(640, 480, caption="Example") #load a sound self.sound = pyglet.media.load('tone5.wav',streaming=False) #load an image self.picture = pyglet.image.load('sample3.png') #run our update function continuously pyglet.clock.schedule_interval(self.update, .01) #primary update loop def update(self,dt): #draw screen self.draw() #draw to the screen def draw(self): self.clear() self.picture.blit(0,0) #capture key presses def on_key_press(self,symbol,modifiers): #if space is pressed, play sound if symbol == key.SPACE: self.sound.play() #if escape pressed, quit if symbol == key.ESCAPE: self.close() window = Example() pyglet.app.run()In the end it really depends on what you have in mind, you should pick and choose which library you want to do based on your current needs. If you feel Pygame is an easier fit, then go for it and see how it goes. URL: http://forum.audiogames.net/viewtopic.php?pid=305065#p305065 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Pygame seems to me more convenient. In pyglet, I do not understand where the main loop is, plus I do not know the decorators very well. URL: http://forum.audiogames.net/viewtopic.php?pid=305059#p305059 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Here's the same example in Pygame:import pygame from pygame import mixer import sys def Example(): #initialize pygame pygame.init() #initialize sound mixer mixer.init() #set window caption pygame.display.set_caption('Example') #create display window = pygame.display.set_mode([640,480]) #load sound sound = mixer.Sound('example.wav') #load image picture = pygame.image.load('example.png') #main update loop while True: for event in pygame.event.get(): if event.type == pygame.KEYDOWN: #if space is pressed, play sound if event.key == pygame.K_SPACE: sound.play() #if escape is pressed, quit if event.key == pygame.K_ESCAPE: pygame.quit() sys.exit(0) #clear window window.fill([0,0,0]) #draw picture to window window.blit(picture,(0,0)) #update window pygame.display.update() Example() URL: http://forum.audiogames.net/viewtopic.php?pid=305046#p305046 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Whenever a key is pressed, the functions on_key_press() and on_key_release() add a text string in to the key_input list. That particular line checks to see if the string "SPACE press" is inside that list, indicating that the space bar has been pressed. There are other ways to doing it, that just happened to be the method I went with. For example you could also write it directly in the on_key_press function like this:def on_key_press(symbol,modifiers): if symbol == key.SPACE: sound.play() URL: http://forum.audiogames.net/viewtopic.php?pid=305043#p305043 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Thanks for the example!There are a few questions in this code:If 'SPACE press' in key_input:As I understand it, key_input is a list. In such case, what is being checked? URL: http://forum.audiogames.net/viewtopic.php?pid=305027#p305027 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Who has a similar example with Pygame, please share it! URL: http://forum.audiogames.net/viewtopic.php?pid=305035#p305035 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Also I do not know:Def update (dt):I know this is a function, but why is it needed?Global key_inputIf 'SPACE press' in key_input:With this syntax is also not familiar. URL: http://forum.audiogames.net/viewtopic.php?pid=305032#p305032 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? What means:[ a-t ] Window.eventI've never seen such syntax. URL: http://forum.audiogames.net/viewtopic.php?pid=305031#p305031 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Thanks for the example!I used BGT before, but I realized that I do not have enough cross-platform capabilities. I'm a long time to think which language to choose, and eventually chose Python. Because it is simple and cross-platform.My goal is 3D shooters, 3D online games. But Python has a lot of libraries, so I'm confused. URL: http://forum.audiogames.net/viewtopic.php?pid=305027#p305027 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? I've not used libaudioverse so I can't say whether there's an issue with it or not. I have encountered something similar with Pyglets build in OpenAL functions at times, I think it may have had to do with the audio samples themselves, though i'm not sure.Here's that example:import pyglet from pyglet.window import key #create window window = pyglet.window.Window(640,480,caption='Example') #clear window window.clear() #key input container key_input = [] #load sound sound = pyglet.media.load('example.wav',streaming=False) #load image picture = pyglet.image.load('example.png') #main update loop @window.event def update(dt): global key_input #play sound if 'SPACE press' in key_input: sound.play() #quit program if 'ESCAPE press' in key_input: window.close() #purge key presses for next update if len(key_input) > 0: key_input = [] #capture key presses @window.event def on_key_press(symbol,modifiers): key_input.append(key.symbol_string(symbol) + " press") print key.symbol_string(symbol) + " press" #capture key releases @window.event def on_key_release(symbol,modifiers): key_input.append(key.symbol_string(symbol) + " release") print key.symbol_string(symbol) + " release" #draw window @window.event() def on_draw(): window.clear() picture.blit(0,0) #schedule and run update function pyglet.clock.schedule_interval(update, .01) pyglet.app.run() URL: http://forum.audiogames.net/viewtopic.php?pid=304999#p304999 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? I've not used libaudioverse so I can't say whether there's an issue with it or not. I have encountered something similar with Pyglets build in OpenAL functions at times, I think it may have had to do with the audio samples themselves, though i'm not sure.Here's that example:import pyglet from pyglet.window import key #create window window = pyglet.window.Window(640,480,caption='Example') #clear window window.clear() #key input container key_input = [] #load sound sound = pyglet.media.load('example.wav',streaming=False) #load image picture = pyglet.image.load('example.png') #main update loop @window.event def update(dt): global key_input #play sound if 'SPACE press' in key_input: sound.play() if 'ESCAPE press' in key_input: window.close() #purge key presses for next update if len(key_input) > 0: key_input = [] #capture key presses @window.event def on_key_press(symbol,modifiers): key_input.append(key.symbol_string(symbol) + " press") print key.symbol_string(symbol) + " press" #capture key releases @window.event def on_key_release(symbol,modifiers): key_input.append(key.symbol_string(symbol) + " release") print key.symbol_string(symbol) + " release" #draw window @window.event() def on_draw(): window.clear() picture.blit(0,0) #schedule and run update function pyglet.clock.schedule_interval(update, .01) pyglet.app.run() URL: http://forum.audiogames.net/viewtopic.php?pid=304999#p304999 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
2017-04-01
Thread
AudioGames . net Forum — Developers room : brian . kurosawa via Audiogames-reflector
Re: Wich library to using in Python? Well, it's me or libaudioverse takes a lot of memory? When i played deathmatch i noticed some clicks on the audio even having a good machine, is the way that the game was programmed or is the propper libaudioverse? URL: http://forum.audiogames.net/viewtopic.php?pid=304992#p304992 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? I will not oppose the examples. URL: http://forum.audiogames.net/viewtopic.php?pid=304984#p304984 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Both Pygame and Pyglet are equally good, but if you were to pick from only those two then Pyglet can give you a bit more flexibility and power as it has hardware acceleration with 3D support if you need it. Pyglet can also handle 3D audio via OpenAL with a bit of adjustment, but enabling that may not be as simple as you'd like, so going with libaudioverse or PyAL could be a more straight forward choice if you need more advanced audio. I primarily program with Pyglet, so if you like I can supply a template script demonstrating how to create a window, use the keyboard, audio, etc.I'm also becoming quite fond of Tolk, the setup was relatively painless, it's fairly reliable, compact, and seems to pack nicely with pyinstaller. Pyttsx is also really reliable, but only supports native TTS options. URL: http://forum.audiogames.net/viewtopic.php?pid=304982#p304982 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
Re: Wich library to using in Python? Both Pygame and Pyglet are equally good, but if you were to pick from only those two then Pyglet can give you a bit more flexibility and power as it has hardware acceleration with 3D support if you need it. Pyglet can also handle 3D audio via OpenAL with a bit of adjustment, but enabling that may not be as simple as you'd like, so going with libaudioverse or PyAL could be a more straight forward choice if you need more advanced audio.I'm becoming quite fond of Tolk, the setup was relatively painless, it's fairly reliable, compact, and seems to pack nicely with pyinstaller. Pyttsx is also really reliable, but only supports native TTS options. I primarily program with Pyglet, so if you like I can supply a template script demonstrating how to create a window, use the keyboard, audio, etc. URL: http://forum.audiogames.net/viewtopic.php?pid=304982#p304982 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Wich library to using in Python?
2017-04-01
Thread
AudioGames . net Forum — Developers room : brian . kurosawa via Audiogames-reflector
Re: Wich library to using in Python? Have you tried pyttsx, tolk and accessible_output2? URL: http://forum.audiogames.net/viewtopic.php?pid=304953#p304953 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Wich library to using in Python?
Wich library to using in Python? Hello. Can you tell me which libraries to use for the game? I know about which pygame, pyglet, pyall, libaudioverse, I have a library that uses soundlib. I need the simplest option. And I do not know with which pygame or pyglet. As I understand it, I need to create a window, work with the keyboard. I'm using Python 2.7. Thank you in advance! URL: http://forum.audiogames.net/viewtopic.php?pid=304919#p304919 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector