Re: [pygame] midi events

2021-07-26 Thread Daniel Foerster
In that example, the midi events are converted to Pygame events and posted to the Pygame event queue here: https://github.com/pygame/pygame/blob/main/examples/midi.py#L74 On Mon, Jul 26, 2021, 04:02 Folkert van Heusden wrote: > Hi, > > If I look at https://github.com/pygame/pygame/blob/main/exam

Re: [pygame] Question about sound effect playback

2021-07-14 Thread Daniel Foerster
don't need to cache, but rollback netcode demands lots of CPU so >> I suspect I probably will end up optimizing this to improve robustness vs >> lag. >> >> A pity mixer won't let you start Channels partway through a Sound, as >> then there'd be no CPU co

Re: [pygame] Question about sound effect playback

2021-07-14 Thread Daniel Foerster
Instead of using the raw sound binary data and winging the slice, I'd recommend throwing things into a sndarray. def clip_sound(sound, start_time): freq = pygame.mixer.get_init()[0] offset = round(freq * start_time) arr = pygame.sndarray.array(sound) clipped = arr[offset:] ret

Re: [pygame] Image load and convert

2020-09-17 Thread Daniel Foerster
The instructions are on the wiki https://www.pygame.org/wiki/info#Mailing%20List On Thu, Sep 17, 2020, 15:19 Aleksandar Petrovic < aleksandar.petrovi...@gmail.com> wrote: > I want unsubscribe from this list > > чет, 17. сеп 2020. у 22:16 Russell Cumins је > написао/ла: > >> Hi Irv, >> >> Found t

Re: [pygame] One key press many events

2020-09-17 Thread Daniel Foerster
Jan: Your player moves just once because you are listening for KEYDOWN events to move. KEYDOWN is only triggered when you first press a key. You can get the behavior you want in two ways. Option 1: use pygame.key.get_pressed() to see the current state of the keys you want to check instead of exam

Re: [pygame] pygame.cdrom not found (pygame 2.0.0.dev3)

2019-07-20 Thread Daniel Foerster
I'm getting the same error on Windows 10 with this wheel: pygame-2.0.0.dev3-cp37-cp37m-win32.whl The cdrom module still appears in the documentation and source code so I wonder if this is a distribution issue? — Daniel On Sat, Jul 20, 2019 at 11:30 AM Go Peppy wrote: > Hi, > > I'm trying to us

Re: [pygame] Re: Starting the pygame 2 series

2019-07-15 Thread Daniel Foerster
This can be done already using a lambda: color_lerp = lambda pct: color.lerp(color2, pct) On Mon, Jul 15, 2019, 13:56 Sam Bull wrote: > On Mon, 2019-07-15 at 01:32 +0200, René Dudfield wrote: > > Thanks to @charlesoblack (first time contributor ya!) there is a > > pygame.Color.lerp() function

Re: [pygame] Pygame Holiday Present - pygwidgets & pyghelpers

2018-12-26 Thread Daniel Foerster
I haven't had a chance to run the demo programs, but I think providing a basic UI toolkit is sound. I do have concerns about the functions like openFileForReading. I don't think there's enough value in those encapsulations to outweigh the cost of teaching a new user to Python abstractions around ba

Re: [pygame] IDE

2018-12-22 Thread Daniel Foerster
He was asking for good editors. I'm currently partial to VS Code; to your point, it has nice integrations with git, pylint, and pytest. On Sat, Dec 22, 2018, 14:08 tom arnall why not just use Test Driven Development and a good editor? > > On 12/22/18, David wrote: > > Just wondering which IDE pe

Re: [pygame] Question about Pygame-menu package

2018-09-24 Thread Daniel Foerster
ror/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 10:03 PM Daniel Foerster

Re: [pygame] Question about Pygame-menu package

2018-09-23 Thread Daniel Foerster
The way to find out what item is selected is to use a different function for different menu items. This seems to be callback driven. How do you close a menu? I'm honestly not sure why your example doesn't work as expected. I downloaded and ran the example successfully, but no amount of tweaking to

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

2018-06-07 Thread Daniel Foerster
ds as needed. > > A very good idea, and the route I originally took, but as far as I can > tell pygame.mixer.music doesn't support polyphony, and I occasionally need > to play multiple sounds at once. > > > > > > On Wed, Jun 6, 2018 at 10:59 PM, Daniel Foerster >

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

2018-06-06 Thread Daniel Foerster
I think the answer that sticks out to me is that if these are musical horn sounds, you might consider using pygame.mixer.music, which will stream the sounds as needed. However, this won't work if you have other music playing or if you want multiple horns to be able to play at the same time. A seco

Re: [pygame] Iterate over list and delete

2018-05-20 Thread Daniel Foerster
n Sun, May 20, 2018 at 9:25 PM, Daniel Foerster > wrote: > >> The relevance of N exponent versus the discarded coefficients depends on >> how big N may be. With the likely sizes of N in a Pygame class, the >> difference between the algorithms seems probably negligible. A quick

Re: [pygame] Iterate over list and delete

2018-05-20 Thread Daniel Foerster
This is a quality algo improvement. I will note that the del can just be "del myList[i_write:]" without the manually calculated upper bound. On Sun, May 20, 2018, 23:39 MrGumm wrote: > I like this one. I would modify somewhat. If you don't like "not" you > could change the function name to keep_

Re: [pygame] Iterate over list and delete

2018-05-20 Thread Daniel Foerster
t copy > from your list, but handles changes in the list correctly for you. So its > both memory and time efficient (one pass, one instance). In addition, by > going backwards, even if there's another instance of the removed item, the > iterator that reversed returns doesn't barf or

Re: [pygame] Iterate over list and delete

2018-05-20 Thread Daniel Foerster
, but either can handle well over N=2 in 10ms. Of course, a list comprehension can handle almost 100,000 in the same 10ms so the point is all rather moot in real-world code ;) On Sun, May 20, 2018 at 9:48 PM, Ian Mallett wrote: > On Sun, May 20, 2018 at 8:35 PM, Daniel Foerster >

Re: [pygame] Iterate over list and delete

2018-05-20 Thread Daniel Foerster
ve talked about list > comprehensions up until that point. > > Thanks, > > Irv > > > On May 20, 2018, at 2:35 PM, Daniel Foerster wrote: > > I think what you're looking for is this: > > my_list = [x for x in my_list if not need_to_delete(x)] > > On Sun,

Re: [pygame] Iterate over list and delete

2018-05-20 Thread Daniel Foerster
I think what you're looking for is this: my_list = [x for x in my_list if not need_to_delete(x)] On Sun, May 20, 2018, 16:28 Irv Kalb wrote: > I am building a game where I am keeping track of many objects in a list > (let's just call it "myList". In every "frame" of my game I need to see if >

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

2017-07-05 Thread Daniel Foerster
Yeah that's not going to work because the attempted imports just fail. If you think having the mouse not initialized might help, change your call to pygame.init() into calls like pygame.display.init(). On Jul 5, 2017 10:33, "Роман Мещеряков" wrote: > > среда, 5 июля 2017 г., 3:39:28 UTC+3 пользо

Re: [pygame] Why does Rect and Surface have copy method when copy exist in std-lib?

2017-06-03 Thread Daniel Foerster
Allow me to point out that there's such a thing as dict.copy(). It's pointless to import a module to call a method that you know is made publicly available already, and just as pointless to make people import. On Jun 3, 2017 16:23, "Victor Blomqvist" wrote: > It seems like such a small performan

Re: [pygame] Pygame doesn't close properly so I can't delete the file it's using

2017-05-27 Thread Daniel Foerster
Try making a call to pygame.quit() when your program exits. On 05/27/2017 02:05 PM, Gameskiller01 wrote: I have a text-to-speech program in Python that I'm currently trying to get to work on every operating system, as before it relied on Windows Media Player. I'm trying to use Pygame to achieve

Re: [pygame] Pygame for SDL 2, and how it may look.

2017-04-19 Thread Daniel Foerster
On 04/19/2017 01:16 AM, Lenard Lindstrom wrote: Now I have experimented with separate Window and Renderer. I found a somewhat acceptable solution to the problems mentioned above. But it still felt clunky. Then, when I combined the window and renderer into on class, much of the complexity wen

Re: [pygame] github terms of service issues

2017-03-27 Thread Daniel Foerster
On Mar 27, 2017 08:41, "Dominik George" wrote: The first issue is children under the age of 13 years not being allowed to register with GitHub. This issue already existed before GitHub updated their ToS, and they claim it is because of COPPA. I do think that they could easily fix this by not req

Re: [pygame] teaching resources

2017-03-18 Thread Daniel Foerster
In particular, "A Newbie Guide to pygame" is woefully outdated. Honestly, it was outdated enough back when I was reading it for the first time in 2011 that I made a version with a bunch of comments correcting its advice. I don't use Pygame much these days, but it'd be great if someone who is would

Re: [pygame] pygamezero moving to github discussion thread

2017-03-17 Thread Daniel Foerster
I'd prefer use of the MIT or Apache 2.0 licenses to the less common zlib, for what it's worth. On Thu, Mar 16, 2017 at 7:52 AM, René Dudfield wrote: > I'm not sure if we should move it right now. I think so. I guess it'd be a > bit of work updating the build tools. But already many of them work

RE: [pygame] PyGame user interface widgets

2017-02-26 Thread Daniel Foerster
nit__ method for instance creation, but all of the widgets use a "make" method. Could the standard method be used instead? * The check box should probably be called CheckBox rather than Checker. Looks like a nice set of functionalities though; is there a way to hook into a custom event

Re: [pygame] Promoting cheeseshop/pypi for game releases?

2017-02-01 Thread Daniel Foerster
It also wouldn't be hard to make a wrapper script that provides a GUI to the pip install process. On Wed, Feb 1, 2017 at 10:17 AM, Thomas Kluyver wrote: > On 1 February 2017 at 06:31, René Dudfield wrote: > >> But now with free CI options... it seems more possible to make a tool >> which builds

Re: [pygame] Python 2.7 with pygame on Mac Sierra (10.12.2)

2016-12-29 Thread Daniel Foerster
I'm thinking you should probably throw a sudo on the front of that (or whatever the Mac equivalent is). On 12/29/2016 04:15 PM, Irv Kalb wrote: On Dec 29, 2016, at 8:42 AM, Thomas Kluyver > wrote: On 28 December 2016 at 23:41, Irv Kalb >

Re: [pygame] New pygame.org website

2016-12-23 Thread Daniel Foerster
<http://pygame.bitbucket.org/docs/pygame/>>> The repository is here: https://bitbucket.org/pygame/pygame.bitbucket.org <https://bitbucket.org/pygame/pygame.bitbucket.org> <https://bitbucket.org/pygame/pygame.bitbucket.org <https://bitbu

Re: [pygame] New pygame.org website

2016-12-22 Thread Daniel Foerster
gt;> like it has the best chance of working. >> >> >> On 12/17/2016 10:51 PM, Lenard Lindstrom wrote: >> >> Bitbucket also has static web site support. I set one up >> for the Pygame docs awhile ago, but have not maintained it: &g

Re: [pygame] BUG: pygame leaks memory (?)

2016-12-20 Thread Daniel Foerster
Use a timer, but just use the builtin clock.tick(), no need to get fancy with events. On Tue, Dec 20, 2016 at 9:07 AM, Martin Kühne wrote: > Use timers so you don't run on 100% CPU: > > TIMER = pygame.NUMEVENT - 1 > pygame.time.set_timer(TIMER, 50) > > def show(self): > # this is a simple fr

Re: [pygame] New pygame.org website

2016-12-17 Thread Daniel Foerster
I'd suggest contacting GitHub to see if there's any way we could get control of that group. On Dec 16, 2016 11:59, "Thomas Kluyver" wrote: Does anyone know who owns the pygame organisation on Github? It's claimed but not in use.

Re: [pygame] New pygame.org website

2016-12-17 Thread Daniel Foerster
As has been noted previously, the game project uploads are a separate issue from the rest of the site. On Dec 17, 2016 23:32, "DiliupG" wrote: > but how will new people upload their games unless they learn how to? > > On Sun, Dec 18, 2016 at 11:00 AM, Daniel Foerster >

Re: [pygame] New pygame.org website

2016-12-17 Thread Daniel Foerster
se. Still kind of like Nikola if I can figure out how to get > started. > > On Dec 17, 2016 11:19 PM, "DiliupG" wrote: > >> not everyone understands how github works. >> >> On Sun, Dec 18, 2016 at 10:46 AM, Daniel Foerster >> wrote: >> >>&

Re: [pygame] New pygame.org website

2016-12-17 Thread Daniel Foerster
On Sun, Dec 18, 2016 at 10:46 AM, Daniel Foerster > wrote: > >> You know, I suppose we could just use GitHub pages. >> >> On Dec 17, 2016 17:32, "Charles Cossé" wrote: >> >> >> >> On Sat, Dec 17, 2016 at 4:12 PM, Daniel Foerster &g

Re: [pygame] New pygame.org website

2016-12-17 Thread Daniel Foerster
You know, I suppose we could just use GitHub pages. On Dec 17, 2016 17:32, "Charles Cossé" wrote: On Sat, Dec 17, 2016 at 4:12 PM, Daniel Foerster wrote: > Using S3/CloudFront is a lot cheaper than the EC2 setup you're imagining > (and which a Django stack would requi

Re: [pygame] New pygame.org website

2016-12-17 Thread Daniel Foerster
fix what is not broken. Let's focus >> on the things that really require work, and let's do that first -- I'm >> sure there is plenty to do already. >> >> On Sat, 17 Dec 2016 17:09:03 -0600 >> Daniel Foerster wrote: >> >> > I think the ea

Re: [pygame] New pygame.org website

2016-12-17 Thread Daniel Foerster
-- I'm sure there is plenty to do already. On Sat, 17 Dec 2016 17:09:03 -0600 Daniel Foerster wrote: I think the easiest way to go will be to generate markdown or ReST files with Sphinx or another tool and use them as input to Nikola. Otherwise we have to include the pygame source in the

Re: [pygame] New pygame.org website

2016-12-17 Thread Daniel Foerster
fix what is not broken. Let's focus on the things that really require work, and let's do that first -- I'm sure there is plenty to do already. On Sat, 17 Dec 2016 17:09:03 -0600 Daniel Foerster wrote: I think the easiest way to go will be to generate markdown or ReST files with Sphin

Re: [pygame] New pygame.org website

2016-12-17 Thread Daniel Foerster
Using S3/CloudFront is a lot cheaper than the EC2 setup you're imagining (and which a Django stack would require). On 12/17/2016 05:11 PM, Charles Cossé wrote: Yikes! who's gonna pay the Amazon bill? On Sat, Dec 17, 2016 at 4:09 PM, Paul Vincent Craven mailto:p...@cravenfamily.com>> wrote:

Re: [pygame] New pygame.org website

2016-12-17 Thread Daniel Foerster
I think the easiest way to go will be to generate markdown or ReST files with Sphinx or another tool and use them as input to Nikola. Otherwise we have to include the pygame source in the website repository, which doesn't seem ideal to me. — Daniel On 12/17/2016 04:54 PM, Paul Vincent Craven

Re: [pygame] New pygame.org website

2016-12-16 Thread Daniel Foerster
> A downside is all pages built with a particular theme share the same > layout. For example, in the Pygame docs the same Jinja2 templates generate > the index page, module reference pages, and tutorial pages. So if you want > a sidebar on one page, you get it on all pages. And I imagine to get aro

Re: [pygame] New pygame.org website

2016-12-15 Thread Daniel Foerster
A Python competitor with Jekyll that I've used and might be found useful is Nikola (https://getnikola.com/). It accepts things like markdown, ReST, HTML, and plaintext as input and has support for a number of templating engines, including Jinja. If we were to go that route, I have access to a prett

Re: [pygame] 1.9.2 release coming soon, last call for patches

2016-08-05 Thread Daniel Foerster
Aren't sprite groups more like sets? That's how I'd explain it. — Daniel On 08/05/2016 11:20 AM, Paul Vincent Craven wrote: One thing I always would have liked is if sprite lists acted like lists. In particular, it has always been annoying to teach students to use 'append' for most lists, but

Re: [pygame] Faster blitting

2016-03-14 Thread Daniel Foerster
Perhaps a function to blit multiple surfaces at once would be more helpful? On 03/14/2016 07:01 PM, Leif Theden wrote: Thanks for the benchmark, but your example is not using the SDL_LowerBlit. I did my own testing at home using SDL_LowerBlit and got similar results, meaning there is little di

Re: [pygame] Pygame site

2016-02-28 Thread Daniel Foerster
I wasn't interested in working with WordPress. On Feb 28, 2016 15:41, "Paul Vincent Craven" wrote: > I haven't done much with pygame.info. There didn't seem like a lot of > people that wanted to contribute to it, and I didn't want it to be a > one-person deal. I already have programarcadegames.co

Re: [pygame] sound files in pygame

2016-01-29 Thread Daniel Foerster
I've never had much success with mp3's in Pygame, ogg's seem to be much better supported across platforms. I'm a little surprised you were ever able to get some of those formats working, I didn't know m4a's were supported at all. On 01/29/2016 08:22 PM, DiliupG wrote: I had similar issues inte

Re: [pygame] Re: sprint this weekend

2015-08-18 Thread Daniel Foerster
Agreed. Note my similar analysis: https://bitbucket.org/pygame/pygame/issues/260/issues-with-hifi-website

Re: [pygame] What's next for Pygame project?

2015-07-13 Thread Daniel Foerster
I'll look at it, but 2009 is still pre-HTML5/CSS3. On 07/13/2015 05:15 PM, Jason Marshall wrote: In 2009, there was a prototype of a redesign of the pygame website. It was written in Python (Django) instead of PHP (SiteSwing). The redesign was not adopted and the people who had worked it lost

Re: [pygame] What's next for Pygame project?

2015-07-13 Thread Daniel Foerster
On 07/12/2015 10:05 AM, Paul Vincent Craven wrote: * I don't think a Pygame website needs to be build on Python. I've got the pygame.info domain and I think a Wordpress site that has several verified contributers would be the way to go. Share the 'love' and eff

Re: [pygame] Problem with pytmx and tiled

2015-07-13 Thread Daniel Foerster
On 07/13/2015 09:01 AM, ck421 wrote: Hello, I am new to these forums and to pygame in general. I have been trying to use pytmx in order to load in a tiled .tmx file but I keep getting this error: File "C:\Python32\lib\site-packages\pytmx\pytmx.py", line 258, in __init__ self.parse_xml(Elem

Re: [pygame] What's next for Pygame project?

2015-07-11 Thread Daniel Foerster
Github is nice but would require migrating from Mercurial. On 07/11/2015 10:15 PM, Peter Shinners wrote: I was hoping to find better hosting on the Bitbucket site for open soure projects, but I could not.

Re: [pygame] What's next for Pygame project?

2015-07-10 Thread Daniel Foerster
On 07/10/2015 09:47 PM, Peter Shinners wrote: I haven't been paying close attention to Pygame, but it doesn't seem controversial to say things have stalled. Not at all, unfortunately. * Getting 1.9.2 actually released At the least we need a stable release so that Python 3 support can land in