AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Mplay pygame1/27/2024 I have adapted the example from the comment link to not use the var module. Free software such as Audacity is easily able to convert sound formats. Obviously this is not a solution if you want to write an MP3 music player, but for a game it's a minor a requirement. However, it's absolutely possible to convert your sound-files to OGG sound format - which is compressed much the same as MP3, or the uncompressed WAV format. They can be played singularly with the set of functions. It's not possible to play multiple MP3 sound files simultaneously using channels with PyGame. I'm gonna chalk this up as the problem for now, i'll have to test it with a better keyboard.Just so there's a formal answer to this question. Upon further testing I discovered that my keyboard has trouble reading multiple inputs at the same time, so its ghosting. I also chose not to use the sprite class to try and get a better understanding of this stuff myself. I'm fully aware that I didn't follow many coding standards as this is something I started without much knowledge, and have continually built on it. I'll post my code if anyone wants to take a look. It rather feels like the controls are interfering with each other. My only hunch right now is that inefficient code is causing the delay, but I'm not quite sure. Player two seems to be delayed more than player one Otherwise the two players can move in the x direction just fine unresponsiveness only seems to occur when a jump is called. One player can move around by themselves just fine. Only occurs when both players are moving. I'm not exactly sure what is causing the error, so its difficult to bug test, Here are some things I've noticed: Recently I've run into a problem where the controls seem to be delayed/unresponsiveness. I mapped player 1 to the asdw and player two to the arrow keys. I'm new to pygame (and game development in general) but have been building a simple two player game where two rectangles can move around the screen on some platforms. It is easier to install python32 and pygame32 even if you are running a 64-bit version of Microsoft Windows. Installation notes for Microsoft Windows users Failure to do so may result in post removal. When posting links please provide a brief description in the comments of the thread. For code that relies on external resources like images please create a repo on github or similar. If you have a large amount of code to share it would be best use a third party site for posting code. You can also place small amounts of code inline by surrounding it with ticks: `like this` You can indent the code in a text editor before pasting, or after pasting into reddit, highlight the text and press the editor button that looks like this. When posting code every line must be indented an additional four spaces. In Python indentation is part of the language syntax and as such is extremely important. Consider making a Github account if you don't have one already. If asking for help with your code, please provide a link to the entire code and resources if possible. Posting GuidelinesÄespite the name, content related to other Python game libraries (pyglet, panda3d, etc.) is also welcome. Pygame is highly portable and runs on nearly every platform and operating system. This allows you to create fully featured games and multimedia programs in the python language. Pygame adds functionality on top of the excellent SDL library. Pygame is a set of Python modules designed for writing games.
0 Comments
Read More
Leave a Reply. |