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

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: