#game-development

1 messages · Page 43 of 1

subtle wasp
#

what's your keyboard layout

bitter marsh
subtle wasp
#

sure, thats what i was asking

bitter marsh
#

Here it is

#

I can show you the fn keys better because theyre at an angler

subtle wasp
#

ohh

#

so yours is the one that has a ?

#

click the one that looks like ` ?

#

do three backticks

#

then py

#

then your code

#

then three more with no py

bitter marsh
#

'''py print('hello world''''

#

Like this?

#

These are just apostrophies

subtle wasp
#
print:("Hello World")```
#

ohh

#

hmm

bitter marsh
#

maybe you can see better like this

subtle wasp
#

your keyboard doesnt have one

#

yeah

#

your keyboard doesnt have a backtick

bitter marsh
#

Oh alright then

subtle wasp
#

do you have any other keyboards?

bitter marsh
#

Thats unfortunate

#

The one on my pc

subtle wasp
#

the on-screen keyboard?

bitter marsh
#

No the one on the pc

#

I dont have a computer like one with a case and all that

#

I only have a pc

#

So it has its own keyboard

subtle wasp
#

ohh, do you have a laptop?

bitter marsh
#

Yeah

subtle wasp
#

@bitter marsh

#

alr

#

check below your esc key

#

send me a picture

bitter marsh
#

But i think it doesnt have a backtick either

subtle wasp
#

ill tell you where it is

#

send me a picture of your laptop keyboard

#

ill check for you

bitter marsh
#

Here it is

subtle wasp
#

same layout

#

you dont have a backtick

#

if you can

#

order a US model 60 or 75% keyboard off of amazon or walmart

#

or go to the store and buy one

bitter marsh
#

I think i know what to do

subtle wasp
#

see if it has something like this one it `

bitter marsh
#

Since i have two screens

subtle wasp
#

its a ` ~ key

bitter marsh
#

I could put a digital keyboard on the second that i never use

subtle wasp
#

do you use windows (specifically 10 or 11, i'm not too sure of older versions)?

bitter marsh
#

11

subtle wasp
#

your on-screen keyboard should have a backtick

#

go to settings

bitter marsh
#

Alright

#

what now?

subtle wasp
#

type onscreen keyboard in search

#

turn that on

#

look for a ` ~ like key

bitter marsh
#

I think the problem might be italian layouts

#

Because the digital one doesnt have it either

#

So if i just change it to american i might fix it

#

Yooo i got it

#

Thank you sm man

subtle wasp
#

yw

#

sorry for responding late im trying to fix my game launcher

vivid sedge
#

I know the basics of python, no pygame so just text, no visuals, and I want to test my skills. However, whenever I start a project I realize I am not at the level to do a project of that scale, and I was wondering if anyone had any basic game ideas I could try to make (no tutorial) so that I am able to practice my skills but not attempt something way above my knowledge level.

rapid charm
#

i just finished making a simple dice game. all input and print tho. its my first program. you could try that?

vivid sedge
#

That's basically the type of game I'm looking to make

#

How exactly did it play?

#

/what was the objective

rapid charm
#

called bones, ten thousand or 1's and 5's. i have a file outlining the game i wrote before i coded anything, i could drop that file here if you want

vivid sedge
#

Sure

rapid charm
frank fieldBOT
# rapid charm

Please react with ✅ to upload your file(s) to our paste bin, which is more accessible for some users.

rapid charm
#

exciting game when played in real life lol

rapid charm
#

if you code it id love to compare code

wooden night
frank fieldBOT
wooden night
#

Any suggestionsdice_question

final agate
#

Top ai use cases in game development for beginners to advanced

#

List

vagrant saddle
#

also multitouch option would be great to handle two analog hats at the same time

#

this could be really usefull with a html/svg bezel and pygame web mobile games which actually suffer from actually requiring a bt keyboard

vivid sedge
# rapid charm if you code it id love to compare code

sorry for not responding, phone died and I forgot. I think I'll start with rock paper scissors and try to add some flair to it, if you have any ideas that would be great, but if not ill send my code when im done

rapid charm
#

Awesome. No ideas yet but if something pops I'll pass it on. The "rock paper scissors" game would fit into an RPG nicely tho as a side thing. The dice game would too. Like a little game room at the local inn.

formal phoenix
frank fieldBOT
wooden night
wooden night
#

Also i added direction and vector output to it in the new code

gusty rune
#

Y'all made a game 👀

dawn quiver
cerulean nimbus
#

looks good enough for grassblades atm

marble osprey
#

making*

cerulean nimbus
# cerulean nimbus looks good enough for grassblades atm
def create_grass_blade_image():
    k = pygame.Surface((32, 32), pygame.SRCALPHA)
    blade_surface = pygame.Surface((8, 32), pygame.SRCALPHA)
    pygame.draw.ellipse(blade_surface, "green", (0, 0, 8, 32))
    
    # Straight blade in the middle
    k.blit(blade_surface, (12, 0))
    
    # Left tilted blade (rotated 20 degrees)
    left_blade = pygame.transform.rotate(blade_surface, 20)
    k.blit(left_blade, (2, 0))
    
    # Right tilted blade (rotated -20 degrees)
    right_blade = pygame.transform.rotate(blade_surface, -20)
    k.blit(right_blade, (14, 0))
    return k

grass_blade_image = create_grass_blade_image() #TODO: change to a png later
dawn quiver
# marble osprey what game are you makign?

Next stream will be Friday May 30th 10pm AEST.

Wanted to do something special for it, so I comissioned a kangaroo model, a few animations, and knocked up a ragdoll. I don't have much of plan besides I want this thing to chase and kill me and I want it to die.

My band This Is A Robbery is going to do a 20 minute acoustic set around 12am also.

▶ Play video
cerulean nimbus
#

looking clean :)

#

not even a sprite just coded it :)

cerulean nimbus
#

some improvements for now

#

dont question the scaling of the money just for testing purposes

coral sparrow
#

Import "pygame" could not be resolved can someone help???

robust raft
#

@coral sparrow Did you install the package with Pip?

karmic summit
#

Heya idk if this is breaking rules bc idk if this is off topic or not since it is kinda on the topic of game dev and I don't know if I should put this in the help section since I do need help but this isn't on python or anything so I wanna get pico 8 for free so I found this free git hub version but idk if the file has any virus or smthing I need help finding out if it is a virus or not bc I want to make a game using pico 8 here's the file: https://github.com/drerx/PICO-8_free

GitHub

Contribute to drerx/PICO-8_free development by creating an account on GitHub.

broken kayak
#

Anyone that can Help me make my game? I still have the wish but since ive gotten my pc taken away, i need help from ppl to help me

livid bronze
#

Let’s make a iOS game where you collect boxes kinda like pokemon cards each box has a fun unique value inside 😮‍💨. Boom billion dollar franchise

stray goblet
#

Hey Guys! I'm a newbie here, if anyone would be kind enough to tell me from where I can start in this domain, I mean it has been an interest and now I want to pursue it full time.

stray goblet
coral sparrow
stray goblet
coral sparrow
#

okay

#

sorry

#

you can make easy games with terminal or you can make using pygame

stray goblet
#

Okay, so I would have to explore pygames. Thanks

coral sparrow
#

from start i rather to make games in terminal something like this

#
import random
while True:
    yesorno= random.randint(1,2)
    question= input("ask question: ")
    if question== "end":
        break
    if yesorno== 1:
        print("No")
    if yesorno== 2:
        print("yes")
#

to know the basics

#

but if you want to make games in pygame

#

you need to install it

stray goblet
#

The guessing games, yeah I have tried them

#

Like where we try to guess the numbers within certain attempts no?

coral sparrow
#

this game is something like ouija board

#

you ask and the program tells you

#

so you want to do games in pygame?

stray goblet
#

Yeah but I think for sometime I should work on some terminal ones too

coral sparrow
#

i can help you with some basics in pygame

#

i'm begginer but i know something

stray goblet
coral sparrow
#

okay you need to install pygame you know how?

stray goblet
#

Through pip?

#

No I don't know that

coral sparrow
#

yes through pip

#

pip install pygame

#

insert it in terminal

stray goblet
#

Okay

coral sparrow
#

terminal python

stray goblet
#

Look at this one that I coded a few months ago

coral sparrow
#

it's good

stray goblet
#

It has twist in it

#

There's no option to make a draw

#

It's either win or lose

merry basalt
#

hey im new to coding
ive only done the basics but i want to try to make a game

i was wondering how to start and which language would be the best for new coders

stray goblet
#

I'm also moving in that direction, I'm also a beginner so I have thought about exploring pygames first

merry basalt
#

tbh idk which type of game i wanna make

#

i just wanna browse for now ig

stray goblet
#

Oh looking for ideas, Nice !

pine smelt
#

ts like a good foundation for using a game engine, but some ppl prefer going straight into an engine like unity or something that uses C# iirc

merry basalt
#

ight thanks ima try them and give feedback

#

but tmmr not today

im tired now :/

wet tide
#

Im making my first ever game for a project and I want to make a game without watching a full blown how to make a game tutorial. Could anyone recommend me how to figure out things like how to jump in a game or should I just watch a tutorial on those sorts of things

livid bronze
stray goblet
manic chasm
#

hii

wooden night
#

How do u do .py -> .apk free and in windows

#

Also my game is using pygame-ce

vagrant saddle
vagrant saddle
wooden night
#

@vagrant saddle ok

gaunt nacelle
#

are we allowed to talk about gdscript (it has a lot of functions and things similar to python)

gaunt nacelle
gaunt nacelle
#

your welcome

marble jewel
#

I just thought I would leave this here. It gave me a laugh when it took me off guard

tired reef
#

I'm getting a cycle error

manic chasm
#

oh miss this game

hoary sphinx
hoary sphinx
sleek gust
#

how do y'all go about promoting your game

wooden night
#

i have made a dual joystick which works for both(finger touch and mouse) but i don’t really know it works with finger or not… so any suggestions?

frank fieldBOT
wooden night
agile fable
#

If anyone has uploaded a app onto the apple app store using react native please message me.

slate tiger
#

there are a few new difficulties

#

an important one is World's End

#

on World's End you spawn with 800 health this time

#

on grandmaster+2 you spawn with 1000

#

on grandmaster+1 you spawn with 1100

#

DX243 if you're reading this you can also add these to your game

wooden night
viral estuary
#

maybe its a python thing that you can only do with giant code blocks

wooden night
#

How do u code?

#

Because I suck at organization

viral estuary
#

no i program in c.

wooden night
#

Oh

#

Doesn't it uses class for like everything?

#

I tried to learn C# for unity but focused on pygame more

#

Btw I made the code in Ipad 💀

hollow whale
#

Are there libraries available that implement geodesic walking on an STL surface, given some travel direction? I know there are libraries that can calculate the geodesic distance between 2 points, but what if you don't know the endpoint in advance?

proper peak
#

Huh, that's an interesting question. I think if you only have a direction, you can walk by repeatedly making small steps in the given direction and then projecting onto the surface (and projecting the walking direction onto the tangent plane at the new position). For that you'd need to be able to find normals to the surface at any point.

gray matrix
sand otter
wooden night
# gray matrix what?

Like if u need to code in C++ or in object orented and compiler programming u need to create a class... right? For ex. In c# (I think) you have to do void name(); and then write code inside for it to work... Right?

hollow whale
#

And also crossing edges seems tricky

proper peak
#

Accuracy is probably not an issue unless you're calculating distances or something? Edges are indeed a problem, specifically I think this algorithm can't handle an edge with a turn of more than 90 degrees.

pearl zinc
#

Hey, I have made blackjack in python, and now would like to display it nicely in the terminal. I'm considering the cursus module or rich/textual. Any recommendations?

vagrant saddle
#

vt100 is semi-graphic / vt420+ can handle graphics

pearl zinc
#

Nothing too complicated reslly

torpid rivet
#

hola amigos

#

i just want to ask is their a dedicated game engine that uses python

granite anchor
vagrant saddle
torpid rivet
torpid rivet
vagrant saddle
#

Harfang Studio , UPBGE maybe

#

and not sure you can see/change/add python code, they are higly integrated but please try and tell about

vagrant saddle
proper peak
#

tbh GDScript is probably about as close as you can get to scripting "in python"; the syntax and features are similar.

cerulean nimbus
#

seems well still a lot of bugs its an old project im retrying. changes rn are instead of the user needing to set up certain stuff in there code it get the window of the process using win32 and embed it in the pyside application.
further improvement i would want to implement is smoother transtition on the embed entering and exiting the window and make the embedding more stable cause in some edge cases this can happen

#

the embed entering and exiting the window and make the embedding more stable cause in some edge cases this can happen its in the frame but not showing correctly

jagged lava
#

Hello, I'm new to python and learning a lot. I have constructed two games with pygame and actually enjoy the game development aspect. I started looking into Godot and Unity to work my way into learning those after I make a few more games with pygame to get a better understanding of things.
For a beginner trying to learn and work to making more complex games over time, would you recommend Godot or Unity?
I looked into Godot and tried to play with it but it is still a bit confusing to me, I have not tried fiddling with Unity yet.

rare hatch
#

Hi Guys i just finished my frist full game on python i would appreciate u guys if u would test it for me and look in the code for bugs

ivory rock
#

I am looking for help which I detailed in this post: https://discord.com/channels/267624335836053506/1397050189197344768

I am trying to read a linux device file for a Belkin Nostromo n50.

Linux recognizes the device as a joystick.

How do I resolve this message:

Traceback (most recent call last):
  File "~/.config/pystromo/./pystromo-remap.py", line 51, in <module>
  output = devices.OutputDevice()
  File "~/.config/pystromo/lib/devices.py", line 665, in __init__
  self.node = ioctl.OutputNode()
  ~~~~~~~~~~~~~~~~^^
  File "~/.config/pystromo/lib/ioctl.py", line 243, in __init__
  self.createDevice()
  ~~~~~~~~~~~~~~~~~^^
  File "~/.config/pystromo/lib/ioctl.py", line 313, in createDevice
  encoded_data = [bytes(item, 'utf-8') for item in USER_DEVICE_DATA]
ivory rock
#

I do not possess sufficient understanding of what this code does, nor know what to study for developing a comprehensive understanding.

What should I study to develop comprehension?

vagrant saddle
formal phoenix
rare hatch
#

OK

formal phoenix
rare hatch
#

nah

#

only the lists and thats it

formal phoenix
#

aha ok

rare hatch
#

like the snaks list food and water

formal phoenix
#

its a simple game

rare hatch
#

i mean im not that pro

formal phoenix
#

you wana try a game i made?

rare hatch
#

yh

formal phoenix
#

check dm

rare hatch
#

ok

drowsy crater
#

what are good modules to strat making games

#

start*

vagrant saddle
devout citrus
#

anyone expert in code can help with game auto script?

drowsy crater
#

@vagrant saddle thanks

#

@devout citrus can you explain what you need?

devout citrus
drowsy crater
#

which io game

#

is'nt it against the game spirit and maybe against the game terms

#

idk

#

i can't help with that

devout citrus
#

the creator doesn't care

#

me and my teammate already developed basic scripts....but we want powerful script like that clan

drowsy crater
#

1 min lemme check

#

um so i checked and i found out that even though explicitly stated it could be a bannable offence and is considered bad proactices

#

practices*

devout citrus
drowsy crater
#

well i cant help

devout citrus
#

nvm, thanks for the help

drowsy crater
#

your welcome

blissful jasper
#

Hi guys please suggest to me what I should add in my GitHub profile

topaz delta
# rare hatch

cool! have you though about turning it into a GUI?

topaz horizon
boreal sigil
#

Things where he can show off small flourishes in code, im sure he wouldn’t be asking if he had thorough and professional projects to list lmao

cerulean nimbus
#

Is there a way to manipulate pygame mouse pos on startup

#

Cause its only updating when your on the window focused and starts at 0,0

drowsy crater
vagrant saddle
#

to nothing, and that's a bit of a problem doing 3D with pygame-ce. It does not have a scenegraph ready to use unlike Panda3D.

drowsy crater
#

@vagrant saddle

midnight tusk
#

Making my own storage language with custom syntax highlighting I know firebase and MySQL but I wanted to do my own and when downloading the file it’ll be encoded in my own language thought son the syntax highlighting ?

vagrant saddle
drowsy crater
#

@vagrant saddle well would you reccomend panda3d and if yes could you link to some tutorials. btw does panda3d have raytracing?

vagrant saddle
vagrant saddle
# drowsy crater can. you explain

it is beginner friendly but you can go up to commercial games ( proven ) . Begin to master it, don't chase nice features that actually only some people have on their (very) expensive gpus. Seeking extra feature and updates would distract you from the most important : acquire required skill to make the game.

drowsy crater
#

@vagrant saddle is Ursina engine better than panda3D for my use case?

sweet shard
coarse gyro
#

How can I make this type of animation? Is there library for 3d linkages

glass light
solar portal
#

W

sweet shard
wooden night
#

How to create deltatime?

sinful meadow
#

👋 Hey everyone!

I’m Abdelrahman – a student from Egypt 🇪🇬 learning Python by building desktop games.

I just launched my first public project:
🎮 A bundle of 3 small desktop games built with PySide6 (Python GUI)

✅ EXE builds
✅ Full source code
✅ Bilingual README (English + Arabic)

I’d love to hear your thoughts or feedback 🙌

🔗 https://www.producthunt.com/posts/python-games-bundle

(Let me know if anyone else here has built games using Python!)

Product Hunt

A bundle of 3 Python desktop games built with PySide6. Each game includes EXE, source code, README (EN/AR), and custom mockups. Ideal for students and Python devs.

glass light
wooden night
glass light
wooden night
#

Did u ever get performace issues?

dreamy cliff
#

Can anybody suggest a beginner friendly game you develop in python

small beacon
#

Little text based RPG im working on. Its not the best i only started learning python acouple of months ago but i do have alot of background in C++ understanding the massive syntax change has been a messy situation

alpine dock
#

I need ideas for a new game

#

Idk where to get them from

small beacon
#

shits goated

covert rose
grim parrot
alpine dock
small beacon
covert rose
alpine dock
sleek gust
#

How do I create audios for my game? I don't wanna use stock audios

tranquil girder
#

You record them with a microphone

sleek gust
vagrant saddle
tired reef
#

im getting a NameError: name 'Game_Running' is not defined
when it is defind

slow copper
#

and are u importing the correct file

tired reef
slow copper
tired reef
#

C:\Users\casti\AppData\Local\Programs\Python\Python313\Lib\site-packages\pygame\pkgdata.py:25: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
from pkg_resources import resource_stream, resource_exists
pygame 2.6.1 (SDL 2.28.4, Python 3.13.5)
Hello from the pygame community. https://www.pygame.org/contribute.html

#

it hasent made the window

#

any ideas?

slow copper
#

either try creating a pytest.ini file with this in it-

[pytest]  
filterwarnings =  
    ignore::DeprecationWarning:pygame.*

or try degrading your setuptools version

tired reef
#

#screen
for color in colors:
screen.fill(color)

tired reef
#
class Health_bar:
    def __init__(self, x, y, w, h, MAX_Hp):
        self.x = x
        self.y = y

        self.w = w
        self.h = h

        self.hp =  MAX_Hp
        self.MAX_Hp = MAX_Hp

    def draw(self,surface):
        # calculate health ratio
        Health_ratio = self.hp / self.MAX_Hp
        pyg.draw.rect(surface, "red",  (self.x, self.y , self.w, self.h))
        pyg.draw.rect(surface, "green",  (self.x, self.y , self.w * Health_ratio, self.h))

#

could someone test this code?

bold hill
#

Is there a way of making a developer mode so if something is reportedly wrong or to test the game it runs?

lean cosmos
crimson totem
spring zealot
spring zealot
tired reef
#

in earlyer projcts it broke

spring zealot
tired reef
#

i dont know it was just broken dont know how or why

spring zealot
#

Yeah but like what was the issue, syntax error? Not drawing correctly? Not sliding with variable?

#

Because most issues probably come from where it's being used not the code itself

fathom gyro
#

wait i can make games in python? i thought it was a web development and coding to contoll your computor kinda laungage

#

how? what are some codes for inputs and making sprites move

slow copper
fathom gyro
#

oh i see

slow copper
fathom gyro
#

no not at all im new new

slow copper
#

Pygame is an SDL wrapper which allows you to make graphical stuff likes games

#

You can check that out

fathom gyro
#

thank you i will

slow copper
# fathom gyro thank you i will

You can also check out ursina if you're looking for a game engine type library, you'll have to do quite a decent amount of document reading since there arent many yt tutorials of it

fathom gyro
#

okay i might have to look up a couple tutorials

small beacon
#

Yeah im still working on it.

#

Im down to start a newTextRPG project with you if you want

covert rose
versed garnet
#

For code review, do I just post my github link here?

covert rose
crimson totem
#

I am working on a game I am just making sure I can post screenshots here or only certain people can post here I am wanting to get feedback on how to expand and improve my game

versed garnet
#

Yeah, made a post in python help and was directed here so just making sure of the rules

crimson totem
#

it is

limber veldt
#

It's okay to share screens here, I've done it quite a lot, even some short vids

covert rose
versed garnet
#

Hi! Finally got Github to cooperate, so now I’m looking for review on my first full on project with coding.

I’ve done Python and Html in bits for a few years now, but only with codecademy book learning, never a full on project. So I built this mini game (Kritikal Maze) using Python

Admittedly, I did use Chatgpt as a resource as I’m new to many of the concepts it introduced and I had it take me step by step as my goal isn’t to just throw stuff together for me to copy and paste, but to actually learn, so everything is typed and I tried commenting for better understanding of some lines, so if there’s anything that’s just wrong or impractical, please let me know!

All feedback/criticism welcome

https://github.com/Andredabeast/Game-Portfolio

GitHub

Contribute to Andredabeast/Game-Portfolio development by creating an account on GitHub.

versed garnet
#

The idea of the game is to promote critical thinking in a fun way, primarily for the youth, but many adults these days lack what I consider basic critical thinking so just something small.

versed garnet
covert rose
crimson totem
#

there i had to find it in my files lol i forgot my snippits go to my documents

versed garnet
crimson totem
#

i have some questions do you know how i could move the gun to the side of him and make a blood partical effect when you click/shoot him maybe get an actual gun object instead of a moving png

crimson totem
#

a southpark character

covert rose
crimson totem
#

i dunno the copyright stuff so i aint gonna release it for awhile if at all unless i replace stuff

crimson totem
#

it is VERY buggy

covert rose
versed garnet
crimson totem
#

and 5000 lines i was wanting to see if it was possible to shorten the code and still have everything work the same

versed garnet
crimson totem
#

also my one gripe with it so far is that the characters have white boxes with them becase the way they were added they are pngs

covert rose
versed garnet
crimson totem
#

ig i was wrong i had no idea how long the lines of code would be

covert rose
crimson totem
#

i wanna find people to work with too

#

i have a friend but he isnt serious about it

#

he wants to do it but not take the time to learn it

#

he is like that is too hard

covert rose
crimson totem
#

i cannot do it my guy you cannot do it unless you try

#

he does about 5 lines at a time before quiting

covert rose
crimson totem
#

with about whatever comes to mind pretty much

#

i just aint creative what what i come up with

#

i got most of every idea from roblox

versed garnet
# crimson totem i wanna find people to work with too

I def wanna get a few people together to do random projects with and eventually an actual game we can sell on steam for example. Right now I’m still in the basic learning stages before I decide to tackle that

crimson totem
#

i can understand what code does pretty well just not writing it really

covert rose
crimson totem
crimson totem
#

i added a mining side area

#

a wip boss button that brings you to a crab boss from the show

#

and i have a terrible inventoy system i dunno if it is that bad though i just dont like it

#

i made it more interesting with pressing i for inventory

#

i got a game menu which is suppost to play the main southpark themesong but it broke during the development

#

i have settings in it save files and the play button for starting the game

covert rose
crimson totem
#

like i said very buggy for example autosave plays a looping save noise

covert rose
#

in order to progress.

versed garnet
crimson totem
#

just accept my friend request when your ready

frank fieldBOT
#

Please react with ✅ to upload your file(s) to our paste bin, which is more accessible for some users.

spring zealot
#

grrr

frank fieldBOT
spring zealot
#

ima get roasted for my if spam

#

im tierd i forgot elif exists :3

small beacon
covert rose
covert rose
#

pip install hpe

small beacon
#

Whole engine in 1 py file is crazy

covert rose
torpid rivet
#

this is really great

past pebble
versed garnet
#

I just discovered this 20 game challenge thing, so reading into Godot right now

covert rose
past pebble
#

what else u used?

frank fieldBOT
# covert rose

Please react with ✅ to upload your file(s) to our paste bin, which is more accessible for some users.

past pebble
#

great job btw

versed garnet
#

I’m about to start this Dodge the Creeps! project in godot as an entryway into me doing the 20 game challenge

versed garnet
#

The challenge or the dodge the creeps?

fathom gyro
#

the game itss3lf

#

itsself

versed garnet
#

Just simple 2d game where you move the char around the screen dodging the enemies

fathom gyro
#

thats cool! can I be a tester?

versed garnet
#

Starter thing before I try to figure out how to make Pong

versed garnet
fathom gyro
#

i tred then failed then stoped because I relized I was coding in C# and not python

fathom gyro
versed garnet
fathom gyro
versed garnet
fathom gyro
versed garnet
fathom gyro
#

yea I know im going to ty again with some simple displays and things

wooden night
#

Which game engine uses python for its game dev lang?

#

I know unity is only for c# and only py extections but i don't know about others

spring zealot
#

But

spring zealot
covert rose
covert rose
covert rose
#

Its not really python based originally at the end.

vagrant saddle
vagrant saddle
#

same goes for pygame(-ce)

wooden night
slow copper
naive tendon
#

Hey guys I am trying to import the image but for some strange reason it couldn't recognize the file despite having it in a same dicrectory.

spring zealot
#

c://projects//...

naive tendon
crisp dagger
#

(sorry for ping)

naive tendon
crisp dagger
#

or search on google

#

pip install image

naive tendon
crisp dagger
#

idk

slow copper
#

Idk from where you got the photos directory from that image

slow copper
crimson totem
#

anyone wanna team up

#

i am feeling dumb rn

#

bc i cannot figure out where to start with coding i watched so many videos and i still cannot figure out what i should type out first even though i know how the code works

spring zealot
crimson totem
#

a clicker game

spring zealot
#

What module are you gonna use

crimson totem
#

i was using tkinter

spring zealot
#

For game dev I recommend pygame

limber veldt
#

For pygame, I recommend pygame-ce, the Community Edition

spring zealot
#

https://youtu.be/y9VG3Pztok8?si=BOmgfuAZdsQE1VmT this a good video on where to start it's what I used and you can also use the docs after https://www.pygame.org/docs/

In this video I will explain how to get started in Pygame from scratch.

This is aimed at those who have not used Pygame before and will go through the steps of installing Python, installing Pygame as well as looking at a few different editor options.

Then I will explain the basic structure of a game and put together some simple code to demonst...

▶ Play video
spring zealot
limber veldt
#

It has a couple of extra methods that are really handy, like get_frect() and both key and mouse get_just_pressed() among other updates

#

Fully backward compatible with the original pygame so old projects will work with it just fine

#

And it's made by much of the same people

spring zealot
#

Does it have subpixel rendering?

limber veldt
#

That I don't know

spring zealot
#

Floating point rect right?

limber veldt
#

Yes

#

This way position updates on the rect can be floats, and reading it returns floats

spring zealot
#

Yeah I just don't get why it needs that If there's no subpixel rendering

limber veldt
#

Makes it easier to do physics

spring zealot
#

I see, physics are pretty easy already might check it out still tho

limber veldt
#

Like your physics says some sprite needs to move some non-integer amount in some direction, say 2.5 pixels along the x axis, so you add that amount to the sprite.rect.centerx. Now if you check the position of the sprite with the old rect, it will have lost that .5, but with frect, it won't

spring zealot
#

Yeah but visually there's no difference and you can handle the physics either external floats and just round them into the rect after, same thing

#

I guess it's easier tho

limber veldt
#

Which is why without frect, one usually needed to keep a position attribute as a float and do all your physics on that then just update the rect where losing the float doesn't matter any more because the position is tracking it anyway

#

Yeah, it's not a huge change but it's a nice qol improvement, I use it for everything that moves

spring zealot
#

I'll check it out for sure just probably won't use it unless it adds some things I really need

outer pier
#

Hi everyone im looking for a place where I can find a developer for my project, is there any channel in this server where it is allowed?

limber veldt
#

The get_just_pressed() methods are pretty cool too. You can check for keys or buttons outside of the event loop

#

Regular pygame has get_pressed() which checks for held keys or buttons, get_just_pressed() checks any that were pressed during the current frame

spring zealot
#

Why would you need this tho?

limber veldt
#

More functionality, why not?

crimson totem
#

do you guys like the game idea

spring zealot
crimson totem
#

Yea

spring zealot
#

i mean

#

its kinda js a type of game not a game idea

#

good place to start tho

coarse hill
#

!ban 987029906561056828 nazi stuff

frank fieldBOT
#

:incoming_envelope: :ok_hand: applied ban to @eager scarab permanently.

spring zealot
lone trellis
#

Guys in PyGame when drawing a rect or a circle does it come with a collision?

lone trellis
naive tendon
limber veldt
#

Should be just spaceship_yellow.png since your cwd is Galaxy wars and the png is in that folder

#

Or at least that's what the screenshot shows, I can't exactly know how you've changed things

naive tendon
#

readable?

limber veldt
#

Try removing "Galaxy wars", from the string, so it's just the image name, this screenshot doesn't show your cwd but I assume it's still Galaxy wars

naive tendon
#

IT WORKED!!

limber veldt
#

Like, if your current working directory is Galaxy wars, having that in the load is redundant and wrong

limber veldt
#

That would be looking in Galaxy wars/Galaxy wars/spaceship_yellow.png too many Galaxy wars in the path

#

No problem

#

If unfamiliar with current working directory, this line shows it

sullen gust
#

Just posting here to help further my discussion in general

#

Any Tarkov players?

spring zealot
sullen gust
spring zealot
#

This shit

sullen gust
sullen gust
# spring zealot This shit

And no offense but you are gatekeeping a ball pit. Maybe graduate from pygame if your goal is trash talking lmao.

#

Here's my terrible game though, I did post in the wrong channel earlier so my bad on that. Its also C++ but you probably could make it in pygame. I'd rather be sharing stuff than talking shit because validation comes from users and dollars and jobs.

#

I was trying to build an engine for a falling sand simulator + some other stuff. Like more complicated simulations on a smaller scale in a snowglobe or a container. I REALLY wanted to try and revolutionize it to get these kinds of fluid dynamics in there, but I've been told its just not possible to get those more complicated simulations with live input working. But on a smaller, contained scale, I could maybe get it done.
Like this one.

#

This isn't mine just a sample from an italian guy.
Anyway I needed to try and produce some money so I have put it off for this tarkov tool.

#

Reason its not possible supposedly is because cellular automata you would normally rely on to keep operations low on a falling sand simulator, doesn't apply here. It uses D2 Q9 for flow simulation and https://docs.tclb.io/models/flow/d2q9/d2q9/ basically the direction is transferring between pixels, which is a lot more expensive than just checking your position, nearby pixels, and then moving (falling sand). Exponentially more operations per pixel and 10x+ the total memory. So I could maybe setup a jar with liquid and then have the overall system respond to changes in the jar, without complicating the simulation and making it bigger than 10-20 pixels wide. idk. Have to make money so I can "retire" and work it out.

#

Also could just make more boring particle simulation where particles dont interact, like a basic snowglobe, lights, etc...

#

The guys who made Noita put out a lot of content on the topic though so if anyone is interested you could check them out and he goes through in detail pretty well on their whole development process.

spring zealot
#

Not game play

spring zealot
spring zealot
raven kernel
sullen gust
sullen gust
sullen gust
# spring zealot And not only is this not python it's not even good, so please. Don't get salty a...

But yeah "not even good" was implied when I said you could make it in pygame 😂 The goal wasn't to make the best falling sand simulator. It was to make a falling sand simulator that incorporated fluid dynamics with up to millions of pixels or in a at least 1000x1000 pixel window. So C++ or Lua were the main options to build it to try and maximize efficiency. But as I said since then I've been disabused of the idea that it would be possible without some near genius mathetmatical breakthru.

spring zealot
sullen gust
vagrant saddle
#

and there are still a bunch of newbies that don't realize python can be compiled or GPU accelerated

spring zealot
sullen gust
#

but definitely crashed out

sullen gust
vagrant saddle
#

pythran , codon , numba ....

sullen gust
# vagrant saddle pythran , codon , numba ....

I am not up to date on most things python, so I was more asking if they were using anything new to accomplish that. Off a quick google it looks like the main addition in the past decade has been GPU acceleration. I'm sure with that + the compiliation it's near the same level of performance but just seems like hassle compared to the existing tools that are already that fast.

#

Whats the draw in your opinion

#

I guess main reason would be staying connected to the python ecosystem, but that's always the answer I come to with using python. I wouldn't be using it on my app if it weren't for openCV.

#

Idk just seeing a lot of caveats the more I read about pythran and codom and numba

tired reef
#
import pygame as pyg

# import stuff from settings
from settings import Game_Running 
from settings import game_colors
from settings import window_dimentions
#game assets

# import from entitys

  
# indecator bars
from player_bars import Health_bar
from player_bars import Hunger_bar
from player_bars import Thirst_bar
from player_bars import Experiance_bar



#===[init]===#
pyg.init()

#screen dimentions
screen = pyg.display.set_mode(window_dimentions)

dt = 0
clock = pyg.time.Clock()

pyg.display.set_caption("jhon")
while Game_Running:
  
    for event in pyg.event.get():
        if event.type == pyg.QUIT:
            Game_Running = False

    dt = clock.tick(60) / 1000
pyg.quit() 
vagrant saddle
tired reef
#

I got it fixed

wooden night
#

Should i make my game as a class or like a function?

#

In pygame

robust egret
tired reef
# wooden night In pygame

Well you're going to have to use classes depending on what you want for monster player etc you don't have to but it's easier it keeps it more contained

wooden night
#

I do use classes for entities but like the main peice of code?

#

Like:
class game:
Def init(self):
Self.screen = pygame.display.set_mode((200,200))

Def run(self):
     While true:
            ...
limber veldt
#

Really depends on the project for me

wooden night
limber veldt
#

I have some projects that use a Game class, simple little projects usually don't

#

Usually just experiments that don't get a Game class, actual games, I start with my own Game class template and go from there

wooden night
#

Ok

limber veldt
#

Just messing around there

#

Entities made from a class but lacks any Game class

wooden night
#

@limber veldt thx really helped a lot

limber veldt
#

No problem

wooden night
#

Can some explain me Vector2 cause its confusing

limber veldt
#

A way to store coordinates and provides methods to do math with them

#

As for how to use them, that's a bit more complicated

#

Say I have object and I want to know how far/in what direction for it to move to get to a different position or coordinate, with vectors, we can get both of those, distance and direction

#

This playlist covers vectors well, not specifically pygame.Vector2, but in general https://www.youtube.com/watch?v=fjOdtSu4Lm4&list=PLImQaTpSAdsArRFFj8bIfqMk2X7Vlf3XF

Primarily for my students at FutureGames - I will only read chat/superchats during breaks!

Find out more about the school at https://futuregames.se/
❓ FAQ ❱ https://acegikmo.notion.site/FAQ-8b62a1634746473db702565d890dd3dd

💖 Support me on Patreon ❱ https://www.patreon.com/acegikmo
📺 I usually stream on twitch ❱ https://www.twitch...

▶ Play video
#

I also like the Nature of Code series from youtube's Coding Train, not python but his white board explanations are excellent

normal silo
limber veldt
#

I learned how to make games when I learned how to use vectors, pretty important concept

wooden night
#

Oh

tired reef
#

Can I have some help with a class please

#

The classes for player movement but also monster movement so I don't have to go to a separately I was going to go to those separately but might as well make a main class that can inherit some parts of a file

white sonnet
frank fieldBOT
shut path
#

Bro is python good to make visual novel game

#

?

slow copper
#

If I'm not wrong ddlc was made using that

spring zealot
slow copper
spring zealot
mint patrol
#

o/

#

can someone help me update some code? I've been spending hours with chatGPT to try and get this to work, and no solutions provided actually work

#

I'm not actually sure if this is the correct channel - essentially I need to update one of the files in DougDoug's code because he uploaded his code a year ago, and old usages no longer work. It was way too difficult to try and get everything to work with the older versions of the requirements

rich sigil
#

Can anyone here know about ursina engine! I want to build a car racing game! How can I build this

tranquil girder
spring zealot
wooden night
#

Can someone explain decorators in simple terms?

#

I saw many examples but still didn't understand

vagrant saddle
# wooden night I saw many examples but still didn't understand

it is just syntaxic sugar ```py

def decorator(fn):
def decore():
return f'decorated-{fn()}'
return decore

<3 @ syntax

@decorator
def fun():
return 'funk'

print( fun() )
del fun

but without @ syntax it is not pretty

def fun():
return 'funk'
vars()['fun'] = decorator(fun)

print( fun() )

errant iron
warm edge
#

Where do I start when considering getting into game dev?

errant iron
# warm edge Where do I start when considering getting into game dev?

Start by thinking what your goals are. Job in the industry? Making stuff for fun? Making stuff to potentially sell? Those questions tend to shape the technology you need to learn. Then the type of game you want to make and the technology you’re using helps to determine the skills you need to learn.

covert rose
#

today i add simple but working Terrain Sculpting tools we also hit 2k downloads!🎆

#

i look forward to anyone who wants to contribute and help us in this project.

rancid ibex
#

import sys
import pygame

pygame.ini()

screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Pygame!")

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

screen.fill((255, 255, 255)) 
pygame.display.flip()                                How does this code not work? please help
vagrant saddle
rancid ibex
#

ok thank you

rancid ibex
vagrant saddle
#

you miss the t

#

init()

rancid ibex
#

And that doesn’t work

lofty moon
#

does anyone have any tips for my game engine like how to import my previously made software and integrate it into building the users own characters?

covert rose
lofty moon
covert rose
errant iron
wooden night
granite ginkgo
#

is anyone here free to make a realky good project with me?

lofty heath
#

yeah, i 'm here.

pliant latch
#

why?

covert rose
covert rose
covert rose
# pliant latch why?

Because i HATE game guru & game guru Max , They promised many things and deliver nothing Even their company is even older than UNITY 3D.

outer moth
#

hie!!!!

covert rose
#

Even as an engine that completely created inside python it loads pretty complex models very fast and i am proud of it.Plus we have daily / weekly updates for both github And PyPi website keep fixing remaining Bugs and adding new features.

shut kettle
#

Who would like to join i am creating q game

#

Who would like to

pliant latch
#

however im not sure how good itll be since u know there are some limitations

covert rose
covert rose
# pliant latch if am honest it looks great

Im a developer tired of EMPTY PROMISES and the paid engines floating with bugs OR if they are bug less , they are very old OR hard enough in scripting to write thousand lines of code to simply move a single object, im aiming to create an engine and a community that everyone can create any fps games with ease.(even supporting third person out of box.)

calm vessel
#

@narrow marsh

pliant latch
#

that is great mate

covert rose
topaz horizon
#

https://paste.pythondiscord.com/JUBQ
trying to challenge myself to make a game in tkinter. the code is too long to post so i put it here
pip install opencv-python is required
fyi it does use ur webcam at a part (to spook u) nowhere near finished. only the very first part finished. It is a horror/puzzle game

#

can anybody give me advice on how i can better format this? its pretty poorly formatted right now ive never made a game before

wooden night
#

What is the basics of raytracing?

cerulean nimbus
#

this is a video that might be of help

wooden night
wooden night
#

But how do i create it? Like a 2d to 3d raytracing in pygame?

cerulean nimbus
# wooden night But how do i create it? Like a 2d to 3d raytracing in pygame?

I made a ray tracer(path tracer) from scratch in python. This video is much more laid back in terms of editing and animations than the other ones, so tell me if you like it more!

although I forgot to mention it in the video, this would not be possible without: Ray Tracing in One Weekend
https://raytracing.github.io/books/RayTracingInOneWeekend....

▶ Play video
#

maybe this can help i scanned through it and looks solid

#

you could also maybe get the logic explained in c++ or c# and try to translate it yourself to python since its an equation anyway

#

once you get the logic you should be able to apply it

normal silo
#

In its most basic form it's very simple, easier than other rendering methods. The hard part is not having it be slow at scale.

#

(Just ray to X intersection testing (so you need some linear algebra for the camera and the intersection))

#

(If you are starting out with game development you will need to learn some of this math first)

errant iron
#

Be warned that it’s going to be terribly slow to do raytracing in Python.

normal silo
#

(Or to a tiny surface which is then stretched across the screen (low resolution, but not a tiny window))

errant iron
#

Sure, it’s not like it’s not possible to implement, just that you’re limited as to the number of pixels you can realistically render. I love Python but anyone strongly interested in rendering tech probably needs to consider a more performant environment.

normal silo
errant iron
#

Totally. But then you’re having to learn shaders alongside Python. Personally I’d approach this by doing it on the CPU in C++. Easier to learn when there’s only one language in the mix. Just an opinion though.

errant iron
#

That’s new to me. Could be interesting to a new learner, certainly.

normal silo
#

There are a lot of Python libraries out there to do things a lot faster without leaving Python, since Python itself comes with a parser for itself.

#

And now has type hints which can be used to actually statically type stuff too by these libs.

#

Needing to leave Python is rather rare for most people's cases.

#

(Before even going to Taichi, simply using Numpy will get you a decently small resolution, ray tracing is simple but just wants a lot of number crunching compute and is really easy to parallelize making stuff like Numpy, Taichi, etc work really well)

errant iron
#

I guess it depends on what you mean by 'most people'. For most realtime raytracing needs you're going to want maximum performance throughout and Python isn't going to cut it, no matter what you do.
It's different for ML where Python just sets up the batches; it works well there.

normal silo
# errant iron I guess it depends on what you mean by 'most people'. For most realtime raytraci...

I am going based on what projects are being made. It's very rare to have a project that tries to get maximum ray tracing performance. In which case things get really complicated by probably only being able to target specific Nvidia GPUs with hardware support and all that. Something like Taichi will match and in many cases outperform doing it "by hand" (unless a lot of care is taken by the writer) (due to its memory layout optimizing features).

#

I can only think of one game engine that even tries to do this to max performance and do only raytracing for all the visuals. The rest are often not really game engines, more meant for film.

errant iron
#

I mean, all game engines are going to try and maximise performance where possible. They're not going to be using Python in their graphics code.

normal silo
#

Not saying it's even the ideal language for this / a good idea, but it's not really the problem.

#

If you already know shader languages and have an engine setup to do all the plumbing work and such, you can just use that, no need to try to make Python work.

#

Python won't make that significantly better (probably a bit worse (shaders languages are designed for the problem)).

#

But at the same time, if you use something like Taichi, it won't really be holding you back.

errant iron
#

Whether it holds you back depends on what you are trying to achieve, which is what I said before. I've been using Python in games for almost 20 years now. It's rarely the right tool for the job. That's no criticism of Taichi - it might be great for other applications.

normal silo
#

The other big issue is just distribution.

#

(Other than other debatable issues about the languages itself, like dynamic typing at scale)

#

(This is also assuming CPython)

errant iron
#

As I said twice already 😄 it depends on what you are doing.
If you are doing real time rendering then you need to be servicing the GPU 60 or more times per second. That's CPU intensive and you can't get out of that. Doesn't matter how many threads you have or how much parallelism you can use. It's hard enough to do it well in C# which in theory is more performant than Python.

If you're doing batch rendering though, e.g. for film CGI or whatever, then sure! Python isn't going to hold you back at all and will likely speed up your workflow.

normal silo
wooden night
#

I just realized I need help with RAYCASTING not ratracing

spring zealot
spring zealot
#

You create an object, send it in a direction then retrieve data you need

#

Distance colour ect

wooden night
#

I finished it this morning!

#

It has joysticks too for mobile

#

@spring zealot its running avg of 60-80 fps (when i put the tick at 120)

wooden night
#

Did anyone created dual mobile sticks class?

#

I would really appreciate it

cerulean nimbus
normal silo
# wooden night I just realized I need help with RAYCASTING not ratracing

So basically two ways. The first method is that you basically have a vector pointing in some direction that you want to go and you keep adding to it one step at a time to walk in that direction. At each iteration you check if your current vector (position) is inside something / passed something. If it is you can back out to the previous position and try to find exactly where you crossed into the object between those two points. You can do this in multiple ways. One is to start taking even smaller steps, and then back out and even smaller, and repeat until some stopping condition. The second is basically binary search, where you choose the mid point, see if it's inside (like binary search in an array). For the iterative method there are also many things you can do to improve the performance where you take extra knowledge about how the scene is structured into account (that lets you skip a ton of empty space quickly). The second method is when you have nice simple shapes that you are checking intersection with that let you have a non-iterative solution. For example if you are checking against a simple axis-aligned bounding box you can do line to box intersection math simply (using algebra to solve for when they intersect). If all your things you can intersect with are simple shapes like circles, rectangles, line segments, then consider the second method. I will give an example of ray to line segment. https://www.desmos.com/calculator/33gvuytldh

wooden night
errant iron
#

What are you doing the raycasts for?

wooden night
#

I do need help with displaying textures at walls which doesn't contains horizontal lines

ornate ruin
#

i wanna make smth unique your welcome to give ideas or reccomendations for gameplay or visuals

ornate ruin
spice tartan
#

pure?

ornate ruin
#

yes

#

wait

#

wdym pure

spice tartan
#

like pure python

ornate ruin
#

huh

#

its a pip package

spice tartan
#

no other language implemented

ornate ruin
#

oh

#

yeah

#

pure

spice tartan
#

can i dm u abt ur game

ornate ruin
#

sure

spring zealot
wooden night
#

It works at 60-80fps with goodamount of rays and if i add better horizen it goes to 20-30fpd

wooden night
#

Better horizen is a setting(or a var) that i made

covert rose
#

Even on raw opengl in python?

normal silo
#

That shader in this case would probably be written in GLSL.

covert rose
normal silo
#

All you need is an OpenGL context for that window.

covert rose
covert rose
cerulean nimbus
covert rose
wooden night
#

Is openGL better in performance than pygame?

normal silo
# wooden night Is openGL better in performance than pygame?

They are not mutually exclusive. OpenGL is a graphics API for GPUs. Pygame (last time I checked) renders via CPU, which is much slower than the GPU (which is made for graphics). But for 2D games this CPU rendering is often fast enough, CPUs are really fast, especially modern ones. But you can also tell Pygame to give you an OpenGL context (since Pygame is a wrapper around SDL (now with a bunch of extra stuff)).

wooden night
#

Btw my raycast is running at 110+ fps

normal silo
wooden night
normal silo
#

Parallel is when you physically have multiple programs running at the same time.

wooden night
#

Oh ok

normal silo
#

CPUs and GPUs have multiple cores, which can run things at the same time.

#

The GPU has a ton of these very tiny simple cores, so it's designed for massively parallel tasks, where each task is simple.

#

(And it was designed exactly for this kind of problem (like raytracing))

#

(In fact new GPUs have specific hardware support for just raytracing)

wooden night
#

Is raytracing even possible in pygame/opengl

normal silo
#

Yes.

#

If you using any other game engine/library that uses OpenGL (or other graphics API), it's going to be doing the same things, just different styles basically, but they all go through a graphics API to tell the GPU what work to do.

normal silo
# wooden night Is raytracing even possible in pygame/opengl

Go to http://brilliant.org/BranchEducation/ for a 30-day free trial and expand your knowledge. The first 200 people will get 20% off their annual premium membership.

Have you ever wondered how video game graphics have become incredibly realistic? How can GPUs and graphics cards render such incredibly detailed scenes? Well, in this video we'r...

▶ Play video
#

Basically whether you choose to use Pygame/Python or C++/Unreal, their job is pass data (and code) to the GPU and it does the heavy lifting.

wooden night
#

I did watch how to create raytace in unity

normal silo
# wooden night Is raytracing even possible in pygame/opengl

If you have OpenGL setup (like Pygame gave you a window with an OpenGL context), you are all set, anything visual (any graphics), you can do, no different from any massive game engine. It's just more work, the game engines have a lot of stuff done for you. If you use OpenGL raw you will be making graphics from scratch (not really, it's still high level, but relative to game engines), but since you are asking about raytracing I am going to assume this is what you want anyhow.

wooden night
#

I am not that smart to create a raytracing but a raycast should be good

normal silo
#

This tutorial gets you a simple spinning cube, with regular rasterized graphics (not raytracing).

wooden night
#

Sure i'll check it out

normal silo
#

OpenGL has multiple versions, go for version 3 or above if you are looking for resources.

#

(Or at least 2.1)

uncut birch
#

i made this while in an airplane 😮

wooden night
uncut birch
wooden night
uncut birch
wooden night
#

Oh

#

Ok

normal silo
# wooden night How do i incoporate in pygame?

I found this and seems like a good option, here a library called "moderngl" is being used in addition to Pygame, it's making the OpenGL context for the window too, it's a convenience wrapper on top of OpenGL to make it a bit more pythonic to work with: https://www.youtube.com/watch?v=LFbePt8i0DI

Shaders aren't natively supported in Pygame, but with ModernGL and some tricks, we can add OpenGL shaders using GLSL to any Pygame game!

Related Documentation:
https://pyga.me/docs/ref/display.html#pygame.display.set_mode
https://moderngl.readthedocs.io/en/latest/

Code Written in Video:
https://dafluffypotato.com/static/scripts/pygame_shaders....

▶ Play video
#

You will need another resource on learning OpenGL itself though.

#

Most of those will not be using Python (probably C++), but if you know Python well you should be able to follow along (they don't use complex C++ features).

#

I don't have resources on hand, I learn by just reading the documentation of whatever i'm interested in (or its source code) or books. Maybe someone else can give you resources that they used.

#

So I don't know how good these resources actually are. But I do know that DaFluffyPotato is experienced in this and sometimes shows up in this chat too.

livid harbor
wooden night
normal silo
#

(Or C)

wooden night
#

So i will right the code in python but the itegeration is on cpp

normal silo
#

Calling OpenGL functions and such.

#

So when you read some resources that are about OpenGL but using C++, you can kind of just translate that directly to Python (with something like PyOpenGL or ModernGL).

wooden night
#

Ohhhh. Ok

normal silo
#

The beginning of such resources usually have a part where they open the window, get input/output, a main game loop, get the opengl context (basic setup). In your case that is done with Pygame and you can reference that video I linked (or find another reference).

#

These resources just need to choose some language (to do anything), and so they go with the most common one for game engine development.

#

But the focus is really about OpenGL (and graphics programming in general (OpenGL is one of many options too)), not the chosen language to interact with OpenGL. Nor the library used to get the window, main game loop, input/output, setup stuff.

ebon kelp
#

does 3d work in pygame?

uncut birch
#

i added animations to my roblox clone in python

#

im gonna try to add multiplayer and stuff

quasi patrol
uncut birch
long hare
#

Would love your feedback

uncut birch
dreamy dagger
uncut birch
uncut birch
covert rose
cerulean nimbus
ruby shadow
#

hey guys very quickly, I have made a small RPG in python and want to package the entire project as an .exe? how do I go about doing this? do i need to use pyinstaller? (this is a repost from another channel because idk if it is more relevant here)

wooden night
#

It's made for 2d games but tricks like raycasting(which i am working on) or using math to create points on the 2d screen can help you create 3d but you have to really pay attention of performance

wooden night
wooden night
spring zealot
wooden night
#

And its fairly easy to use

normal fiber
#

im new to python and i want to make a game and idk how too.

cerulean nimbus
bold tide
#

Hey is anyone interested in making mobile games with python ?

cerulean nimbus
cerulean nimbus
#

pygame is not fully optimized for mobile i think lemme check

#

you could take a look at pgs4a its outdated tho, also you would need to parse Touch input (swipes, taps, pinches) to desktop values that pygame uses

bold tide
#

No pgs4a or buildozer required, use anvpy

cerulean nimbus
bold tide
#

It's like a platform for creating cross platform apps and games.

#

You can use kivy, pygame or Crysta UI to make it

#

It has everything just like a complete platform code, run and build your project in seconds

cerulean nimbus
#

none of the resources links work

bold tide
#

Yeah its not updated but anyways it does not matter, as it is available in Google play

cerulean nimbus
#

pay attention with

Rule 6
Do not post unapproved advertising.

shut tulip
white dirge
wooden night
wooden night
wooden night
#

I think the main issues can be making it an .apk or whatever IOS uses

spring zealot
#

either way pygame is a much better module for this

cerulean nimbus
cerulean nimbus
spring zealot
cerulean nimbus
#

it can be decent till a certain point

normal silo
#

Not that this is a good idea unless it's for learning or as a challenge.

wide copper
#

Hi guys, can somebody explain what does and why is "target" perimeter important here and why is it relevant?

import random

class Person:
    def __init__(self, name, age, occupation, health, dmg, min_dmg, max_dmg, is_defending=False):
        self.name = name
        self.age = age
        self.occupation = occupation
        self.health = health
        self.dmg = dmg
        self.min_dmg = min_dmg
        self.max_dmg = max_dmg
        self.is_defending = is_defending

    def Background(self):
        print(f"{self.name}, Age: {self.age}, Job: {self.occupation}")

    def attack(self, target):
        dmg = random.randint(self.min_dmg, self.max_dmg)
        print(f"{self.name} attacks {target.name} for {dmg} damage!")
        target.health -= dmg

    def defend(self):
        self.is_defending = True
        print(f"{self.name} is defending!")

# Create characters
Player = Person("You", 25, "Bartender", 100, random.randint(2, 5), 2, 5, False)
GarbageMan = Person("James Morphy", 32, "Garbage Man", 50, random.randint(1, 4), 1, 4, False)

def battle():
    while Player.health > 0 and GarbageMan.health > 0:
        print(f"\n{Player.name}: {Player.health} HP")
        print(f"{GarbageMan.name}: {GarbageMan.health} HP")
        print("---------------------------------------")
        print("1. Attack")
        print("2. Defend")
        choice = input(">> ")

        if choice == '1':
            Player.attack(GarbageMan)
        elif choice == '2':
            Player.defend()
        else:
            print("Invalid choice!")

        if GarbageMan.health <= 0:
            print(f"{GarbageMan.name} has been defeated!")
            break

        # Enemy AI
        enemy_choice = random.choice(["attack", "defend"])
        if enemy_choice == "attack":
            GarbageMan.attack(Player)
        else:
            GarbageMan.defend()

        if Player.health <= 0:
            print(f"{Player.name} has been defeated!")
            break

battle() ```
shut tulip
#

!code

frank fieldBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

shut tulip
wide copper
#

it was in here:

        dmg = random.randint(self.min_dmg, self.max_dmg)
        print(f"{self.name} attacks {target.name} for {dmg} damage!")
        target.health -= dmg
shut tulip
#

well, target is the target, the thing that get attacked

#

self is the attacker, target the defender

wide copper
#

i dont understand and i cant explain 😭 thanks bud

shut tulip
#

like, this method is called when a person attack another

#

self being the person which attack (the object whose method is called)

#

target being the person attacked

#

nothing more to understand

wide copper
#

ohhh i get it now, since Player.attack(GarbageMan) is called:

shut tulip
#

yep

wide copper
#

got it, thanks man

shut tulip
#

here, self is Player and target is GarbageMan

wooden night
#

What is a voxel engine?

#

Is it like opengl or what?

ruby shadow
normal silo
# wooden night What is a voxel engine?

Voxels are 3D pixels (volumetric + element (pixel = picture + element)). So just like a 2D image, you have a grid of them, and they each hold a value (or multiple values).

#

A voxel engine refers to a game engine that revolves around voxels as one of the core mechanics for rendering data (and gameplay).

wooden night
#

So u can make a game of minecraft using it

normal silo
#

Minecraft's engine would count as voxel engine, yes.

#

Its primary feature is having large voxels on purpose to give a blocky feel and editable terrain that feels a bit like legos in terms of large blocks.

#

However voxels need not be large, nor must the entire game be made of them, they are used for many things.

#

For example, the smoke in counter strike 2 is using voxels. It may not look like it, but the voxels are there and count as either holding smoke or no smoke in that volume.

#

Follow me on Twitter for more updates: https://twitter.com/ProgrammerLin

It took a bit longer than expected, but the fluid simulation design from a few months ago has been implemented in our voxel project. It uses the same cell/particle hybrid method and is therefore fully volumetric with no height range limit beyond the 0-4095 y world boundary...

▶ Play video
#

(This uses something called a sparse voxel octree, it's more complex than a simple grid like with Minecraft)

normal silo
# wooden night Is it like opengl or what?

You would use OpenGL to render the voxels (to render everything in the game). In Minecraft's case this involves looping over all the voxels and generating a cube mesh (the model) for each voxel (not including the sides the player can never see because they are facing inside the chunk).

#

The cube's texture is determined by the block type (stored in the voxel).

#

When a player edits the world, they change the data in the voxels. The mesh is then regenerated for the chunk.

#

This is why the world is split into chunks, so you don't need to regenerate the entire world for every block edit (and also so you can load/save it in parts).

coarse hill
#

!warn 947170036857057280 Don't advertise

frank fieldBOT
#

:x: The user doesn't appear to be on the server.

wooden night
#

@normal silo do i need to use pygame to work with opengl or i could use it independly

cerulean nimbus
normal silo
# wooden night <@119925597395877889> do i need to use pygame to work with opengl or i could use...

OpenGL is a graphics API. If you want you can manually make your own window with an OpenGL context and get input and do audio by interacting directly with the operating system. Pygame just is a layer above that (it's using SDL2 which does this stuff). Doing it yourself at least once is not a bad idea for learning how the operating system works and such. But usually this is just tedious work that someone has done for you (stuff like SDL) and for each operating system.

daring heath
#

Hello everyone, which game engine do u guys use for game development. I started with Pygame.

wooden night
#

I usually use pygame but I am thinking towards using morderngl as well for better performance

shut tulip
#

Depends on your use case. For very simple game, pygame works well. For things more complex, you can even go with Godot

prime delta
#

hi hi

oblique pawn
#

hi guys (:

worthy moth
#

hi

wooden night
#

Hi

quaint nymph
twin fjord
#

hello

placid path
#

Someone help me pls iam begging for help

#

I need to run my old script and update it to new gui and the old script and the features of it I need it to working again ple

valid moon
#

does anyone have ida pro by chance?

#

my friend i used to work with passed away and I was mooching off of the mf
working on another project he would have loved to have seen done and I would like to get it done in a timely manner
I am really just looking for an iv for a save in an exe. I don't have the entire game only the exe maybe some guidance with the free version of ida?
Rest of the process is visible due to openssl/bcrypt but I am having a hard time finding the nonce itself

rotund wagon
#

im new to python put i used to work on lua (a bit...)
and can somone explain it to me???

#

i like makeing games

shut tulip
#

we don't do tutoring here, but if you want resources

#

!res

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.

rotund wagon
#

k

spring zealot
rotund wagon
#

?

spring zealot
#

U said explain it

rotund wagon
#

oh

spring zealot
#

Unless you wanted me to paste the python docs here

rotund wagon
#

um no

#

plz no

spring zealot
#

It was a joke

rotund wagon
#

guss what game?

#

geuss*

spring zealot
#

What is going on

#

What

#

😭

rotund wagon
#

what?

spring zealot
#

Rock = 1

#

Paper = 2

rotund wagon
#

ya

spring zealot
#

Scissors = 3

rotund wagon
#

and

stoic ravine
spring zealot
#

Why?

spring zealot
rotund wagon
#

ok then oyu tell me what to do then

spring zealot
#

I don't get it

rotund wagon
#

YOU*

spring zealot
#

No I'm just wondering what ur trying to do

#

I'm perplexed

stoic ravine
#

That looks confusing tbh

rotund wagon
#

gimmi a sec

spring zealot
#

That's what I'm saying

#

What are the numbers even for 😭

rotund wagon
#

is that better

stoic ravine
#

OkY

#

Import random first off

#

That’s the most important thing in this game

rotund wagon
#

?

spring zealot
#

Random is a module that let's you get random number ie a number to determine the computers choice in the game