#game-development

1 messages · Page 2 of 1

spring flame
#

what is the best library for making python games to use in an asynchronous context?

edgy arch
#

Hi, did someone saw my question? Don't you love mathematics :P

vagrant saddle
potent ice
#

wasabi2b is especially made for that

tranquil girder
#

I wonder if I can turn this into a game mechanic somehow

dawn quiver
#

how do i add a timer to my game but its not like a for loop where it ticks down and the text keeps moving down, i just want it ticking down in 1 spot

spring flame
cerulean citrus
#

the problem was that i did not use shaders ☹️

polar birch
#

can u help me, i made a game with pygame and my player can be controled with the d,a for the x movement jeys, but when i multyplie both of the movement speeds with delta time, the left side goes slower then the right side

zenith pendant
polar birch
#

i can but the files are kinda big for discord

zenith pendant
#

Just copy the movement part over

polar birch
#

ok

#

and just saying the variables dx,dy are for TileBased collision detection so when i say dx += or -= then i mean move player

#

if keys[pygame.K_SPACE] or keys[pygame.K_w]:
self.velocity.y = -7 * dt

    if keys[pygame.K_d]:
        dx -= 10 * dt

    if keys[pygame.K_a]:
        dx += 10 * dt
#

and when i multiplie the acceleration the gravity goes upsidedown

#

if u want ill send the play's code

#

*player's code

#

nvm the right side is slower

zenith pendant
#

Does this also happen if you leave dt out ?

polar birch
#

it works fine

#

and i multiplie the dt without clock.tick but without dt i use clock.tick(FPS) FPS = 60

#

and the wierder thing that when i hold both of the keys the player stops

#

but it should go left(because right side is faster somehow)

#

i use dt like that: last_dt = time.time() dt = time.time() - last_dt

#

and i put it in the while loop

#

and i multyplied the dt by 60, i tried it without multiplying and i increesed the move values and its stillt he same

#

(i multiplie the dt by FPS)

#

ill send the player's code:

#

PGbuiltins is my library and its fine with the (vector2s at least)

#

i pep8 it with black

#

no tiles are in the list sp the collision detection isnt the problam

#

so*

zenith pendant
#

And without dt it works?
Because looking at it i couldnt find anything that would make it behave like this

polar birch
#

wdym

#

if u want i can send you my main code with the dt

#

i still didnt load a level

zenith pendant
#

The error would be in here im pretty sure, but i couldnt find anything from looking over it

polar birch
#

ok then ty for helping

#

im just cleaning he code to not create super long chat....

#

if you want i can send the code again

#

the*

zenith pendant
#

Maybe you just set some "(" wrong or something small like this

polar birch
#

oh and i cant send my PGbuiltins code because its 878 line of code and discord dont alow it

#

if you want i can call u and show u how to game is working with share screen

#

nvm ill just send a screenshot

#

im stuck on its development because of this stupid thing

#

nvm ill just leave it 😦

#

bye have a nice day

cursive glacier
#

Hello! Can someone help me installing pygame in Anaconda. I’m using this command in the terminal window:

conda install -c cogsci pygame

But doesn’t work
Btw, I’m using macOS

old axle
#

what do you guys think? ^^^^^^^^^

hollow inlet
#

is there a formular that can be used to make a snake...
i need a chain of entites, that follow each other.

edgy arch
#

Hello, I need some help. Regarding the code:

mouse_x = -pygame.mouse.get_pos()[0]
#Player control takes (move x, move y, the x position of the mouse cursor)
player.control(0,0,mouse_x)
keys = pygame.key.get_pressed()
if keys[pygame.K_w]:
    player.control(2*math.cos(mouse_x), 2*math.sin(mouse_x), mouse_x)

When controlling the actual sprite wabbles and it does not go in the same direction in which I rotate it. Is anything strange in the code? I would like to use math formulas. (Not actual vectors in Pygame).

#

Thanks.

unreal shale
knotty granite
#

!resources

frank fieldBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

ancient jetty
#

hello, can someone help me with my game? im stuck.....

tranquil girder
#

Help with what?

unique rapids
#

Using the Ursina framework

dawn quiver
#

does anybody have a brick breaker file that they can send me?

#

for unity 3d

potent ice
old axle
dawn quiver
old axle
# dawn quiver YOOOO nice!!!!!

this is the code for it: ```py
if self.directions[0] in (RIGHT, LEFT):
leftright_square_label.draw(self.pos[0][0], self.pos[0][1], self.surface)

    if self.directions[0] in (UP, DOWN): 
        updown_square_label.draw(self.pos[0][0], self.pos[0][1], self.surface)

    for p, direction in zip(self.pos[::-1], self.directions[::-1]):

        try:
            if direction in (RIGHT, LEFT) and direction == predirection:
                leftright_square_label.draw(p[0], p[1], self.surface)
            
            if direction in (UP, DOWN) and direction == predirection:
                updown_square_label.draw(p[0], p[1], self.surface)
            
            if direction == UP and predirection == LEFT or direction == RIGHT and predirection == DOWN:
                bottem_left_square_label.draw(p[0], p[1], self.surface)
            
            if direction == UP and predirection == RIGHT or direction == LEFT and predirection == DOWN:
                bottem_right_square_label.draw(p[0], p[1], self.surface)
            
            if direction == DOWN and predirection == LEFT or direction == RIGHT and predirection == UP:
                top_left_square_label.draw(p[0], p[1], self.surface)
            
            if direction == DOWN and predirection == RIGHT or direction == LEFT and predirection == UP:
                top_right_square_label.draw(p[0], p[1], self.surface)
            
        except UnboundLocalError:
            if direction in (RIGHT, LEFT): 
                leftright_square_label.draw(p[0], p[1], self.surface)   
                
            if direction in (UP, DOWN): 
                updown_square_label.draw(p[0], p[1], self.surface)

        predirection = direction
dawn quiver
old axle
dawn quiver
#

Awesome :D

golden basalt
#

i want to create a board game

#

particularly like chess

#

it's chushogi (12x12) variant of shogi (Japanese chess)

dawn quiver
#

nice

#

sounds like an interesting project for sure

golden basalt
#

any suggestions for libs, frameworks that can make board-game-making easy

dawn quiver
#

hmm, im not aware of any specific for board games, but pygame offers some utilities that should suffice
tons of chess games have been made using it(not too sure about shogi though)

golden basalt
#

chushogi is probably planned to come on https://lishogi.org/ along with other variants
though it for sure will be a fun game to create a program for

dawn quiver
#

these aren't board games, but i think this shows that it provides enough to be able to render chess/shogi

#

the core logic/engine itself would be separate from the graphics lib you use though!

#

Someone who was making a chess game using pygame recently:

dawn quiver
#

I've seen shogi being mentioned in some shows, but I don't know anything more than that haha

#

Might give it a try some day

golden basalt
dawn quiver
#

coincidentally, im working on a board game too, implementing it in Rust though

waxen hawk
#

hello

#

im new here

#

and will love to know more about python and pygame

ancient jetty
#

Hmmm, since you ask It in #game-development i think you might want to make games, how far are you at python?

#

Because i suggest learning the basics and maybe make like a mini rock paper scissors game, or geuss the number rir smth

versed cedar
#

Hello, sorry for interrupting, I am currently trying to create an mp3 player using the kivy framework.
What is bothering me is how can I create an if condition that detects which audio is playing so it can pause it and play it again? I searched on internet but didn't find what interested me. Here is the code:

#
import kivy
from kivy.core.audio import SoundLoader
from kivy.uix.floatlayout import FloatLayout

kivy.require('2.0.0') # replace with your current kivy version !
from kivy.uix.button import Button
from kivy.config import Config
import subprocess


from kivy.app import App
from kivy.uix.label import Label

global button
global button0
button = Button(text='',  size_hint=(.20,.12), pos =(325, 275),background_normal = 'playbutton.png')
button0 = Button(text='',  size_hint=(.20,.12), pos =(150, 275),background_normal = 'pause.png')
global button1
button1 = Button(text='',  size_hint=(.10,.12), pos =(70, 275),background_normal = 'back.png')
global button2
button2 = Button(text='',  size_hint=(.10,.12), pos =(500, 275),background_normal = 'forward.png')
global buttonrandom
buttonrandom = Button(text='OPEN',  size_hint=(.10,.12), pos =(0, 27))
global layout
Config.set('graphics', 'resizable', True)
global sound
sound = SoundLoader.load(filename='C:\\Users\\myusername\\Desktop\\K-391 - Drop it (Original Mix).mp3')
global sound0
sound0 = SoundLoader.load(filename='C:\\Users\\myusername\\Desktop\\Electro House 2012 By K-391.mp3')

class MyApp(App):

    def build(self):
        layout = FloatLayout()

        button = Button(text='|>', size_hint=(.20,.12), pos =(325, 275))
        button0 = Button(text='||', size_hint=(.20, .12), pos=(150, 275))
        button1 = Button(text='<', size_hint=(.10, .12), pos=(70, 275))
        button2 = Button(text='>', size_hint=(.10, .12), pos=(500, 275))
        buttonrandom = Button(text='OPEN', size_hint=(.10, .12), pos=(0, 27))
#
 layout.add_widget(button)
        layout.add_widget(button0)
        layout.add_widget(button1)
        layout.add_widget(button2)
        layout.add_widget(buttonrandom)
        button.bind(on_press=self.press)
        button0.bind(on_press=self.stop)
        button2.bind(on_press=self.forwar)
        button1.bind(on_press=self.back)
        return layout

    def press(self,event):
        #sound = SoundLoader.load(filename='C:\\Users\\myusername\\Desktop\\K-391 - Drop it (Original Mix).mp3')
        if sound0 == None:
           sound0.play()
        if sound == None:
            sound.play()
    def stop(self,event):
        #sound = SoundLoader.load(filename="C:\\Users\\myusername\\Desktop\\K-391 - Drop it (Original Mix).mp3")
        sound.stop()
        sound0.stop()
    def forwar(self,event):
        sound.stop()
        sound0.play()
    def back(self,event):
        sound0.stop()
        sound.play()




if __name__ == '__main__':
    MyApp().run()
#

Here are screenshots:

#

When I click the ">", audio1 is playing, next thing I want is that when I click "||" button or "|>" to pause or play audio1. The same is for "<", but the audio2 is playing, I want only to play or pause audio2. I searched everywhere on the internet for that solution, but it didn't help. Could you please be kind to help if you want? In advance, thank you very much.

rancid depot
#

Please help

shell scroll
potent ice
#

Are we a godot channel now? I guess the assets can be used for other projects, so I guess it's fine.

#

The assets seems to be made in Aesprite

desert bobcat
hollow inlet
desert bobcat
#

The blank space is 0

#

So the next step for the snake I made above is this

#

0123456789👄

#

The snake just moved to the right and every number place is now down 1

hollow inlet
#

The fear I have is that either it becomes in some way a blob of objects or the snake separates itself due to speed.
It's ok if it sometimes gets bundled up, but I am trying to accomplish a snake with a tail that is visible at least most of the time.

#

The snake will also constantly move with a 2d velocity.

#

I think I better ask some math nerds.

gentle falcon
#

Can anyone here tell me how can I publish my pygame game? Is there any website that can allow me to publish my game for free?

crisp arrow
#

hi, i'm making pong with python but it's weird

lethal girder
#

guys can someone tell me which book teach create games with python

crisp arrow
#

When i run it, the left paddle will go up with me just pressing and holding the key but with the arrow keys, if i just press and hold then it doesn't do continuously continue going in whichever direction it's going in

lethal girder
#

i will try this books

crisp arrow
# lethal girder i will try this books

honestly, i would say look at some online tutorials to get started with pygame and then just try and build stuff yourself to familiarize yourself with it. This is just how i would learn

lethal girder
crisp arrow
lethal girder
lethal girder
#

just send me i message and i'll help you

crisp arrow
#

thx for that

#

tbh i'm interested in web dev too

crisp arrow
snow hill
#

this is, no matter what :

shell scroll
#

not specifically haha

#

thats rad!

vagrant saddle
granite snow
#

Can you use separating axis theorem using both left and right normals?

quick bramble
#

Can someone send me a course about pygame?

small maple
# quick bramble Can someone send me a course about pygame?
#

hopefully its english

clever ice
#

anyone know a keyboard detecting module that replit knows

#

like something I can import to detect button presses

gentle falcon
# proper peak try `itch.io`

Also do you know of any website where I can just upload my pygame code and then can share the link to any person who can run it and see how my game works!

proper peak
#

Uhh, just upload it on dropbox or something, I guess?

dawn quiver
#

That is entirely possible now thanks to @vagrant saddle

echo kite
clever ice
echo kite
gentle falcon
vagrant saddle
zinc depot
#

can anyone help me with pip?

#

i cant install it

#

it says "Python"

#

and doesnt work

celest breach
zinc depot
#

yup

celest breach
#

I think you have to get it manualy from pip.com

tranquil girder
#

no...

#

there's option to install it when you install python

#

you can also run python -m ensurepip --upgrade

celest breach
torn jackal
#

hi, i am making a game but i would like the window be in FULSCREEN. The problem is, not everyone have the same screensize. How could i do for manage to adapt my game at every screens ? mention if u can help me, thanks 🙂

celest breach
torn jackal
celest breach
old axle
#

which death looks better?

#

this one^^^

#

or this one^^^

tranquil girder
old axle
#

actully a super interesting and informative video

tame patio
#

Hey 👋, I am making a game in arcade and completed a level. I wanted to know would it be better using views for each levels or should I just use methods in a single view

crimson onyx
#

how can I start game development?

vagrant saddle
crimson onyx
celest breach
# crimson onyx Ight thx

pygame is good for starters but i don't thinK you can get super creative with it, like making 3d things is impossibly hard, so if you are just starting coding yes, pygame is a very good choice, but if you like to be coding games professionally i suggest maybe use pygame to learn the simple things and than code on things like: C# or C++

crimson onyx
celest breach
#

no problem

keen phoenix
#

I don't know if this is a good server to ask this question but I haven't found any other discord server to ask it in

Hello smart people! So I am interested in FreePIE as I it is very helpful for some things and I don't know if it has support for Riftcat VRidge, does anybody know any plugins that can achieve that? Thanks!

#

I need to use it to read the orientation of the virtual headset for proper positional tracking

winter mist
#

do anyone know how to add a displayname on top of a rectangle in python with pygame?

#
def draw(self, win):
        pygame.draw.rect(win, self.color, self.rect)
        font = pygame.font.Font('freesansbold.ttf', 15)
        DisplayNameText=font.render(str(os.environ['COMPUTERNAME']), 1, white)
        text_rect = DisplayNameText.get_rect(bottom = self.rect.top)
        win.blit(DisplayNameText, text_rect)

this is from my player class there im creating the player object, i tried to make a code that would add a displayname but it would not work.

random cave
#

Having some issues with the snake game. It dowsn't run.

#

properly

noble socket
#

why does pygame need a rectangle object to draw a rectangle but not the same for lines and circles

potent ice
random cave
potent ice
#

There's no errors happening here. The program just closes.

#

Usually, a lack of turtle. mainloop() , or one of its variants, will cause the window to close because the program will exit, closing everything. turtle. mainloop() should be the last statement executed in a turtle graphics program

random cave
#

Thanks. It worked.

potent ice
#

Working with a window can be a bit confusing. Usually you need to enter an event loop by calling some function to keep the window open or the program exist immediatly

#

What you did before was drawing something and then close the window because the program was done.

#

I think done() and mainloop() are the same

#

@random cave just making sure you saw this

spark river
#

hello guys, I am a beginner in this field. I want to make a video game like Yu gi oh, with a hub where everybody could create a game and invite his friend to play against. I have no problem making the front, but I am stuck into making the backend, does anybody have some ressources to learn how to make a backend for a game?

#

it can be outside python, just the theory would be enough

#

thanks in advance

potent ice
#

The server would store and know the players "items" and the players state

#

Actions will sent to the server by the player and the server responds. You need to make sure that the player are in the right state before you accept the actions. (spoofing actions when you are not allowed to do them is not an uncommon issue in online games)

#

Like in a card game you suddenly play a card you don't really have.

#

or you spawn items on yourself.

spark river
#

oh I see

spark river
#

can you give me some links to learn?

vagrant saddle
#

probably if you use pygame you can even run everything inside browser

spark river
#

oh okay

#

thank you so much

zenith sandal
#

I am using ursina engine if that helps at all, but for a while i've been trying to fix this issue with 360 movement using lerping that causes it to totally readjust and turn the opposite direction to turn again. it turns correctly, but once getting to 270 degrees it just goes all the way around to the other side and not using the shorter route.


        input_vector = Vec2(
            (held_keys['d'] - held_keys['a']) or held_keys['gamepad left stick x'], (held_keys['w'] - held_keys['s'] or held_keys['gamepad left stick x']))
        self.angle = atan2(input_vector.x, input_vector.y)
        direction = Vec2(sin(self.angle), cos(self.angle))

        if input_vector != 0:
            self.position += direction * time.dt * pSpeed

        self.angle = atan2(input_vector.x, input_vector.y)
        self.rotation_z = lerp(self.rotation_z, degrees(self.angle) if degrees(
            self.angle) < 270 else (degrees(self.angle) == 360), 0.2)
#

That is my rotation and input for movement and rotation

#
self.rotation_z = lerp(self.rotation_z, degrees(self.angle) if degrees(
            self.angle) < 270 else (degrees(self.angle) == 360), 0.2)

Here is the issue part. I have no clue why its using the longer path instead of the shorter path, nor how to make it use the shorter path.

tranquil girder
zenith sandal
light sluice
#

Does anyone know how I can make a non linear terrain in something like arcade?

#

So far all the levels I have made are using sprites for the terrain, which makes me wonder if the only way to go about it is to make your own sprites and terrain

light sluice
boreal oriole
#

Hi all, i'm looking for a lib that can set xinput values for buttons and axises on a controller. I've found a few xinput libs out there, but they all see to be xinput readers for overlays or for reading values. Anyone familiar with a way to control/alter the xinput outputs?

carmine valve
#

is there a way to convert pygame into exe and prevent anyone from stealing the code? 💀

dawn quiver
#

If you don't want people to "steal"/see your code, don't publish it online

carmine valve
#

😔

cobalt narwhal
#

can anyone help me with a project

#

i am working on to create new levels

#

ping me or dm me

vagrant saddle
#

but if you can avoid curses you'll have web compatibility

#

with pyscript(pyodide) or pygame-script(cpython)

mental sinew
#

hey guys

dawn quiver
#

I want to start with pygame, is it the best choice ?

silk hinge
#

How do I render SVGs in pygame? Do I need to write a shader or something?

vagrant saddle
vagrant saddle
silk hinge
vagrant saddle
#

no it does it for you

#

SDL2 has nanosvg renderer incorporated

silk hinge
#

so where do I find this functionality?

vagrant saddle
#

you need to test the build for it

#

i don't remember which version introduced it exactly

#

i think it was with SDL2_image 2.5+

silk hinge
#

so the build that supports svg has not been properly released

vagrant saddle
#

ymmv

dawn quiver
vagrant saddle
#

tbh the one you will like more and feel comfy with

#

a tool must not hurt you

silk hinge
#

where can I look to find out how to install this new build

vagrant saddle
#

let me see

dawn quiver
#

pip install pygame

#

Here's me loading and rendering an svg

#

using Pygame 2.1.2 (latest stable pypi release)

#
import pygame 

pygame.init()
screen = pygame.display.set_mode((500, 500))

img = pygame.image.load("xmas.svg")

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            raise SystemExit

    screen.fill("black")
    screen.blit(img, (0, 0))

    pygame.display.flip()


As pmp-p mentioned, you just load it like any other image

silk hinge
#

that's convenient

silk hinge
#

I don't see anything about SVG

vagrant saddle
#

because it's internal to SDL2

#

ask on pygame discord some folks may know exactly when SDL2 image was upgraded

#

i only know that wasm build always has it

dawn quiver
#

It mentions that it is supported here

silk hinge
#

ahh ok

vagrant saddle
#

ho i did not test pnm

dawn quiver
#

i didnt even know it supported pnm haha

silk hinge
#

what is pnm

vagrant saddle
#

pnm is a text format image that's great for web because you can download it from anywhere synchronously

#

binary files are all problematic on web

silk hinge
#

ah cool

#

though why are binaries problematic on the web?

vagrant saddle
#

browser restrictions so dev does not block pages while getting megabytes of data

#

imagine a dev working on optic fiber link , and end user is on 3G

silk hinge
#

but how does text even fix that

#

isn't ascii text basically just bytes

vagrant saddle
#

haha maybe but webserver tell browsers what files really are in headers ( content-type: )

vagrant saddle
silk hinge
#

ahh so the web browser automatically splits apart binary files that are being transferred but not with text files?

vagrant saddle
#

more like it forbids you to download binary files without special flags and servers all allowing your client and domain to do it

silk hinge
#

are you an expert in security?

vagrant saddle
#

nope but i hit those restrictions when running pygame on web

silk hinge
#

oh wow

silk hinge
#

Why is the SVG image that I blit on to the window blurry?

#
import pygame 

pygame.init()
screen = pygame.display.set_mode((500, 500))

img = pygame.image.load("example.svg")
width, height = img.get_size()

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            raise SystemExit

    screen.fill("black")
    screen.blit(pygame.transform.scale(img, (width*2, height*2)), (0, 0))

    pygame.display.flip()
#

@dawn quiver

dawn quiver
#

well you scale it to a higher resolution than it is

#

when it becomes a surface, what image format it was before is irrelevant

#

if you are using svgs for the scalability, you might want to scale the original image itself and then use that

dawn quiver
#

idk, id assume you are familiar with editing svgs

silk hinge
#

oh you mean the metadata describing the size

dawn quiver
#

yeah probably

silk hinge
#

@dawn quiver so I have to open the file, edit the meta tags programmatically, close it, load the image into pygame, and display it?

dawn quiver
#

i suppose that is a way, you might want to ask around in pygame community tho, some of them may know how to take advantage of svgs with pygame in relation to scalability in a better way

#

do you need a link to the server?

silk hinge
#

yes please

#

"send me, heimdall"

dawn quiver
#

There you go

silk hinge
#

holy, that's neat

dawn quiver
fickle fulcrum
#

Hi, did something have interesting videos / documents about multiplayer game ? 😋 I would like to learn how to make them with the best structures 😁

torn jackal
#

hello guys, i'd like make a tab on a lot of lines of code. do u know a way to dont do it manually ?

#

mention if u can help, thanks

#

I finally found by myself : select ur block of code and press Ctrl + [

gentle bay
#

Hey I was wondering if anyone knew a good tutorial on Pong with Pygame that's for more experienced programmers, something that uses hitboxes, so i guess just pong if it wasnt made a bazillion years ago

edit: remembered google is very much a thing

grim folio
#

I made a simple blackjack game.

grim folio
karmic tiger
#

Question In What website I could learn pygame commands?

grim folio
karmic tiger
#

:/

elder flax
#

anyone know how to make the loop for music

#

I'm using pygame

dawn quiver
karmic tiger
#

uhh yesz

#

pretty well

karmic tiger
dawn quiver
full wren
#

How could I make a save for the player ?
serializing ?
would like to make some checkpoints in the game (auto), that saves the variables values, and if it's possible, make a jump in the code so the player could get back where the last checkpoint saved the data

dawn quiver
#

Depends, is your game entirely local?

celest breach
#

i have a question, so i have a .exe file made with pyinstaller and i want to change the icon for that exe file but i can't make the exe file again with using the --icon="icon location" command because when i do it will just give me a file called "noneexe"

shell bone
#

Can anyone teach me 3D camera and 3D matrix implement in pygame?

quasi patrol
#

can someone help me with sprite sheets

knotty valve
#

hi, i know im not typing in the right channel but couldnt find a better one. i am a beginner on python and i want to get better to make games using python, if anyone can give me free courses i would really appreciate it, thank you <3

smoky stump
#

can somebody help me?

#
import pygame
from sys import exit

#important Variables
pygame.init()
screen = pygame.display.set_mode((1000, 500))
pygame.display.set_caption("GAME")

#Variables
#Player
player = pygame.draw.rect(screen, "#93E9FF", [500, 250, 40, 40])
player_rect = player.get_rect(center = (500, 250)

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()

    pygame.display.update()
#

line 12 it does not work

smoky stump
# knotty valve hi, i know im not typing in the right channel but couldnt find a better one. i a...

In this tutorial you will learn to create a runner game in Python with Pygame. The game itself isn't the goal of the video. Instead, I will use the game to go through every crucial aspect of Pygame that you need to know to get started. By the end of the video, you should know all the basics to start basically any 2D game, starting from Pong and ...

▶ Play video
smoky stump
knotty valve
#

kind of

#

yeah

#

i pretty much know the basics

smoky stump
#

ok

knotty valve
#

i watched that mosh guy's 6 hour tutorial

#

im on like hour 3

smoky stump
#

like till OOPS

#

ok

#

so when u watched his tutorial

#

watch this from clear code

#
import pygame
from sys import exit

#important Variables
pygame.init()
screen = pygame.display.set_mode((1000, 500))
pygame.display.set_caption("GAME")

#Variables
#Player
player = pygame.draw.rect(screen, "#93E9FF", [500, 250, 40, 40])
player_rect = player.get_rect(center = (500, 250)

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()

    pygame.display.update()

line 12 isn't working

#

can somebody help me?

round obsidian
#

@smoky stump You're missing a ) at the end of that line, look closely

smoky stump
#

it does not not work either

#

AttributeError: 'pygame.Rect' object has no attribute 'get_rect'

#

its giving me this error

untold sphinx
#

get_rect is used when working with images

smoky stump
#

ohhhhhh

#

ok

#

so how do i center the position then

#

??

#

@untold sphinx?

#

?????

untold sphinx
#

pygame.rect.move_ip

smoky stump
#

thats it?

untold sphinx
#

ya

#

y = pygame.rect.move_ip(arg1,arg2)

smoky stump
#

what do i put in as paramters?

#

integers?

#

tuple?

#

List?

untold sphinx
#

use pygame.rect.move()

#

it can take int

smoky stump
#

i am confused rght now

untold sphinx
#

There are two methods

#

var = pygame.rect.move(arg1,arg2)
//Here arg1 and arg2 are integers

smoky stump
#

coordinates?

untold sphinx
#

2-
pygame.rect.move_in(arg1,arg2)
//It takes the var object itself too

untold sphinx
smoky stump
#

which one is the best

#

?

untold sphinx
#

move_ip if you are making classes
and move if you are not doing oop
also syntax for your code will be
player = pygame.Rect.move(player,100,100)
(1st arg is the rect object and others are its coords)

smoky stump
#

@untold sphinx thnks

untold sphinx
#

np

smoky stump
#

wait

#

i ran the code

#

but

#

topleft corner was in the at those coorditanes

#

i want the center of the rectangle to be in those coorditanes

lusty wasp
#

what is the best library?

shell bone
lusty wasp
shell bone
#

No problem

finite solar
wide mist
#

Is pycharm a good platform or else anything good other than that?

dawn quiver
#

well, whatever editor you are used to for Python is a good choice for game development

#

Some really good game devs like dafluffypotato used to use IDLE at some point, and made great looking games nevertheless

#

Pycharm is nice, yeah

#

its debugger specifically can help break the project down into steps and see whats going on

edgy arch
#

Hello, can someone help: This is my current code:

import math
import pygame


class Player(pygame.sprite.Sprite):
    BLACK = (0,0,0)

    def __init__(self,screen):
        pygame.sprite.Sprite.__init__(self)
        self.image = pygame.image.load("./sprites/sprite.png").convert()
        self.image.set_colorkey(self.BLACK)
        self.image = pygame.transform.scale(self.image, (64, 64))
        self.rect = self.image.get_rect()
        self.rect.center = (1024 / 2 , 768 / 2)
        pygame.draw.line(screen, (0, 0, 0), (0, 0), (100, 100))
        pygame.display.flip()
        self.image_clean = self.image.copy()
        self.rot = 90

    def update(self):
        self.image = pygame.transform.rotate(self.image_clean, self.rot)

def main():
    pygame.init()
    pygame.mixer.init()
    screen = pygame.display.set_mode((1024, 768))
    pygame.display.set_caption("Raycaster")
    clock = pygame.time.Clock()
    white = (255,255,255)

    player = Player(screen)
    player_rot = 0
    all_sprites = pygame.sprite.Group()
    all_sprites.add(player)

    running = True
    while running:
        screen.fill(white)
        all_sprites.update()

        all_sprites.draw(screen)
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                running = False
        mouse_x = pygame.mouse.get_rel()[0]
        if mouse_x < 0:
            player_rot = 3
        if mouse_x > 0:
            player_rot = -3
        if mouse_x == 0:
            player_rot = 0
        print(mouse_x)
        player.rot += player_rot
        keys = pygame.key.get_pressed()
        if keys[pygame.K_w]:
            player_cos = 2*math.cos(player.rot)
            player_sin = 2*math.sin(player.rot)
            player.rect.x = player.rect.x + player_cos
            player.rect.y = player.rect.y + player_sin
  
        clock.tick(60)
        pygame.display.update()
    pygame.quit()
    quit()
if __name__ == '__main__':
    main()
#

The problem is that when moving the mouse cursor, the sprite turns which is OK. But it does not move in the direction which is looking. It goes in a random direction.

#

Does any one spot a problem in my code?

#

Thank you.

snow hill
grim copper
rotund quail
#

I followed a tutorial, and customized the code a bit by myself. I decided i wanted to learn Python so I started like 2 or 3 days ago. I made this pong game:

import turtle

wn = turtle.Screen()
wn.title("Optimized - Pong")
wn.bgcolor("black")
wn.setup(width=800, height=600)
wn.tracer(0)

paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
paddle_a.shapesize(stretch_wid=5, stretch_len=1)
paddle_a.penup()
paddle_a.goto(-350, 0)

paddle_b = turtle.Turtle()
paddle_b.speed(0)
paddle_b.shape("square")
paddle_b.color("white")
paddle_b.shapesize(stretch_wid=5, stretch_len=1)
paddle_b.penup()
paddle_b.goto(350, 0)

ball = turtle.Turtle()
ball.speed(0)
ball.shape("square")
ball.color("green")
ball.penup()
ball.goto(0, 0)
ball.dx = 0.2
ball.dy = 0.2

def paddle_a_up():
    y = paddle_a.ycor()
    y += 20
    paddle_a.sety(y)

def paddle_a_down():
    y = paddle_a.ycor()
    y += -20
    paddle_a.sety(y)

def paddle_b_up():
    y = paddle_b.ycor()
    y += 20
    paddle_b.sety(y)

def paddle_b_down():
    y = paddle_b.ycor()
    y += -20
    paddle_b.sety(y)

wn.listen()
wn.onkeypress(paddle_a_up, "w")
wn.onkeypress(paddle_a_down, "s")
wn.onkeypress(paddle_b_up, "Up")
wn.onkeypress(paddle_b_down, "Down")


while True:
    wn.update()
    ball.setx(ball.xcor() + ball.dx)
    ball.sety(ball.ycor() + ball.dy)

    if ball.ycor() > 290:
        ball.sety(290)
        ball.dy *= -1

    if ball.ycor() < -290:
        ball.sety(-290)
        ball.dy *= -1
    
    if ball.xcor() > 390:
        ball.goto(0, 0)
        ball.dx *= -1

    if ball.xcor() < -390:
        ball.goto(0, 0)
        ball.dx *= -1

    if ball.xcor() < -330 and ball.ycor() < paddle_a.ycor() + 50 and ball.ycor() > paddle_a.ycor() - 50:
        ball.dx *= -1
    elif ball.xcor() > 330 and ball.ycor() < paddle_b.ycor() + 50 and ball.ycor() > paddle_b.ycor() - 50:
        ball.dx *= -1
#

I still need to add the scores, and fix a few ball glitches

#

But the problem is:

#

I dont know how to make the paddless smoother

#

they keep adding by 20 pixels

#

but I want to make them smoother

#

I dont know if it could work, but i could try to increase the speed of the paddles, and decrease the pixel increase amount

#

These are the functions I made:

#

please suggest changes 🙂

#

def paddle_a_up():
    y = paddle_a.ycor()
    y += 20
    paddle_a.sety(y)

def paddle_a_down():
    y = paddle_a.ycor()
    y += -20
    paddle_a.sety(y)

def paddle_b_up():
    y = paddle_b.ycor()
    y += 20
    paddle_b.sety(y)

def paddle_b_down():
    y = paddle_b.ycor()
    y += -20
    paddle_b.sety(y)

wn.listen()
wn.onkeypress(paddle_a_up, "w")
wn.onkeypress(paddle_a_down, "s")
wn.onkeypress(paddle_b_up, "Up")
wn.onkeypress(paddle_b_down, "Down")
dawn quiver
#

damn soviet union knows python 💀

tranquil girder
tranquil girder
#

just?

crisp helm
#

hey

#

can u guys recommend a good game engine for python? (except pygame)

hollow jackal
#

Hello, if I want to make a 3d game what module should I use? I'm seeing pygame, ursina, and panda3d but idk which ones best

crisp helm
#

i think pygame is only 2d

vagrant saddle
sweet shard
serene spear
#
    def __init__(self, data = [1.0, 2.0, 3.0]):
        self.data = data

items = [item(), item(), item()]

for i in range(10):
    for n_item in items:

        item_changed = item()

        item_changed = n_item
        item_changed.data[0] = n_item.data[0] + 3.0

        print("item_changed is ", item_changed.data[0])
        print("item is ", n_item.data[0]) ```
May someone explain why the n_item is also being modified?
vagrant saddle
#

just do ```py
class item:
def init(self, data = None):
if data is None:
data = [1.0, 2.0, 3.0]
self.data = data

vagrant saddle
celest breach
#

hello, i have a question, i made this program that tells you the apps that are running in you pc:

cmd = 'powershell "gps | where {$_.MainWindowTitle } | select Description,Id,Path'
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
for line in proc.stdout:
    if not line.decode()[0].isspace():
        print(line.decode().rstrip())

but when use the output, so line.decode().rstrip(), it will put all the information in one line, how can i fix that

junior forum
frank fieldBOT
past bone
vagrant saddle
celest breach
#

does anyone know how to make this code return a list:

cmd = 'powershell "gps | where {$_.MainWindowTitle } | select Description'
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
for line in proc.stdout:
        names=line.decode().rstrip()
vagrant saddle
celest breach
#

ok ty

past bone
pliant inlet
#

Hi Guys

harsh oyster
#

i need someone who want to be in a beginner group who also use Godot

quasi minnow
#

@harsh oyster i'm in

harsh oyster
hollow jackal
#

anyone know how I can make shift toggle between two actions in ursina, or an ursina discord server?

#
def input(key):
    if key == "shift":
        camera.x=.5
#

i want it to be so shift can set camera.x to .5 and 0, toggling between eachother

tranquil girder
vagrant saddle
languid pasture
#

working on a game and wanting suggestions of what ||weapons|| to add, already have ||pistol|| rasing base damage to 20, and R.B.G.9000, rasing base damage to 75 (max) any suggestions?

dawn quiver
languid pasture
#

@dawn quiver Cool, that sound like a good idea, thanks

fallow glade
#

What kinda game?

languid pasture
#

@fallow glade no real theme, it can be anything

fallow glade
languid pasture
#

okay, cool idea

#

I need some ores to make into armor, currently have iron ore, raises defense to 5, extreme ore, raises defense to 10 (max), Any suggestions?

full wren
#

no graphic interface

#

all in the command box

meager plover
#

Is there any efficient way to slow down animations in arcade? As far as I know, the best way is to just have more individual frames and just skip through each one by increments to make it seem as if the animation is slowing down or something. E.g play frame 2, then frame 6 , then 10 etc.. to add that slowed effect or something

#

Actually found a somewhat solution by passing a custom delta_time to the update_animation() for that specific sprite, but if anyone has any better ideas do lemme know

chilly vine
#

If you're making a game then should you have a game loop for the main menu, and then when you start a game, it calls a function with its own separate loop? Or is that bad code and there should only be one loop?

meager plover
#

Now for an expresso

meager plover
chilly vine
#

It will all be one thread. It will be like: the main menu function calls the game function and waits for it to finish.

#

And both have their own loops

rotund quail
#

whats up fatasses

dawn quiver
valid wadi
#

!warn 1007746855179923498 "whats up fatasses" is a totally inappropriate way to speak on our server.

frank fieldBOT
#

:incoming_envelope: :ok_hand: applied warning to @rotund quail.

median socket
#

made this game today its pretty flawless especially in terms of graphics 🙂

quasi dome
#

Hello

#

Is it possible to make dynamic lighting in pygame?

#

For 2D game

quasi dome
#

hmm

#

oke

#

thankyou

snow hill
dawn quiver
#

I have idea of pen fight game

stone wasp
#

Pygame noob, current status on my project, I'm trying to figure out how to do multiple levels and think I'll need to rebuild the full thing to get that system working

quasi dome
#

how can i make this in pygame

#

i couldnt find anything from google

celest breach
#

hey, i have a question, so i made a game with pygame and than made it exe with pyinstaller, but when i run it in other devices than mine it will think its a virus and it will not let it run, can anyone help me with that

normal silo
quasi dome
#

im just a beginner who is looking for examples

#

i mean i cant write that code by myself

#

i need someone to explain

normal silo
# quasi dome i need someone to explain

I recommend learning some mathematics for game developers as it will let you write code for these kinds of things without having to constantly look up tutorials for specific things.

#

And translate from other code.

grim copper
#
import math

def fixangle(angle):
    while angle < 0:
        angle += 360
    while angle > 360:
        angle -= 360
    return angle

def rotateIMG(img,angle):
    return pygame.transform.rotate(img,abs(360-angle))

def fromAngle(x,y,tx,ty):
    r = math.atan2(ty - y, tx - x)
    angle = float(math.degrees(r)+90)
    angle = fixangle(angle)
    x_vel = math.cos(r)
    y_vel = math.sin(r)
    return {
            "x_vel": x_vel,
            "y_vel": y_vel,
            "angle": angle,
        }

this is the code i used! its prettty simple
plug in the x,y of the player and mouse like this:-

angle = fromAngle(playerX+playerWidth,playerY+playerHeight,MouseX,MouseY)["angle"]

and then rotate the img of the player hand using the rotate img function

grim copper
#

works great for 2d fps bullets and gun based games

celest breach
#

m

shadow bone
#

I made this over the last 2 days, still working on it

#

Commandline version of paper's please 😄

#

You can check out the source code or play it yourself here

#

Would love any reviews, or any comments about the code! I'd love to improve as much as possible

robust hearth
#

Hello, does anyone know any good templates for games?

median socket
#

Are there any game engines that use python?

vagrant saddle
normal silo
median socket
vagrant saddle
celest breach
deep fox
#

Vector object not callable? how do i split. extract values from this? Im pretty sure it spits out a 3vector.

dry flint
#

only python or other language

eternal ice
snow hill
#

(plus a couple of assets found on cgtrader)

shut wren
#

🙂

zinc vortex
celest breach
snow hill
#

And the coder who implemented the dogfight is a coworker 🙂

celest breach
#

wow

candid zephyr
#

pygame noob here, im curious if its possible to make snake on a xyz plane (aka 3d) instead of on a xy (2d) plane with relative ease

blissful goblet
#
if player.y > map_level:
  chaser_y += 1
if player.x > chaser_x:
  chaser_x += 1
if player.x < chaser_x:
  chaser_x -= 1
if player.y < map_level:
  chaser_y -= 1

looking at this is triggering me, there must be a way to write it in one or two lines

dawn quiver
#

This is what I think of, you may or may not find it neater

blissful goblet
#

interesting 7739monkathink not necessarily neater to me, but thanks

dawn quiver
#

can somone one knwo a good free tutorial video fighting game when you do hit box and IA ennemie please?

candid zephyr
dawn quiver
# candid zephyr could you elaborate on why that may be difficult?

Pygame isn't made for 3d games. It involves more math than you may be assuming. Even drawing a rotating cube is a lot of work with pygame, we have some examples you could look at, though.
https://github.com/Matiiss/pygame_examples/tree/main/pgex/examples/3d_cube

Pygame is pretty barebones, it doesn't support loading OBJ files.
You'd have an easier time using pygame with moderngl/opengl for anything 3d related.

There are specific libraries for 3d games you could take a look at.
https://www.ursinaengine.org/
https://www.harfang3d.com/en_US/
https://www.panda3d.org/

candid zephyr
#

does that math get easier with using ursinaengine to name an example

willow echo
#

What's the best approach in splitting online functionality for a battleship game?

The approach i can come up with is that there's a game class and theres a function that listens for messages in another thread. that class controls who's turn is active and such

median socket
dawn quiver
#

whenever someone sends a move

#

the other person now takes their turn

#

so whoever sends a move dictates whos turn it is

#

This is just a guess

#

I figured less things to send over the network the better

#

well in battle ship isn't the state static after setup?

#

so you could send each others boards and merge them together

#

then everything is pretty much client side

#

lol its weird

#

like playing a game with youself

plush forum
#

Hello if someone are good with pygame if he can help me with a weird problem im in #help-corn thanks

late field
#

can i make 3d and realistic game with this app @round obsidian @viscid venture @idle yacht @dense hare

round obsidian
zinc vortex
dawn quiver
#

does anyone want to test my first project its a rock paper scissors game but all made by myself and not in cmd its in its own window with buttons if you want to test it then dm me

hoary scaffold
#

hey
what's the best 3d game library for python ofc

short cape
#

my guy i noticed this channel only now

#

does python get used for 3d games?

#

ive never heard of it or seen it

normal silo
short cape
#

or workspace, idk how to call it

sweet shard
golden zealot
#

Guys where can I learn Game development?

stark dagger
#

Hey

golden zealot
tranquil girder
#

What part of game development?

vagrant saddle
#

the learning part i guess

#

hides

vagrant saddle
golden zealot
lilac sigil
cosmic cobalt
#

Hello.

#

I need help.

#

import tkinter as tk
from tkinter import ttk
from tkinter import *
import time

lollipops = 0
count = 0

def clicked():
global count
global lollipops
count = count + 1

label1.configure(text=f'You now have {count} candy!!!')

if count > 19:
    count = count +1

if count > 49:
    count = count +2

if count > 99:
    custom_button1= ttk.Button(windows, text="Trade in 10 candies for 1 lollipop!", command=lollipop)
    custom_button1.grid(column=1, row=1)

def lollipop():
global lollipops
global count

label1.configure(text=f'You now have {lollipops} lollipops!!!')
count = count - 10
lollipops = lollipops + 1

windows = tk.Tk()
windows.title("Candy Clicker Alpha")

label = tk.Label(windows)
label.grid(column=0, row=2)

label1 = tk.Label(windows)
label1.grid(column=0, row=1)

custom_button = ttk.Button(windows, text="Click on me to get free candy!", command=clicked)
custom_button.grid(column=1, row=0)

windows.mainloop()

#

This is currently the code I have.

copper nebula
#

Gotta pre-fix that with ```py for a formatted code block

cosmic cobalt
#

But when you buy a lollipop, the game just breaks.

#

Like the code just does not make sense.

untold sentinel
#

Anyone know where I can find some big, decent quality tilesets for a top down game?

cosmic cobalt
#

Can someone help me at help-kiwi?

cosmic cobalt
fallow glade
supple nest
#

Hi, is there anyone who wants or can try my python game and mabye tell me if i did something wrong?? 🙂

untold sentinel
#

Any good guides or tutorials about large, scalable pygame projects?

frozen dawn
#

Is there any alternatives to Pygame

livid marsh
#

Arcade is what I'm testing out

dawn quiver
frigid jewel
pliant siren
smoky stump
#

can somebody help me?

#

i want to code a 2D player movent system but if i test it the figure is cloning itsself

#

in pygame

tranquil girder
#

in the while loop

smoky stump
#

Thanks

snow hill
untold sentinel
#

When building a scalable PyGame project

#

I'm trying to think my way towards some best practice

#

It looks as though the usual strategy is to use a massive finite state machine to determine which "domain" of the game is currently visible (the game proper, or the save game screen, or an item screen, and so on)

#

This solution isn't tremendously scalable though. Nesting finite state machines is a little better. You can have a main "game" object which stores its display state, toggling between "pregame menu", "main game", "pause menus", and so on. Each of these "domains" of gameplay are themselves an object with their own render() methods and their own FSMs to control what is and isn't visible

#

Does this all sound logical?

gaunt monolith
#

Nested scenes makes sense yes. I'd actually make it a stack of scenes though, so you could do something like push a new scene on top, then when that's closed return to whatever is previously shown.

#

Maybe also add a flag on each scene class which determines if the next scene also needs to render (game scene rendering behind the menu).

smoky stump
#
import pygame
from sys import exit

#important Variables
pygame.init()
screen = pygame.display.set_mode((1000, 500))
pygame.display.set_caption("GAME")
clock = pygame.time.Clock()
player_x = 500
player_y = 250

#Variables

#Player


while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()

    player = pygame.draw.rect(screen, "#93E9FF", [player_x, player_y, 40, 40])
    player_rect = pygame.Rect.move(player, 500, 250)

    if event.type == pygame.KEYDOWN:
        if event.key == pygame.K_UP:
            player_y -= 5

    pygame.display.update()
    clock.tick(60)
#

if i run this code the rectangle is cloning itself up when i click the up button

#

i want a player movement

#

Can smbody help me?

#

i fixed it

#

!!!

desert beacon
tranquil girder
#

See my answer further up

smoky stump
desert beacon
#

oh ok

cosmic vale
#

would anyone be interested in collaborating on the creation of a game?

cosmic vale
manic anvil
#

anyone working with Psyhopy to build experiment?

cosmic vale
manic anvil
#

ah yeah, I was typo..

sudden mantle
#

is ther a game engine for python? something like unity

dawn quiver
#

You could use godot with python bindings

vagrant saddle
brave marten
#

Hello, I'm sure this question may have been asked before, but is Pygame suitable for moderately large projects? For example, would it be possible to achieve something like Mother 3 in Pygame without large performance drops?

grizzled basin
#

I wanna make a trading card game in python with visual aspects in the vain of magic the gathering and hearthstone, where would I begin? I know like, the basics of normal python but nothing when it comes to game development in python or visual aspects

frank fieldBOT
normal silo
# grizzled basin I wanna make a trading card game in python with visual aspects in the vain of ma...

Try making some terminal games such as tic-tac-toe, battleship, and a text-adventure. Then try learning pygame and some basic mathematics for game developers. Make some 2D games such as Pong, Breakout, Tetris, Zelda-like (this can become as complex as you want it to). You then should have enough skills to be able to make a simple 2D card game simulator. Then if you want to get into 3D make sure you have a more solid understanding of game mathematics (linear algebra mostly), and then try something like Ursina / Panda3D. You will also need to learn shader programming at some point for visual effects (GPU programming), but you can leave the visuals for later.

#

*You also need to learn how to make some game AI to play against, this will involve learning how to make things like a tic-tac-toe AI, battleship AI, chess AI, etc.

#

The math is nothing too crazy and there are many resources on it: https://www.youtube.com/watch?v=DPfxjQ6sqrc

This video outlines what I believe are some of the core principles you need to understand to make dynamic computer games, covering vectors, angles and motion. I've tried to present it in such a way that highlights the relationships between these principles, so you can identify when to use one or the other, or combinations of them. It is by no me...

▶ Play video
grizzled basin
#

I don't really mind about the visual or audio sides, ill probably just do copy and pasted visual aspects, this is actually probably more a proof of concept for a physical card game tbh

normal silo
sweet shard
forest cargo
#

anyone have a valid link to the pygame discord?

forest cargo
#

ping me if you do

vagrant saddle
forest cargo
#

thanks

untold sentinel
#

Hey gamedev people! I'm building a topdown adventure game as my software development group project

#

I'm doing lots of reading of course, but I'd love some tet-a-tet with some experienced game devs so I might get a fuller picture of what's in store

#

I guess my most important question is: what are the questions I need to be asking? What do I not know that is key?

#

Beyond this, what are the core components of a topdown game? What sort of organizational structure should I use? In what sequence should we be implementing it?

dawn quiver
#

Hey im new to this Python coding thing And im trying to make a game And i want to make like a ability to make IT snap on to a player so if anyone could help me please do

neon tinsel
#

Hey yall, curious about how you would model an item class for game items that all do different things

#

I want to make an item class, but items are such complex objects. Things like price, rarity, durability, function, name, whether or not they can stack, etc.

#

Does anyone have an example

#

Yea

frank fieldBOT
#

Hey @dawn quiver!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

neon tinsel
#

I'm reading about Composition vs. Inheritance, and it looks like composition would be the best way to do this. I would love an example though

tranquil girder
#

Both are bad and add unnecessary complexity. You can just use a dict or a class instead

neon tinsel
#

I don't think you understand the question

#

Each item would have different funcitonality

#

They would all have names, prices, durability, etc.

#

But how would I expand the item class to also include functionality for different items? For example, I could subclass and make a RestoreHealth class and make it so items that restore health are in that class, but then what about items that do very specific things?

#

A dictionary wouldn't really be helpful for complex functionality for different items

normal silo
neon tinsel
#

Not necessarily

#

They all have similar data, but they might have different functions

normal silo
#

Make a class to hold the common data. Then implement 3 items manually, externally (just plain old functions). After that you can try to design some kind of generic system.

#

If you are unsure how to design something just do it the most direct, non-generic way. Then after you have a few samples, you can try to find commonalities and design around that. Guessing the design up front is error-prone (and a waste of time (unless it's some giant project with a big team which requires forward planning for coordination) (or you already made something similar before in which case you can predict what the design will be like with high enough accuracy (this is how generic game engines are born))).

neon tinsel
#

I see

normal silo
#

In game dev this is often summarized as "make the game instead of making systems," but I find that lacks the important detail that you can build systems out of the samples gained by implementing some of the parts (generalization).

#

It is similar to how in mathematics one plays with specific cases before generalizing later as your intuition / idea of how it should be built will be more informed at that point.

tranquil girder
#

I've made that kind of inventory system before. I just assigned a function called on_use to the items to customize what should happen. I just used a dict for each item, containing name, description, value, effect, etc.

neon tinsel
#

@tranquil girder, how did you store the effect? did you store python code in a dictionary?

tranquil girder
#

You can refer to a function in a dict, or use a lambda, or a string that get used by exec, or some custom solution

#

When I made a complex spell system for a different game, I used a Spell as a base class just to set defaults and made every spell inherit from that one class. If you're going to use inherence, you better keep it simple and avoid multiple levels deep inheritance and definitely avoid multiple inheritance. Keep it simple. My spells were kind of like complex items which had state like cooldown, damage over time, side effects and combinations. So using classes can work too

neon tinsel
normal silo
#

An example would be a bunch of spells each having a cast method. That would be their common interface.

#

If you find yourself having an if-else chain where each if checks the type of spell, you probably want polymorphism.

neon tinsel
#

Got it, I'll look into that

normal silo
#

The more specific term for what is happening when you call cast on a spell is dynamic dispatch.

warped elk
#

Can't make an executable(.exe) from a Pygame Code!
Install Command: ```py
pyinstaller --noconfirm --onefile --windowed --icon "G:/Python Projects/Pygame/Assets/spaceship.ico" --name "Space Escaper.exe" --version-file "G:/Python Projects/Pygame/Spce Escaper Version File v1.txt" --add-data "G:/Python Projects/Pygame/Assets;Assets/" --hidden-import "pygame" "G:/Python Projects/Pygame/main.py"

**Problem:** The Issue is when the `.exe` created and I try to run it, shows this Error! \**Attachment\**
#

Someone help me!

#

I used pygame to make the game

dawn quiver
#

Hello

robust hearth
warped elk
#

if venv yes!

robust hearth
#

Did you install pygame throug pip in it?

#

You need to install pip in the venv

warped elk
warped elk
#

@robust hearth

robust hearth
#

You need to install it in the venv directory

cursive dove
#

why not design roblox game

robust hearth
hybrid raft
#

Hello Everyone, I am facing difficulty to automate calculating the sub-surface damage on glass surfaces. I have to find the inner and outer diameters as shown in the figure. I have a problem finding the inner diameter (green), it has to be the area with minimum/no scratches from the center.

warped elk
#

Btw, there are no venv directory in my pronect directory

manic oyster
#

object oriented programming

unreal river
# warped elk How?

You need to activate your venv in your command prompt or your terminal then type pip install pygame on the command prompt or the terminal that you have activated your venv

raw shadow
#

okay so i've got this code

def draw_oscilator(height, width):
    for x in range(1000):
        y = float(height * math.sin(x * 0.1) + width)

        pygame.draw.circle(screen, (255, 255, 255), (x, y), 1, 5)


running = True

height_flag = False
width_flag = False

height = 10
width = 10

# set fps to 10
pygame.time.Clock().tick(1)

while running:
    pygame.Surface.fill(screen, (0, 0, 0))

    for events in pygame.event.get():

        if events.type == pygame.QUIT:

            running = False
            pygame.quit()
        if events.type == pygame.KEYDOWN:
            print("\033c", end="")

            if pygame.K_d:

                draw_oscilator(height=height, width=width)
                
            if pygame.K_h:
                height_flag, width_flag = True, False

                print(f"width: {width_flag} height:{height_flag}")

            if pygame.K_w:
                height_flag, width_flag = False, True

                print(f"width: {width_flag} height:{height_flag}")

            if pygame.K_UP:
                if height_flag:
                    height += 1.0
                if width_flag:
                    width += 1.0

                print(f"width: {width} height:{height}")

            if pygame.K_DOWN:

                if height_flag:
                    height -= 1.0
                if width_flag:
                    width -= 1.0

                print(f"width: {width} height:{height}")

            # if pygame.K_c:
            # print("\033c", end="")

        pygame.display.flip()
``` and the issue with this is, my global variables arent being updated. I wrote height_flag and width_flag as globally false, but for some reason, within the events loop, they're all being called for some reason
#

also, what i draw ends up disappearing, idk where to put the refresh black

warped elk
#

not yours if you don't install pygame

unreal river
#

You could use setuptools to do it or create an msi

warped elk
#

without even having Python

#

Like Other Applications

unreal river
#

@warped elk
msi is an installation program like a zip file with options, it extracts the files for your program only works on windows

setuptools you publish your game on pypi in order to install pip but you have alot to learn

warped elk
warped elk
#

@unreal river?

#

@unreal river I have these files in the project directory!

#

Error:

vagrant saddle
dawn quiver
#
import turtle 

wn = turtle.Screen()
wn.title("Pong Emil")
wn.bgcolor("black")
wn.setup(width=800, height=600)
wn.tracer(0)

#Paddle A
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
paddle_a.shapesize(stretch_wid=5, stretch_len=1)
paddle_a.penup()
paddle_a.goto(-350, 0)

#Paddle B
paddle_b =turtle.Turtle()
paddle_b.speed(0)
paddle_b.shape("square")
paddle_b.color("white")
paddle_b.shapesize(stretch_wid=5, stretch_len=1)
paddle_b.penup
paddle_b.goto(350, 0)

#Ball


#main game loop
while True:
    wn.update()
#

why there is a line?

vital coyote
#

Hi, it’s possible to make a surface (in pygame window) who content many objects on pygame please ?

dawn quiver
fresh lance
#

In pygame, how can you just change the textures?

crimson hound
#

Exponential because every time you eat an apple, you get 50% longer

#

I'm mildly 🅱️ad at snake

desert beacon
dawn quiver
#

What do ya think of this Milk Carton Sprite I am incorporating into my game

dawn quiver
crimson hound
#

the snake speed?

#

well, it's more spicy this way

dawn quiver
#

True

#

It's a bit more exciting

dawn quiver
dawn quiver
dawn quiver
#

So I was gonna make a retro guitar melody then opened piano and one thing led to another and I made this song for the menu screen

#

Opinions?

untold sentinel
#

How does one handle multiple game screens in a PyGame game, and, how does one handle routing input events to the right actions

#

Is it something like...

#
class Controller():

  def __init__(self) -> None:

    self.currently_focused = player_object
  
  def get_events():

    for event in pygame.event.get():
      
      if event.type == pygame.KEYDOWN and event.key == pygame.K_UP:
        self.currently_focused.on_up(event)

      if event.type == pygame.KEYDOWN and event.key == pygame.K_DOWN:
        self.currently_focused.on_down(event)

      if event.type == pygame.KEYDOWN and event.key == pygame.K_LEFT:
        self.currently_focused.on_left(event)

      if event.type == pygame.KEYDOWN and event.key == pygame.K_RIGHT:
        self.currently_focused.on_right(event)

class Game():

  def __init__(self) -> None:
    
    self.state = 'main-game'

  def run(self):

    while True:

      if self.state = 'main-game':
        self.render_main_game()

      else if self.state == 'main-menu':
        self.render_main_menu()

      else if self.state == 'save-menu':
        self.render_save_menu()

      else if self.state == 'load-menu':
        self.render_load_menu()
      
      ...
vital coyote
#

Hi, just a simple question anyone know if it’s possible to run a client websocket at the same time than a pygame window? I can’t make that because I have a “await” who wait to receive the information. That stop the pygame loop. Thank you for your help.

fallen patio
#

Whats the best tutorial for learning pygame

desert beacon
desert beacon
# fallen patio Whats the best tutorial for learning pygame

In this tutorial you will learn to create a runner game in Python with Pygame. The game itself isn't the goal of the video. Instead, I will use the game to go through every crucial aspect of Pygame that you need to know to get started. By the end of the video, you should know all the basics to start basically any 2D game, starting from Pong and ...

▶ Play video
lucid zephyr
#

guys

#

question

#

should I learn C if I want to dive in game dev?

meager plover
#

i was drawing and i remeber a python lol i hope it make you cheers guys.....

finite solar
dawn quiver
#

Hey I have a question for Pygame. Where should I be keeping my Event Handlers?

        #Event Handler
        for event in pygame.event.get():
            if event.type == pygame.KEYDOWN:
                if event.key == pygame.K_SPACE:
                    print('Key Pressed')
#

OHHH

#

im dumb

#

nvm

#

I had 2 event Handlers that's why

light flax
# dawn quiver Hey I have a question for Pygame. Where should I be keeping my Event Handlers? `...

event.get() exhausts the pygame events that are waiting to get handled. In my limited experience I use gameobject (unity style) classes with their own update() and render() methods which can have their own event handlers, reading the events from a centralized list of events in a single Gamestate instance that is updated with event.get() once per tick. Then you can categorize your objects into Scenes, and have a single infinite loop in your program entry point that update()s every object in your active scene

light flax
# dawn quiver oh thanks

you can even categorize your "subsystems" this way, e.g. in a jrpg style game the overworld scene could have a PartyController gameobject with an event handler that handles party movement, the battle scene could have a similar BattleController with an event handler for selecting spells and attacks etc. This has the bonus side effect that makes your game modularized instead of hardcoded (handling game systems as if they were regular gameobjects like your player character, I mean)

blissful goblet
#

anyone got tips for improving player retention froggy_chill

tranquil girder
#

Do playtesting to figure out why they quit

dawn quiver
#

Can someone help me with this Event handle?

dawn quiver
blissful goblet
#

and half of them are just random people i dont know, pretty frustrating

cold geode
#

Same lines of code as in video

    pygame.draw.rect(screen, 'Pink', score_rect)
    pygame.draw.rect(screen, 'Gold', score_rect, 10)
#

Not really game breaking, but it is weird as even the docs say the border edges will grow

dawn quiver
#

Hey I have a question

#

Why when i put this command it fills the screen white for a second and stops the music completely

            if event.type == pygame.KEYDOWN:
                if event.key == pygame.K_SPACE:
                    Game_Started = True
                    print('Game Has Started')
                if Game_Started == True:
                    WINDOW.fill(WHITE)
                    pygame.display.update()
                    pygame.mixer.music.stop()

But then it still runs this code

def draw_window():
    WINDOW.fill(WHITE)
    WINDOW.blit(Bg_Image, (0, 0))
    Quick_Sprite.draw(WINDOW)
    Quick_Sprite.update()
    WINDOW.blit(Title_Image, (0, 0))

    pygame.display.update()

How do I terminate the second code so that when "Game Starts" the Sprites get off the screen completely instead of for a quick second.

neat forge
#

I'm really new to programming my day job is a model maker and machinist but I'm trying to learn Python on my free time. One of my interests is games. I'm stuck here at the beginning and I'm not sure why I keep getting an error ModuleNotFoundError No module named 'settings'. The Traceback is calling to the main file but I want it to call up the settings file which has the map into the main .

vagrant saddle
neat forge
#

I'm new to VS code and I think it's how I'm building my files as text and then converting them over to python files.

#

@vagrant saddle thanks i'll keep digging

crimson hound
#

Anyone have a decent explanation of the ECS pattern? I watched the video by The Cherno but I don't think I get it

dawn quiver
neat forge
#

@vagrant saddle it was not seeing the right file format and I had a couple other little errors fixed them and now I have it working!

frigid oxide
#

pls tell me how to make karel clean up everything

normal silo
# crimson hound Anyone have a decent explanation of the ECS pattern? I watched the video by The ...

In this 2017 GDC session, Blizzard's Timothy Ford explains how Overwatch uses the Entity Component System (ECS) architecture to create a rich variety of layered gameplay.

GDC talks cover a range of developmental topics including game design, programming, audio, visual arts, business management, production, online games, and much more. We post a...

▶ Play video
crimson hound
#

Thanks, I'll check it out

normal silo
#

OOP bundles functions and data into one things, ECS goes the complete opposite direction, keeping them separate.

#

The idea is to take objects that would traditionally be big and break them down into micro components of which you then have many. And systems select tuples of components to operate on.

#

The hope for this is to allow creating all kinds of objects via extreme compositions (many small components).

#

(And therefor extreme reuse)

#

The effect is that ECS games can feel very sandbox-y and allow a separate team of game designers that are not programmers to experiment with ideas.

#

However, in practice ECS's tend to not be pure ECS's, they are often hybrid systems due to the nature of games requirements.

crimson hound
#

I guess one question I have is -- how do you attach dynamic/polymorphic behaviour in this way of storing just data in components?
For example, I'm making a game with mechanics similar to Factorio, where you're building

So I have "belt" entities that carry items, "inserter" items that insert things into factories, and "factories" (like smelters, assemblers, chemical plants etc.) that turn one kind of item in another. As I understand it, this is how I might structure the entities:

Belt (Slow):
    - conveyor
    - item_source
    - item_sink
    - render

ItemInserter:
    - render
    - electricity_sink
    - ???

SteamTurbine:
    - electicity_source
    - fluid_sink
    - render

Cutter:
    - electricity_sink
    - item_sink
    - item_source
    - render
normal silo
#

The Overwatch video covers some of that though.

crimson hound
#

Would it be incorrect to place some kind of strategies or other polymorphic objects as component values?

normal silo
#

Components have multiple things in them and that could include booleans/enums/flags (further typing).

#

But they could all be separate components.

crimson hound
#

maybe I should watch the video first though 🙂

#

So I guess I'm just struggling to find a way to encode all of that as a single piece of "data"

normal silo
#

Polymorphism can be used inside components as they can technically have anything except logic in them (which would make them OOP style objects).

#

Since ECS's are usually implemented in more low level languages the polymorphism would come in the form of a bit field (including booleans) / tagged union.

crimson hound
#

tagged union sounds reasonable

#

well, I don't really need it to be blazingly fast... I'm using Python of all things

normal silo
#

Yeah so it would just be a class with no methods.

#

(dataclasses can be used)

#

I find enums really annoying (and limited) to use in Python, so IDK.

#

Python wants OOP, while ECS is moving towards DOD (setting up for it).

crimson hound
# crimson hound tagged union sounds reasonable

So I guess I would have something like ```py
@dataclass(frozen=True)
class ItemBlacklist:
forbidden: Collection[ItemId]

@dataclass(frozen=True)
class ItemWhitelist:
allowed: Collection[ItemId]

@dataclass
class ItemSinkComponent:
item: ItemBlacklist | ItemWhitelist

normal silo
#

Since it's going to be dynamic and slow (not fixed size stuff), you could just use inheritance anyhow.

#

Got isinstance.

crimson hound
normal silo
#

Yeah you mutate the components that the system queried. However, I recommend double buffering game state.

#

So instead you create a new component from the old one that has the changed applied.

#

Then after all the frame processing is done, the buffers swap.

crimson hound
#

I actually already have a system of reactive variables which are double-buffered, that might be useful

#

although that might be overengineering it

normal silo
#

Double buffering state sets you up for networking too, because you can add more buffers, then stuff like rewind is easy to implement.

#

As avoids the updating based on some old state and some new state.

#

(Order of entity updates)

crimson hound
#

so the purpose of double buffering is to always show a consistent state, right?

normal silo
#

Have you implemented Conway's game of life before?

crimson hound
#

yep

#

if you don't have a double buffer, the state will change from under you and the computation will be just wrong

normal silo
#

You update based on the previous state and write into a new buffer, because it's suppose to happen all at once.

#

And there is no "correct" order.

crimson hound
#

yeah makes sense

#

oh another question, how do you know when to delete a component?

normal silo
#

Ordering system updates is much more manageable.

normal silo
#

So when another entity is spawned it can use it.

#

(allocating and freeing all the time is slow (and memory bugs))

crimson hound
#

well, how do you know when to mark it as unused?

#

I guess in C++/Rust you can make a proper destructor

#

but using __del__ is kinda iffy

#

and also unpredictable

normal silo
#

When you call "kill" on an entity, the entity has a list of components associated with it.

#

No destructors.

#

Destructors are an OOP thing.

#

You make a giant list of components, once.

crimson hound
#

not necessarily OOP I suppose, Rust has drop

#

but yeah that requires polymorphism

#

although maybe that is what OOP is

normal silo
#

Zero memory management required (also known as region based memory management).

#

OOP ties the lifetime to each individual thing.

#

While in DOD we work with groups of things.

#

Since computers always work with groups of things.

crimson hound
#

this all sounds kinda similar to relational/logical programming

#

an entity is related to multiple components and such

normal silo
#

OOP makes no assumptions about an object's use which is why it must clean up and all that and encapsulate.

#

DOD realizes that objects don't tend to exist alone in the aether, but in a context and in a group.

#

With some pre-conditions.

#

ECS is very database-like.

#

(There are ECS databases)

#

And some are using it beyond video games now.

crimson hound
#

SQLite game engine when

normal silo
#

Yeah that is already a thing and is used to implement some of them.

#

IDR the examples though.

#

Did not bookmark them.

crimson hound
#

that's interesting

#

I guess SQLite is faster than it sounds, especially when in RAM

#

just a BTree thing

normal silo
#

It's probably better to not use SQLite for speed, but it's def. a quick solution that allows a lot of flexibility / hackability and saving game state, etc.

#

It's associated arrays / tables all the way down.

crimson hound
#

anyway, thanks for clearing some things up. I'll go watch the overwatch talk

normal silo
#

(And ECS systems also have the same indexing CS problems as databases and such depending on how you design it)

#

(Btw the allocating a big array once / region based memory management is why C programmers don't feel the need for garbage collectors and such (if they are doing memory management well rather than malloc and free everywhere (one can make memory management a non-issue)))

#

(Still the other issues with C though)

normal silo
crimson hound
#

damn, I'm half way through the talk and it's a gold mine of new information

normal silo
crimson hound
#

yeah that is clear to me

#

they're not really objects anymore, more like data structures

#

I suppose this is one way to approach the "expression problem" where you have multiple types and multiple behaviours

normal silo
#

These benefits can be achieved without a full blow ECS system, but an ECS is very generic like a database making it good for large teams and engines like Unity where there are no assumptions about the games and simulations being made with it that can be used to to simplify.

crimson hound
#

So I ran into a bit of an issue with ECS: some of my entities are located on a square grid. As I understand, they should have a component like location: (x, y). But what if I want to find all entities located at a particular point? Would it make sense to keep a hash map mapping points to entities

#

I could of course scan all the location components, but that's going to be O(N) for every search

grim hound
#

when I try to run this code it shows me a attribute error: 'level' object has no attribute 'create_map' while it does?

#

is there a way to fix this

crimson hound
#

yours are indented 1 level too far

grim hound
#

oh

#

so do i have to change what line is on?

#

@crimson hound

#

fixed it that helped

#

thx

crimson hound
frank fieldBOT
#

@crimson hound :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 105
002 | 1007
light flax
#

Does anyone have experience with licensing art assets under a different license than the source code ? I have my code under AGPLv3 and my assets under CC BY-NC-SA 4.0, with notice of which license applies where in the README. The AGPL license text file is in the project root and the CC license file is in the art assets directory, I'm pretty sure that should be enough but just to be sure...

crimson hound
#

sounds good to me

#

(IANAL)

dawn quiver
crimson hound
#

but I think it's pretty standard at this point

signal creek
#

What I'm working on currently

grim hound
#

@crimson hound

#

same problem again but with a different attribute

#

they are all lined up with the __init

#

nvm

#

fixed it

#

👍

untold crow
#

Hey, I'm sort of new to Python myself and interested in gaming. I've made 2 games using YouTube tutorials and pushed them to GitHub. I'm hoping to learn and develop my coding skills with everyone here. 🙂

vagrant saddle
#

you should not need await for reading a client socket, they can be made non-blocking.

normal silo
# crimson hound So I ran into a bit of an issue with ECS: some of my entities are located on a s...

You would have a 2D array where each cell has a list (or set) of entity IDs (only allowing entities with the grid component). Systems can query for all entities in a cell via that grid in O(1). When a system moves an entity with a grid component (from one cell to another) it must make sure to update that grid and the entity (some function somewhere that moves between two cells that each system can reuse). The grid is a way to do faster queries (effectively an indexing method like in a database but in this case spatial) and you will probably have several such indexing methods for various systems to use (probably trees or hashtables). These indexing objects can be passed to systems on creation.

#

You can also do what Overwatch did with the singletons.

crimson hound
normal silo
crimson hound
#

I guess there are special sparse arrays

normal silo
#

So yeah, row, col, value tuples.

#

(COO)

#

In numerical analysis and scientific computing, a sparse matrix or sparse array is a matrix in which most of the elements are zero. There is no strict definition regarding the proportion of zero-value elements for a matrix to qualify as sparse but a common criterion is that the number of non-zero elements is roughly equal to the number of rows o...

#

There are many ways to do sparse matrices though, depends on what kind you think you will have. I would go with COO generically when unsure.

#

Oh, nvm, they have a different term, DOK.

#

(Hashtable version)

crimson hound
#

COO sounds bad for insertion/deletion

#

and I doubt I'll get significant caching advantages in Python

normal silo
#

In general, just not storing empty cells (zeros) and instead tuples of row, col, value, but in the case of DOK the lookup/storage is done via hashtable (so really it's just a hashtable of row,col -> value, no need for a new data type).

#

COO in my experience has referred to either at times ((row, col, value) of non-zeros in general without more specific types like block or band matrices and such).

proper peak
#

it depends on what operations you do, e.g. if you do mat@vec then it's optimal to use, IIRC, CSR.

normal silo
#

Fast in-order iteration is key for matrix multiplication.

#

CSR/CSC is really good when one builds it once, and multiplies many times.

#

But for specific kinds of sparse matrices there are better.

finite solar
#

How much dependencies does pygame has?

dawn quiver
#

Hi!

#

I am a new one of this server.

dawn quiver
#

Anyone online

unreal river
finite solar
dawn quiver
dawn quiver
distant adder
#

Looking for someone who could teach me some trigonometry implementing in pygame

dawn quiver
primal otter
#

I have to do a mini game for a uni work, it have to use: loops, functions and lists. Any idea will be appreciate, in advance thanks you <3

dawn quiver
plush wedge
#

i made a quiz game….kind of

primal otter
primal otter
dawn quiver
primal otter
#

But, it have objects or classes? Cause I don’t see it yet :(

plush wedge
#

i made a Pokémon quiz,its mostly if, else and input statements but its pretty good for me being brand new at python

primal otter
dawn quiver
plush wedge
#

dont know how to loop it though so that it restarts

plush wedge
dawn quiver
plush wedge
dawn quiver
plush wedge
#

sadly i cant post it here due to the self promotion rule but i can message both of you the link

raven heron
#

As a senior python/c++/c# developer with 8 years of experience, I have rich experience with image processing such as
LPR, inpainting, segmentation and tracking and deep learning models such as MaskRCNN, fastRCNN, yolo, hyperLPR and so
on.

dawn quiver
#

hey guys

#

use unity

#

bestttt gggggaaaammmmmeeee engine

robust hearth
barren frigate
runic arch
#

hello, If I want to make a simple game like tetris and make a multiplayer mode, available on android/ ios/ browsers.

Should I go for flutter, unity or javascript to achieve this?

plush wedge
dawn quiver
#

Answering to MasterMole from #python-discussion,
It depends on your needs, what are some things you are looking for in a game library?

finite wharf
dawn quiver
#

Pygame is barebones and gives you full control and flexibility over the loop, after a few concepts you generally don't need to look into the documentation for anything, nor does it enforce a particular paradigm, you don't need to be super heavily familiar with OO to use it
Has an active community dedicated to it as well, if that interests you
It has 0 Python dependencies other than numpy which isn't really a dependency, you only need it installed when trying to use the pygame.surfarray module. It's built on top of C

Arcade provides more utilities by default, but you may end up having to reach the docs more often. It's also pretty easy for beginners, which is its main point . Has quite a Python tech stack, pymunk and pyglet to name a few (but you may end up using pymunk in pygame anyways, so having it nicely integrated with the library can be nice)

dawn quiver
#

So you wanted to make something that is entertaining to make?

#

And also presumably presentable, then games are a pretty nice option yeah

finite wharf
#

yes thats why i wanted to make a game

dawn quiver
finite wharf
#

i was just having second thoughts whether i should be going to making a game as i havent made anything like a game. even for very simple games , the code looks very complex

dawn quiver
vagrant saddle
dawn quiver
# finite wharf what else could i do

So many things, it's amazing

Honestly, for me personally only 50% of the entertainment factor is what I do, just being able to share it and present it is the other 50%
Discussing things is great
For example here is the website I'm working on, https://starreviews.herokuapp.com/

So what I'd recommend is doing something you could show off, how about making a little Christmas tree printer, with colours and all that! Will be doable with what you know, and most importantly it won't require you to keep dedicating time just to learn a concept in order to use it, since these are things you know

Short answer: try making something, upload it to a site (like github), and then share it, even if it's small it is super entertaining when people give feedback (for me at least)
Or, maybe join in and do some weekly challenges, it's fun to compete with others who are also trying (on discord), and you can learn from their solutions too

#

I found making this fun, heh

plush wedge
#

ok i’m trying to implement a dice roll and then if the dice rolls a certain number i want it to determine the object picked up relative to the number and the game keeps repeating an action relative to if the user picks up the item when they decide not to pick up an item

plush wedge
#

ok so i had to adjust some things but i think it’s an improvement and no errors so far

plush wedge
#

that if statement is leftovers from a more bloated and complicated code

finite solar
#

You wrote player.lives == 3 instead of player.lives = 3 maybe that's why

plush wedge
#

WE HAVE MADE PROGRESS

#

lol like my undertale reference

#

oh yeah can’t see it

plush wedge
mystic epoch
#

is a 3d python game without using prefabs and premade assets doable?