Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Queue in Pygame
#2
I would not mix tkinter and pygame in one app. Tkinter has a built in loop while pygame you have to build your loop. The result is the issue you are having along with others. I would just use pygame alone. However you have to build your UI. But there are pre-existing buttons UI modules for pygame. I would also just build my own queue system in pygame.

Here is an example of a game i created a while ago. It creates a playlist of whatever is in the directory. But you can make it limited to a whatever playlist you want. Its just an example.

The Music class:
https://github.com/metulburr/pong/blob/m...ols.py#L43

The music object:
https://github.com/metulburr/pong/blob/m...ols.py#L73

switching to next song when ends
https://github.com/metulburr/pong/blob/m...sic.py#L55

Note: there is no accommodation for looping since i didnt figure anyone would play pong that long, but that can be easily added by repeating the list

As for pygame buttons you can use a pre-existing button module as state before. And some fully fledged GUI toolkits have file browsers if i remember. Or you can make your own.
Recommended Tutorials:
Reply


Messages In This Thread
Queue in Pygame - by constantin01 - Jan-07-2020, 02:45 PM
RE: Queue in Pygame - by metulburr - Jan-07-2020, 04:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  task queue Valon1981 8 3,798 Jul-07-2020, 07:41 AM
Last Post: freeman
  Queue maxsize mr_byte31 2 4,701 Sep-03-2019, 07:02 PM
Last Post: mr_byte31
  Queue.Queue() would not reduce capacity after get() yuan8421 9 11,456 Jan-02-2018, 09:38 PM
Last Post: Windspar
  Threading and Queue nexusfactor 5 4,438 Oct-16-2017, 04:14 PM
Last Post: Larz60+
  Pygame*import pygame ImportError: No module named pygame CASPERHANISCH 1 9,847 Jun-05-2017, 09:50 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020