[pygame] Joystick no longer global in Pygame2?

2022-01-10 Thread Alec Bennett
I'm testing Pygame 2 (under Ubuntu), and noticed a big change: the Pygame window now needs to have focus to catch joystick events. This wasn't the case in the previous Pygame version I was using (1.9.3). For example if I run this script with Pygame 1.9.3, it catches all joystick events no matter

[pygame] Demo for using two joysticks at once?

2019-04-22 Thread Alec Bennett
I'm working on a project that uses two different joysticks simultaneously. I can read them individually, but only one at a time. I was wondering if there might be some code out there to show how to read them simultaneously? In other words to fire commands whenever one of the joystick states

[pygame] Pygame GUI keeps monitor from sleeping?

2019-03-26 Thread Alec Bennett
I have a strange problem: when my Pygame app is running it prevents my monitor from ever turning off. No other program that I can find does this on this computer. Running Ubuntu. If I disable the Pygame GUI in the script the monitor powers off after 15 minutes as usual. Is this expected

[pygame] Re: Fun NYE script

2018-12-29 Thread Alec Bennett
I posted it here fyi: https://bitbucket.org/wrybread/nye-countdown/src/master/ On Sat, Dec 29, 2018 at 9:57 AM Alec Bennett wrote: > I made a little Pygame script that shows where it's New Year's Eve for > every hour on Monday, designed to be shown on a projector so people can > have

[pygame] Fun NYE script

2018-12-29 Thread Alec Bennett
I made a little Pygame script that shows where it's New Year's Eve for every hour on Monday, designed to be shown on a projector so people can have a little party every hour, not just at midnight locally. Plays a little countdown video (using VLC bindings) for maximum effect at the stroke of

[pygame] Embedding VLC in Pygame?

2018-09-24 Thread Alec Bennett
I'd like to embed VLC, MPV or Mplayer in a Pygame surface if it's possible. I found this old link: https://gist.github.com/smathot/1521059/1680f906d508368a46b80e8ba01aa627c2e781fa I'm getting errors when attempting to run it. Before troubleshooting farther I thought I'd see if there's an updated

Re: [pygame] Question about Pygame-menu package

2018-09-24 Thread Alec Bennett
and re render your background UI. >> >> You may also want to consider what events you should delegate to the menu >> and which you should capture for yourself. Eg. You may want to prefilter >> the events and handle the pygame.quit event yourself. >> >> On Mon, S

Re: [pygame] Question about Pygame-menu package

2018-09-24 Thread Alec Bennett
Sorry for the cross post, I posted an issue to the project's github page here: https://github.com/ppizarror/pygame-menu/issues/19 For anyone interested, note the fix I posted there. Feedback invited. On Sun, Sep 23, 2018 at 10:08 PM Alec Bennett wrote: > > > On Sun, Sep 23, 2018 at

Re: [pygame] Question about Pygame-menu package

2018-09-23 Thread Alec Bennett
t. > On Sun, Sep 23, 2018 at 11:10 PM Alec Bennett wrote: > >> I'm trying to add the beautiful menus from Pygame-menu ( >> https://github.com/ppizarror/pygame-menu) to my project, but having >> trouble. In my attached stripped down sample, I'm trying to show menu

[pygame] Re: Question about Pygame-menu package

2018-09-23 Thread Alec Bennett
Apologies, there were a few errors in my sample. Attached is a fixed version. If anyone has any tips about how to close the menu, I'd love to hear. I can close it with the ESC key, but not by selecting an item. import pygame, sys from pygame.locals import * import pygameMenu#

[pygame] Question about Pygame-menu package

2018-09-23 Thread Alec Bennett
I'm trying to add the beautiful menus from Pygame-menu ( https://github.com/ppizarror/pygame-menu) to my project, but having trouble. In my attached stripped down sample, I'm trying to show menu1 when the 1 key is pressed, and show menu2 when the 2 key is pressed. They're both "main menus"

[pygame] How to do some action while a joystick is in motion?

2018-09-18 Thread Alec Bennett
I'm making a controller for a PTZ ("pan/tilt/zoom") camera using Pygame, so I can move the camera around with a gaming joystick. It works but the motion is very jerky. The camera expects a "start" action ("start moving the camera left") and then a stop action ("stop moving it"). I'm handling that

Re: [pygame] Re: Some way to pickle or otherwise save a pygame.mixer.Sound object?

2018-06-08 Thread Alec Bennett
n under Linux that would do it reliably? I suppose I could slave two instances of mplayer, but I'd of course prefer to not be forking out processes. If anyone's curious about the files I'm trying to load, I posted some test files here: sinkingsensation.com/dropbox/icecream.zip On Thu, Jun 7, 2018

Re: [pygame] Re: Some way to pickle or otherwise save a pygame.mixer.Sound object?

2018-06-07 Thread Alec Bennett
On Thu, Jun 7, 2018 at 7:59 AM, Christopher Night wrote: > I recommend saving the sound as a raw buffer. First in a separate script: > > sound = pygame.mixer.Sound("music1.wav") > open("music1.buf", "wb").write(sound.get_raw()) > > Then in your game: > sound =

Re: [pygame] Re: Some way to pickle or otherwise save a pygame.mixer.Sound object?

2018-06-07 Thread Alec Bennett
> > > > A second solution is to load the sounds in the background of the game, > especially if you're going to launch on a menu where the sounds won't be > needed. You can pre-populate a dictionary with dummy sounds and use a > thread to go through and load each sound into the dictionary while the

Re: [pygame] Some way to pickle or otherwise save a pygame.mixer.Sound object?

2018-06-07 Thread Alec Bennett
On Thu, Jun 7, 2018 at 4:21 AM, Greg Ewing wrote: > Alec Bennett wrote: > >> 16 bit wav files. 1411 kbps. About 5 megs each but one is very long (a 13 >> minute medley of all of them, 133 megs). >> > > Okay, I didn't realise they were that big -- I wa

Re: [pygame] Some way to pickle or otherwise save a pygame.mixer.Sound object?

2018-06-07 Thread Alec Bennett
: > Alec Bennett wrote: > >> since it needs to load each of the 20 sounds on startup it takes about 30 >> seconds to load. I'm running it on a Raspberry Pi, which doesn't help of >> course. >> > > How big are the sound files? Unless they're really enormous, > t

Re: [pygame] Re: Some way to pickle or otherwise save a pygame.mixer.Sound object?

2018-06-07 Thread Alec Bennett
ght do this with a class: > https://gist.github.com/pydsigner/231c0812f9f91050dd83c744d6d5dc4b > > On Thu, Jun 7, 2018 at 12:31 AM, Alec Bennett wrote: > >> Sorry, I left out the line where I try to save the file: >> >> > pickle.dump( sound_obj, open( "sound

[pygame] Re: Some way to pickle or otherwise save a pygame.mixer.Sound object?

2018-06-06 Thread Alec Bennett
Sorry, I left out the line where I try to save the file: > pickle.dump( sound_obj, open( "sound.pickled", "wb" ) ) On Wed, Jun 6, 2018 at 10:29 PM, Alec Bennett wrote: > I'm building a musical horn for my car with PyGame, and it works > perfectly, but since it

[pygame] Some way to pickle or otherwise save a pygame.mixer.Sound object?

2018-06-06 Thread Alec Bennett
I'm building a musical horn for my car with PyGame, and it works perfectly, but since it needs to load each of the 20 sounds on startup it takes about 30 seconds to load. I'm running it on a Raspberry Pi, which doesn't help of course. I thought I'd simply save the Sound objects as pickle objects,

Re: [pygame] How to prevent mouse initialization in Pygame

2017-07-14 Thread Alec Bennett
Another possibility would be to execute a command that moves the mouse way off screen? https://unix.stackexchange.com/questions/164262/can-i-simulate-mouse-movements-via-terminal-without-xdotool On Fri, Jul 14, 2017 at 5:26 AM, Annette Wilson wrote: > Hi, I'm not

Re: [pygame] How to prevent mouse initialization in Pygame

2017-07-05 Thread Alec Bennett
Why not just programmatically move the mouse offscreen? Or change the mouse cursor to something invisible. Both are easy under wx python, im guessing easy with pygame too. > On Jul 5, 2017, at 4:22 PM, Greg Ewing wrote: > > Роман Мещеряков wrote: >> I

Re: [pygame] Registration disabled.

2016-04-28 Thread Alec Bennett
Or if someone wants to be curator, just replace the whole submission process with an email address and/or Dropbox link, and let people submit the projects that way? On Thu, Apr 28, 2016 at 10:28 AM, DiliupG wrote: > I was not trying to be rude or offensive to anyone. If it

Re: [pygame] create account on pygame.org

2015-02-15 Thread Alec Bennett
I've found what works very well to fight spam is a small bit of domain specific knowledge. Questions like What pygame function should be called to create a window? should be relatively easy for someone who uses pygame to answer, but would likely work surprisingly well to keep spammers at

Re: [pygame] Low-level read input (mouse, HID devices)

2015-01-15 Thread Alec Bennett
You can easily get the mouse position regardless of focus under Windows using the win32api: mouse_pos = win32api.GetCursorPos() On Thu, Jan 15, 2015 at 3:26 PM, Weeble clockworksa...@gmail.com wrote: It is possible, just not entirely obvious. I believe you need to: 1. Grab mouse focus

Re: [pygame] My game - Time Trek

2014-12-17 Thread Alec Bennett
Super cool Ted. The video was indeed worth it... And thanks for pointing out that distro with the video module enabled. On Wed, Dec 17, 2014 at 4:26 PM, Ted Hunt ted.h...@clear.net.nz wrote: Thanks Luke for pointing this out. I've changed the code skip the movies if either the movie

Re: [pygame]

2014-12-04 Thread Alec Bennett
On Thu, Dec 4, 2014 at 3:00 PM, Harry Keys pbrgamers...@gmail.com wrote: I wouldn't mind seeing pygame 2 be able to directly capture keystokes / mouse clicks while running in the background as well. Seconded. That's pretty much the number one thing I miss when working with Pygame on OS's

Re: [pygame] Multiple sound cards

2014-11-06 Thread Alec Bennett
I think the VLC Python module can also route to multiple cards, fyi. And it has the advantage over PyAudio of being able to play lots of different formats. On Thu, Nov 6, 2014 at 1:54 PM, jasonmarshall...@gmail.com wrote: Scott, I think that PyAudio is what you're looking for.

Re: [pygame] Using sound with python 2.7 and above

2014-10-29 Thread Alec Bennett
And if you put that line after the pygame.init() line? On Wed, Oct 29, 2014 at 7:37 AM, NuMedia ianldickinso...@gmail.com wrote: Hi can any one help with this when using python 2.7 and above or 3.X the line if not pygame.mixer: print 'Warning, sound disabled' message gets printed

Re: [pygame] Requesting a hand with a simple Death Counter

2014-10-28 Thread Alec Bennett
Capturing keystrokes in the background is something I've had a lot of problems with too. On Windows, the PyHook module works great for this, as does the win32api module. Something like: # keyboard c i = win32api.GetAsyncKeyState(67) if i 0:

Re: [pygame] Requesting a hand with a simple Death Counter

2014-10-28 Thread Alec Bennett
For win32api, you need to install the Python Windows Extensions. For Pyhook, there's lots of examples out there, but maybe someone wants to work on your code for you. On Mon, Oct 27, 2014 at 11:33 PM, PBRGamer pbrgamers...@gmail.com wrote: Oh, and I tried the easy way with the win32api but

Re: [pygame] Requesting a hand with a simple Death Counter

2014-10-28 Thread Alec Bennett
() On Mon, Oct 27, 2014 at 11:39 PM, Alec Bennett wrybr...@gmail.com wrote: For win32api, you need to install the Python Windows Extensions. For Pyhook, there's lots of examples out there, but maybe someone wants to work on your code for you. On Mon, Oct 27, 2014 at 11:33 PM, PBRGamer

Re: [pygame] encrypt/decrypt zip/unzip

2014-08-26 Thread Alec Bennett
analogy is probably wrong. On Mon, Aug 25, 2014 at 10:49 PM, diliup gabadamudalige dili...@gmail.com wrote: https://en.wikipedia.org/wiki/Malware doesn't fall into the category. :) On Tue, Aug 26, 2014 at 11:10 AM, Alec Bennett wrybr...@gmail.com wrote: some games lock up the os

Re: [pygame] encrypt/decrypt zip/unzip

2014-08-25 Thread Alec Bennett
If you're clearing the Windows clipboard, you might want to let the user know that. Very prominently. Otherwise your program is basically malware in my opinion. It's still, in my opinion, malware, but at least you'd be warning the user so they'd know that running your program will cripple

Re: [pygame] encrypt/decrypt zip/unzip

2014-08-25 Thread Alec Bennett
and you need to exit the game to have access to the os. Does that make the game a malware? On Tue, Aug 26, 2014 at 10:46 AM, Alec Bennett wrybr...@gmail.com wrote: If you're clearing the Windows clipboard, you might want to let the user know that. Very prominently. Otherwise your program

Re: [pygame] Using Pygame to capture key presses for CLI prgram?

2013-05-30 Thread Alec Bennett
Please post what you wind up using, this comes up for me pretty often too. In Windows there's a super easy way to get global keypresses, but I haven't found anything in *nix. Windows method: i = win32api.GetAsyncKeyState([keycode]) On Thu, May 30, 2013 at 1:02 AM, winkleink

Re: [pygame] Does PyGame 1.9.1 work with Python 3.3.0 on Mac OSX 10.6.8?

2013-02-14 Thread Alec Bennett
Are you sure you installed pygame on that computer? That's not an import error, it's simply not finding the module at all. Maybe you installed to some other python installation on that computer? -- Sent from my gizmo. On Feb 14, 2013, at 7:08 PM, Mt.Rose$TheFerns arcktri...@aim.com

Re: [pygame] PyGame tutorial at PyCon in Santa Clara, CA

2013-01-20 Thread Alec Bennett
Sweet. Agreed. And I'll see you there. -- Sent from my gizmo. On Jan 20, 2013, at 11:13 PM, René Dudfield ren...@gmail.com wrote: Sweet! On Jan 21, 2013 7:02 AM, Richard Jones r1chardj0...@gmail.com wrote: Hi all, Just wanted to let you know that I'm giving an introduction

Re: [pygame] Pygame for Android question: videos possible?

2012-11-01 Thread Alec Bennett
On Mon, Oct 29, 2012 at 3:29 PM, Noel Garwick noel.garw...@gmail.comwrote: As far as I know, video support is still missing for Pygame subset for Android. Can anyone think of a way to work around this issue? Maybe a way to play video as an external process? Or would it be hard to add video

[pygame] Pygame for Android question: videos possible?

2012-10-29 Thread Alec Bennett
I need to do an Android project that simply plays one of five videos, and I was considering using Pygame for it. I was wondering if this would be possible? Can I play fullscreen video using Pygame on Android? I'd be using the Google Nexus 7, if that's a factor. The video can be in whatever

Re: [pygame] High scores program

2012-10-24 Thread Alec Bennett
There's a lot wrong with that sample you posted. You probably also want: DISPLAYSURF.blit(scoresList[0],scoresList[1]) Instad of: DISPLAYSURF.blit(scoresList[0][0],scoresList[0][1]) But I didn't get very far, because each time I'd fix one bug there was another. There's also a typo, search

Re: [pygame] High scores program

2012-10-24 Thread Alec Bennett
. On Wed, Oct 24, 2012 at 8:25 PM, Alec Bennett wrybr...@gmail.com wrote: There's a lot wrong with that sample you posted. You probably also want: DISPLAYSURF.blit(scoresList[0],scoresList[1]) Instad of: DISPLAYSURF.blit(scoresList[0][0],scoresList[0][1]) But I didn't get very far

Re: [pygame] Pygame GUI 0.2 (stable)

2012-10-09 Thread Alec Bennett
This project provides a simple to use GUI toolkit that can be easily dropped into an existing game project. It will run with no code Very interesting. Are there screenshots available? And out of curiosity, does the look of the widgets vary on different OS's?

Re: [pygame] have i got right programs or am i missing something

2012-10-08 Thread Alec Bennett
You might consider an intro to Python tutorial or two before attempting to write a game... On Mon, Oct 8, 2012 at 10:47 AM, shane shanevansh...@yahoo.com wrote: Hi Ive loaded the following on to my computer what else do i need to look for and load to write games but then to test and play

Re: [pygame] please folks a bit of decency - Yes U Alec Bennett wrybr...@gmail.com

2012-10-08 Thread Alec Bennett
--- prebuilt-msvcr90. --- prebuilt-pygame1.9.0-msvcr71-win32.zip --- prebuilt-pygame1.9.0-msvcr90-win32.zip *From: Alec Bennett wrybr...@gmail.com You might consider an intro to Python tutorial or two before attempting to write a game... -- View this message in context

Re: [pygame] pyHooking the Arrow Keys

2012-03-19 Thread Alec Bennett
The solution was right there as a comment in your code: you need to add return True if you want to pass the keypress along. Conversely, return False will block it. Something like: def OnKeyboardEvent(event): print event.ScanCode, event.Key return True On Mon, Mar 19, 2012 at 6:32

Re: [pygame] Declaring variables in function as if at code's line-level

2012-03-13 Thread Alec Bennett
Someone really needs to turn this thread into a game... On Tue, Mar 13, 2012 at 5:34 PM, Brian Brown bro...@gmail.com wrote: I started QBasic at about 12. . . I am nearly completely self-taught and I started making my ball program in Java at about 14-- I carefully thought out the

Re: [pygame] Intercepting the Keyboard

2012-03-07 Thread Alec Bennett
If you're using JAWS, I'm guessing you're running Windows? If so, you might look into the PyHook module. I don't know if it hooks keystrokes before or after JAWS, but its worth a try. Then there's also the win32api. Something like: win32api.GetAsyncKeyState(100) Again, no idea how it'll work

Re: [pygame] commercial pygame games

2012-02-21 Thread Alec Bennett
For PC installers, you might give the Nullsoft Installer (aka NSIS) a try: http://nsis.sourceforge.net/Main_Page Works great. Easy to use once you get the hang of it. On Tue, Feb 21, 2012 at 1:53 PM, Keith Nemitz muse...@yahoo.com wrote: On Mac, I use py2app. On Windows I use py2exe and

Re: [pygame] Pygame 2.0

2012-02-12 Thread Alec Bennett
And out of curiosity, what huge advantage would Python 3.0 give you, over, say, 2.7? On Sun, Feb 12, 2012 at 11:04 PM, Santiago Romero srom...@sromero.orgwrote: On Mon, Feb 13, 2012 at 2:21 AM, Zack Baker zbaker1...@gmail.com wrote: I've only been on the mailing list for a few months now

Re: [pygame] Using pygame to create interface...

2011-12-02 Thread Alec Bennett
I think it would depend on what sort of look and feel you're going for. Pygame would probably be great for making something simple and highly graphical, like a bunch of graphical buttons. But if you want something more complicated than that (menubars, toolbars, child windows, even groups of

Re: [pygame] Multiple keyboard

2011-11-19 Thread Alec Bennett
Have you tried the pyHooks module? It can hook the keyboard at what might be a lower level than pygame. I know, for example, that it works whether or not the application has focus. There's a demo script that prints all the info about a given keystroke, maybe there's something in it that

Re: [pygame] Citing PyGame in papers

2011-11-07 Thread Alec Bennett
Out of curiosity, what would be an example of an experiment you conduct that involves PyGame? On Nov 8, 2011, at 1:13 PM, Ryan Hope rmh3...@gmail.com wrote: PyGame has increased my productivity as a research by an order of magnitude. Experiment that used to take me weeks to code up in

Re: [pygame] Games for blind players

2011-10-23 Thread Alec Bennett
games for blind people This is such an interesting discussion. What about a game of concentration, where each keyboard key has a different sound, and you have to find the other key with the same sound? Any key that's already been paired will then be silent or give some white noise sound. The

Re: [pygame] Students Interested in Pygames Community

2011-10-22 Thread Alec Bennett
I'm a big fan of using the game Simon as a vehicle to learn a programming language.

[pygame] Possible to detect collision with an image?

2011-10-07 Thread Alec Bennett
I'm using an image with transparency as a Sprite. The image has an irregular shape: http://sinkingsensation.com/stuff/shape.png I'd like to detect collisions with it. My current strategy is to draw a polygon (pygame.draw.polygon) behind the image. That works, but its difficult to make the