Pages

Se afișează postările cu eticheta news. Afișați toate postările
Se afișează postările cu eticheta news. Afișați toate postările

duminică, 5 iulie 2026

PyGame : Real Situation in 2026 for Pygame and Pygame-CE.

Today 05072026, about these two python modules: pygame and pygame-ce, with my blogger chart all time :
pygame pygame-ce chart
Pygame (original)
As of 2026, the original Pygame project remains in a state of minimal maintenance. The last meaningful release was the Pygame 2.5.x series in 2023. After that point, development slowed significantly, and the updates released in 2024, 2025, and 2026 consist only of minor fixes and compatibility patches. These include micro-fixes for stability, adjustments for Python 3.12 and Python 3.13, and small SDL2-related patches. No new features have been introduced, no major optimizations have been added, and the API has not evolved. There is no Pygame 2.6 release, no new rendering improvements, and no integration of major SDL2 upgrades. In practical terms, Pygame is maintained only enough to remain functional on modern Python versions, but it is no longer actively expanded or modernized.
Pygame-CE (Community Edition)
Pygame-CE, the community-driven fork of Pygame, showed strong activity during 2023 and early 2024. The last significant release was Pygame-CE 2.5.1 in 2024. After that, development slowed dramatically. In 2025 and 2026, the project received only small fixes, minor corrections, and maintenance-level updates. There is no Pygame-CE 2.6 release, no new features, no rendering improvements, and no integration of newer SDL2 capabilities. The project effectively entered a low-activity phase, similar to the original Pygame. While Pygame-CE once aimed to modernize the ecosystem, by 2026 it has nearly stopped progressing, with no major roadmap or new technical direction.
Summary
By 2026, both Pygame and Pygame-CE have reached a point where they are stable but stagnant. They continue to function, but they do not evolve. Developers who require modern rendering, GPU acceleration, advanced features, or active development have largely moved to other libraries and engines. The Python game development ecosystem has shifted toward more modern solutions, while Pygame and Pygame-CE remain legacy tools suitable mainly for education, simple prototypes, or nostalgic projects.

luni, 20 aprilie 2026

Python-CE : simulation continuous collision with PyQtGraph python module.

This test runs a pygame‑ce simulation inside a separate thread while a PyQt6 window displays a real‑time performance chart. The pygame engine creates multiple moving sprites, updates their positions every frame, and performs continuous collision detection between all sprites. During each frame, the engine measures the current FPS (frames per second) and counts how many sprite‑to‑sprite collisions occurred.
The PyQt6 interface collects these values and plots them live using PyQtGraph. The yellow curve represents the FPS over time, showing how well the pygame‑ce engine performs under load, while the red curve shows the number of collisions detected each frame. Together, the two curves let you visually evaluate both rendering performance and collision‑handling complexity as the simulation runs.
The source code is created with copilot artificial intelligence, tested and works very well.
import sys
import time
import threading
import pygame
from pygame.sprite import Sprite, Group

from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout
from PyQt6.QtCore import QTimer
import pyqtgraph as pg

# -------------------------------
# SPRITE PYGAME
# -------------------------------
class TestSprite(Sprite):
    def __init__(self, x, y):
        super().__init__()
        self.image = pygame.Surface((30, 30))
        self.image.fill((255, 255, 0))
        self.rect = self.image.get_rect(topleft=(x, y))
        self.vx = 3
        self.vy = 3

    def update(self):
        self.rect.x += self.vx
        self.rect.y += self.vy

        if self.rect.left < 0 or self.rect.right > 800:
            self.vx *= -1
        if self.rect.top < 0 or self.rect.bottom > 600:
            self.vy *= -1


# -------------------------------
# THREAD PYGAME
# -------------------------------
class PygameThread(threading.Thread):
    def __init__(self):
        super().__init__()
        self.running = True
        self.fps_value = 0
        self.collision_count = 0

    def run(self):
        pygame.init()
        screen = pygame.display.set_mode((800, 600))
        clock = pygame.time.Clock()

        sprites = Group()
        for i in range(50):
            sprites.add(TestSprite(i * 15, i * 10))

        while self.running:
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    self.running = False

            sprites.update()

            # collision detection
            collisions = pygame.sprite.groupcollide(sprites, sprites, False, False)
            self.collision_count = sum(len(v) for v in collisions.values())

            screen.fill((0, 0, 0))
            sprites.draw(screen)
            pygame.display.flip()

            self.fps_value = clock.get_fps()
            clock.tick(0)

        pygame.quit()


# -------------------------------
# PYQT6 UI + CHART
# -------------------------------
class FPSWindow(QWidget):
    def __init__(self, pg_thread):
        super().__init__()
        self.pg_thread = pg_thread

        self.setWindowTitle("PyQt6 + pygame-ce FPS Chart + Collision Test")
        layout = QVBoxLayout(self)

        self.plot = pg.PlotWidget()
        self.plot.setYRange(0, 200)
        self.plot.showGrid(x=True, y=True)
        layout.addWidget(self.plot)

        self.data_fps = []
        self.data_collisions = []
        self.curve_fps = self.plot.plot(pen='y')
        self.curve_col = self.plot.plot(pen='r')

        self.timer = QTimer()
        self.timer.timeout.connect(self.update_chart)
        self.timer.start(50)

    def update_chart(self):
        self.data_fps.append(self.pg_thread.fps_value)
        self.data_collisions.append(self.pg_thread.collision_count)

        if len(self.data_fps) > 300:
            self.data_fps.pop(0)
            self.data_collisions.pop(0)

        self.curve_fps.setData(self.data_fps)
        self.curve_col.setData(self.data_collisions)


# -------------------------------
# MAIN
# -------------------------------
if __name__ == "__main__":
    pg_thread = PygameThread()
    pg_thread.start()

    app = QApplication(sys.argv)
    win = FPSWindow(pg_thread)
    win.resize(900, 500)
    win.show()

    app.exec()

    pg_thread.running = False
    pg_thread.join()

joi, 22 ianuarie 2026

News : What is the difference between pygame and pygame-ce?

Python game development often begins with the popular pygame library. However, in recent years, a new alternative has emerged: pygame-ce (Community Edition). While both libraries share the same foundation, they differ significantly in development pace, features, and long-term vision.
  • pygame: The original library created in the early 2000s, widely used for 2D games.
  • pygame-ce: A community-driven fork created to modernize pygame and accelerate development.
  • pygame: Updates are infrequent and focus on stability rather than innovation.
  • pygame-ce: Receives frequent updates, bug fixes, and new features contributed by an active community.
  • Better performance: pygame-ce includes optimizations for rendering and event handling.
  • Improved math module: Enhanced Vector2 and Vector3 classes with additional methods.
  • Better timing and framerate control: More accurate clock behavior on modern systems.
  • Extended API: New helper functions and quality-of-life improvements not found in pygame.
  • pygame: May encounter issues on newer platforms such as macOS ARM (M1/M2).
  • pygame-ce: Designed to work smoothly on modern hardware, including ARM-based systems.
  • Better Windows support: pygame-ce fixes several long-standing Windows-specific bugs.
  • High compatibility: Most pygame projects run on pygame-ce without modification.
  • Backward-friendly: pygame-ce maintains the original API while adding optional improvements.
  • Future-proofing: pygame-ce is more likely to support new Python versions quickly.
  • Install pygame: pip install pygame
  • Install pygame-ce: pip install pygame-ce
  • pygame: Stable but slow-moving, with fewer contributors.
  • pygame-ce: Active community, open to new ideas, and focused on modernizing the ecosystem.
  • Future direction: pygame-ce aims to become the standard for new Python game projects.
  • Choose pygame-ce if you want modern features, better performance, and active development.
  • Choose pygame if you maintain older projects or prefer the original library.

marți, 23 septembrie 2025

News : ... new pygame version 2.6.0 .

... seams pygame team development works and released a new version, see the GitHub project.

luni, 10 iulie 2023

News : About my work and one of my websites.

I would like to bring to the attention of those who follow my activity on my websites and appreciate the inability to continue with one of the websites: free-tutorials.org. It is currently hosted on a free host, but I cannot import it 100%, which has led me not to complete it with new posts. The continuation of the activities there, considering the limited time, will be carried out on my blogs with the defined theme with which I started: Linux - Fedora, Graphics, Python, Pygame.
In the meantime, because the host is expensive and until now someone has helped me to host it on his server, it is possible to sell the domain: free-tutorials.org - I receive purchase offers at my personal Yahoo email address catafest@yahoo.com.
Minimum starting price 250 euros, because the domain is old from 2018.

joi, 22 decembrie 2022

News : pygame-menu version 4.3.2.

This python package let you to use a menu for pygame.
You can find it on this webpage and documentation on this webpage.
This is simple to use it:
You can install easy like any python package using the pip3 python tool:
pip3 install pygame-menu==4.3.2 --user
I created a python file named pygame-menu_001.py and I add this simple example to test it:
import pygame
import pygame_menu
from pygame_menu import Theme
pygame.init()
surface = pygame.display.set_mode((640, 480))

def set_difficulty(value, difficulty):
    # Do the job here !
    pass

def start_the_game():
    # Do the job here !
    pass

mytheme = pygame_menu.themes.THEME_BLUE.copy()
mytheme.title_background_color=(0, 19, 76)
mytheme = Theme(widget_font=pygame_menu.font.FONT_FRANCHISE)

menu = pygame_menu.Menu('Main menu', 400, 300,
                       theme=mytheme)

menu.add.text_input('User :', default='catafest')
menu.add.selector('Difficulty :', [('Hard', 1), ('Easy', 2)], onchange=set_difficulty)
menu.add.button('Play', start_the_game)
menu.add.button('Quit', pygame_menu.events.EXIT)

menu.mainloop(surface)
This is the result of the running script:

duminică, 9 ianuarie 2022

PyGame : Pygame New Years Jams 2022.

I haven't written about this python package in a long time because I was busy with other solutions of everyday life, but here it should continue with new elements this year ...
If you want to create a simple game, make some graphics or learn very quickly the basics of programming, then I recommend python with pygame.
First of all, the syntax of the programming language is simple and allows you to focus on the programming side, and the implementation of the graphics is just as simple.
It seems that there are users and tendencies to bring to our attention the possibilities of this python package.
Since December 26, the well-known website itch.io come with Pygame New Years Jam.
All submissions was open from December 26th 2021 at 11:00 AM to January 2nd 2022 at 11:00 AM
I did not know this fact but you can find examples to download and test.
For this jam the submission is closed and voting is now in progress.
NOW same website comes with another Winter 2022.
You can find the rules on this webpage.
You may use any game engine to make your game and build for any platform you like, including mobile. For mobile, only APKs can be distributed on itch.io.
You can see more at this web page.

joi, 1 august 2019

PyGame : First interface - part 11.

This is python module named pygameMenu can help us to develop another step into the interface issue. This python module is simple, lightweight and easy to use and the last release from a day ago comes with the version is 2.0.1. The install step is easy with the pip tool:
pip install pygame-menu==2.0.1
Collecting pygame-menu==2.0.1
...
      Successfully uninstalled pygame-menu-1.96.1
Successfully installed pygame-menu-2.0.1 pyperclip-1.7.0
This python module are supported by currently python 2.7+ and 3.4+ (3.4, 3.5, 3.6, 3.7). You need to have the pygame python module install it on your operating system. If not you will get this error then reinstall the pygame with pip3 tool:
...
    from pygame.base import *
ModuleNotFoundError: No module named 'pygame.base'
You cam find more here. Let's see one simple example:
import sys
import pygame
import pygameMenu
from random import randint
from random import randrange
from pygame.locals import *
from pygameMenu.locals import*
#  create the menu 
class GameMenu():
    # this will used on click's 
    def test(self):
        print('test')
    # this will create the menu with some features
    def my_menu_game(self):
        self.my_menu_game = pygameMenu.Menu(get_display,
                                   font=pygameMenu.font.FONT_BEBAS,
                                   dopause=False,
                                   menu_color=(0, 10, 176),  # Background color
                                   menu_color_title=(0, 76, 76),
                                   menu_height= 240,
                                   menu_width=320,
                                   onclose=pygameMenu.events.DISABLE_CLOSE,
                                   option_shadow=True,
                                   option_shadow_position=pygameMenu.locals.POSITION_SOUTHEAST,

                                   title='Help',
                                   window_height=480,
                                   window_width=640
                                        )
        # add some items on menu 
        self.my_menu_game.add_option('Test!', self.test)
        self.my_menu_game.add_selector('Select', [('eazy', 'EASY'),
                                                     ('medium', 'MEDIUM'),
                                                     ('hard', 'HARD')],
                                onreturn = False,
                                onchange = self.test)
        self.my_menu_game.add_option('Exit', self.test)



        # Loop the game and get menu events
        while True:
            # clock count
            clock.tick(60)
            # events for menu 
            events = pygame.event.get()
            for event in events:
                if event.type == QUIT:
                    pygame.quit()
                    sys.exit()

            # create menu
            self.my_menu_game.mainloop(events)

            # the flip display function 
            pygame.display.flip()


# init the pygame 
pygame.init()

# default pygame init
get_display=pygame.display.set_mode((640,480))
pygame.display.set_caption("My Menu")
clock = pygame.time.Clock()

# create the menu
game_menu = GameMenu()
game_menu.my_menu_game() 
The result of this source code can be see into the next screenshot: