#game-development
1 messages Β· Page 101 of 1
Thanks! Glad you like it!
hello I am wondering if anyone in this server would be willing to help us with our project if you are interested please dm me.
I think if you want some more people to be interested you should give some more details without DMing you
we are an project that makes cryptography puzzles and we need a python programmer to auto the progress and work with numbers etc.
how much python knowledge should i have before starting on a game
i do have some code knowledge in java
honestly you should have flexible knowledge of python basics (how to define functions, classes etc) or know where to look for them. Choose a game module of your choice and dive into basics of displaying sprites, some UI. Just enough to know what you are actually doing. And go on! For warm up, make something small, but extended by you in some way, to not just copy the code from a tutorial. Also I would recommend you to make games that you would have fun of playing.
It will definitly help you in taking up new language so that's good
i made the stats count up, now i just need to position them, where should i position the stats?
Could someone dm me and teach me how to use this
read the ursina docs? that's pretty much all the resources on ursina. just experiment with it
Do you guys know good pygame tutorials I can follow.
Check pins
u can check out dafluffypotato tutorials or techwithtim
tbh even pygame docs are fine
Do you know python ? Because if you donβt know python. You gotta learn the basic first. I did the same thing. I wanted to learn how to make a game before learning the basic first
just an overview of what i've done
wow great!
make more levels and publish it ig
yup i'm planning to add a level editor so players can make their own maps
cool!
thx π
np!
nice physics btw, i'd like to see how this turns out
thanks!
I have some sprite of a robot with various mouth designs... I wanted to control it with the given audio. Kinda like a virtual character. At first, I tried forced aligners, but most of those are not available for windows or are pretty complex. So right now I am thinking, of faking it kinda like Talking tom but 2D. Any idea, link .. where I can use spectrum intensity to control sprite. Thank you...
I know some stuff
Oh ok ok good @covert fern
Does anyone know how to trigger events through toggle on unity
!rule 6
So um
Anybody have any hints for perlin noise in 3D
?
I've done basic 2D perlin noise with some nice results, just 3D seems hard to wrap my head around
If I will make a game using pygame, is it possible to compile it somehow that it will be possible to play it in browser?
idk
????
The closest thing would be web assembly.
Altough the process is a headache and there are uncertainties along the way.
Nothing guarantees pygame will work
You're better off just not using python
Ok thanks, maybe something like Kaboom js will be better
nope
Hi. Ive lost interest in my current project. Hopefully ill come back to it. In the mean time does anyone want to code with me? I like to make games and teach beginners.
anyone?
no noobs want to make a game with me?

I had no idea there was game developement in python
python can be everywhere
you're making it in pygame?
I mean it's not like it's used in unity or unreal engine
most game dev you can do is on pygame
im making that game in C and SDL2 but im open to make games in any framework
What's your game's genre
my game is just a clone of a game called puzzle quest
a rpg set in fantasy middle ages where you fight monsters
How's coding using C
i kinda like it
wish i had namespace though
I'm still a beginner at python but from what I've read C is pretty hard
its not that hard
Relatively hard
Was it your first language?
C++ was
What are the limitations of pygame?
Very limited
most you can do is 2d games
and like basic 3d stuff
I saw some guy here make a 3d game with a wand and stuff
Cause ive always wanted to make my own game engines cause sometimes i dont like how unity hides all the messy stuff
: (
i have maked a physics engine in pygame
you can make game engine also in it
can you show your level map list?
well you don't learn python for game Dev after all
so say this to c++ devs also
all language devs
who use their language to do game dev
I mean c++ is used in unity
what
most you can do with python is pygame
its c#
I learned Python for gamedev, so yes, you do
yeah
so python used in blender engine
Blender is a bad game engine
bruh
My bad, C++ was used in unreal though right
think I mixed them up
we are talking about languages
not game engines
c++ was never indented for game dev
But we're talking about their usage in game development
and C++ as well as C# are a lot more commonly used because they're simply better for game Dev
As evidenced by how many games are powered by those languages and how little big budget games are powered by pthon
try c++ then it like kicking your ass for 5 hours in computer
python
I find Python better than those for game development
Just because it's easier doesn't mean it's better
or even a good way to develop games
I can't think of any famous games made by python because of how eh of a language it is
first
python is recently build
c++ is freaking old
and c#
Python 2 came out in 2000
also
Python is not recent.
C++ was in the 90s
as well as C#
Late 90s as well
Same age pretty much
again there is a reason it is not used with unity and unreal engine
It's not a good game development language
We'll just end up going in circles and it seems like you're getting offended on behalf of the language
so I'll just go
Why not? I make games in python every day and it's great
Can you read
I just stated above why
you think that tell whats in c# and c++ that makes it better?
what
I don't think "it's "too new" and "it's eh" are compelling arguments tbh
When did I say it's too new
here
And yes I agree it's not a compelling argument
I said it's not new....
wait., nvm :P
Can you actually read lol
it was the other guy who said that, sry
use ursina for 3d stuff
its very great
there are very cool ursina user like
@tranquil girder
ok
Not everybody needs to make a famous game. I did my last game jam with Python (Panda3D) and it was fine (also the one before that with Ursina). I have also used C and C++ for game and game engine development (and game jams), and while those are the "serious" languages for making a game engine (many engines still have another scripting language for making the actual game logic (e.g. Panda3D)), it's not like that really applies to all games. Sometimes you want to make a game in a very high level way without much setup and it won't run fast (many games will run at 60 fps even with Python on modern hardware), but it's a game. Also Python still lets you write shaders so a lot of what will makes a game look good can still be done and will run fast if you are worried about your Python game looking plain.
As an individual making a game, your main issue will be content/assets either way. They take a lot of time to make and require another skill set.
Also, you can write parts in C or C++ and create bindings to Python if you want/need to do so.
(Or Cython's extended Python language)
(Or in the case of something like Panda3D, you can easily mix C++ and Python, the API for the engine is almost identical for both)
the vast wealth of existing game development tools that work with them
ok
same, I made my own games in Python and released them to Itch, and they didn't have to be big things. Most people who start off wanting to make games have no idea how much work is actually involved, and so they download something like Unity and drown in it. They're better off making something on a small scale where they understand the pieces, even if they're the only ones playing it
My point was mostly while python is a viable way to make a game, it's not really something I think most people learn python for because python is good at back ending for websites and at making apps
just most programmers I know only recommend learning C# or C++
For game dev
if I was going to learn the basics of state management in a game, I'd rather first learn those concepts by way of a language like Python rather than a language like C# or C++
It's not something most people learn to make games, but that can change. Unless you are looking to be hired it's not really important.
Ye
But also if you learn to make games in Python, switching to something more popular should not be an issue.
Game Dev with python is surprisingly unutilised
Granted I'm not deep enough into programming to understand why
Learning a new language like C# is something that does not take nearly as long as just learning how games are made in general / getting fast at that.
but maybe a big name engine will adopt python some day?
Technically Panda3D came from Disney, so if you include the past, it already was big.
It's just trends, I would recommend not getting caught up in them.
Meant in modern times
Right now most are focused on Unity and Unreal because they have the momentum / huge community and asset stores (you can basically buy a game in Unity).
In the indie space it's doing just fine, but Unity's popularity usually makes most rush to it and it's honestly a bit of a trap.
Those are called asset flips for a reason
As an indie dev you can use whatever you want, so if you like Python go for it.
(Godot is also starting to get big and forming the big three engines out there (popularity), and it technically has Python as an option, especially when version 4.0 is out (plus GDscript is very much based on Python))
hey squiggle, mind sharing the link to the games you've made? just interested in what kind of games you make, you seem like an expert
I'm not a professional game developer and have relatively little game development experience in Python. But here is a ludum dare game jam entry: https://ldjam.com/events/ludum-dare/49/unstable-ball-game .
I like to use game jams to learn a new engine, in this case Panda3D.
here's one I created in Python
https://xtaloid.itch.io/xtaloid
no textures ππ but interesting concept
Yeah, as is typical with short time game jams I ran into some issues that stalled me from making nice assets.
looks just like an arcade game
nice work
what do you mainly do again?
exactly my intention! thanks :D
yup, might wanna add some particle effects when killing stuff to make the game look more juicy
oh, sure, I have a lot of stuff in that vein lined up. Mostly I have been busy with other things (finishing a book, starting another), so I work on it when I can
I'm an AGI researcher / roboticist / simulation (simulate the robots and other agents) (which is where my game development experience comes in handy).
I hang out mostly in #data-science-and-ml.
They are closely related so it's one room instead of two.
Some more Python stuff (Ursina). I like to mess around with voxels. But making a game with them is hard (game design) so I don't usually put them in games.
Interesting AGI research rather than narrow applied ML ....
I learned C# before Python because of the way history unfolded lol
We do make applicable things, but we don't hyper focus in on one thing and build a large extensive product package out of it. Making something interesting / progress is more important to us than a comfy income via specialization.
(plus all the time for marketing / business / etc)
Great nice to see somebody doing research
All that is alot of work
Yeah, and right now there is so much progress being made in AI that by the time we would have a nice product out of something and all that, it would already be very behind. Ofc, we need to every now and then stop and spend some time on that to not go out of business.
Opportunity cost, it is what it is.
Machine learning and AI seem like very interesting fields
Interesting so it is product supported and not some goverment or university funded lab begging for grants...
Yes, that's in part due to our approach to AGI, it's very results / reality focused. If it does not work in testing then it's thrown away.
Which results in things that can actually be used.
Very practical I worked with a uni robotics lab for a while and we spun off an a startup... begging for grants can only get you so far..
Yeah grants can be somewhat of a trap in terms of time spent trying to get them and unreliability.
i also use it
My workplace was a Microsoft shop and I was already working in the late 90s... back then open source wasnt as strong as it was. During the transition to .net the shop gave us VB.net and C# training prior to that we used VB 6.0 and FoxPro....Python then had Perl as a competitor
I taught myself Python and used it for OMR file parsing and processing tool for admin stuff and a Research project that got published in a local Physics Journal
wow
I did Y2K work migrating a VAX Cobol system to FoxPro lol
oh yeah, i remember you sharing this in the ursina server
sir i was not even born when python came
i feel nostaglia for you lol
How do I initialize glut in python? because when I initialize it requires 2 arguments but those arguments that are required is almost impossible to get in this function
glutInit()
hey guys new to python..and i want to be a game developer
hello everyone I will say it in md someone knows about blender scripting
learn python first
hi, does someone know how can i use tkinter to doa blindtest with python
Hey guys python is good for game development
yes
I like using it. I've already developed a few small games in it. It's a good way to get your sea legs with game making
okay..but how
reverse time!
watch some tuts
Ok ,Cool I'm gonna start ..
tbh you should learn python first
it's easy to work with for smaller scale games, but it's not really used in the industry imo, like you wouldnt use it for an open world game where you have many entities, python's performance is absolutely crap
How do I do movement code with keys???????
are you using pygame?
you have to create an if statement and then use if keys[pygame.K_LEFT] if you want to move leftwards
and so the condition would be x -= vel
or the velocity of your object
:l
and x as in the x position of the object
Confused
im pretty new to this stuff but
from what i understand
you have to set an x coordinate for your object initially to show where it will appear
on the screen
and then you write this line of code for which direction you want to move
instead of K_LEFT you can use any key
like K_RIGHT
or even letters like K_d to move left
and since the x coordinates decrease going to the left
it would be something like this
if keys[pygame.K_LEFT]:
x -= vel
oh yeah almost forgot
you have to set the keys variable to this first
keys = pygame.key.get_pressed()
hope you understood
i might be wrong about some stuff soo yea
What have you made in pygame? Show code.
I was planning on making a moving game but I want to know how to move with key presses first before making the game
Can you move objects without key presses?
How ...
Not sure what you mean. Is this an answer to my question?
Do you know how to draw something with pygame?
No I'm a noob
oh
i will give you a snippet to draw a rect
@covert fern
try this
wait
pygame.init()
back = (192,192,192)
gameDisplay = pygame.display.set_mode((800,600))
pygame.display.set_caption('A bit Racey')
gameDisplay.fill(back)
clock = pygame.time.Clock()
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.draw.rect(gameDisplay,)(255,0,0),[100,100,50,50])
pygame.display.update()
clock.tick(60)
pygame.quit()
quit()```
np
@grand whale guess who's trying to make a game in python after talking all that shit about it
so uh just wanted to ask where I'd start if I wanna make a basic 3d one
i think use ursina for 3d
if you want to challemge yourself use pygame
yea that's what I'm doing rn
you want code : )
just enough for a boomer shooter
Nah, can you give me resources for how to 3d render
hmm i dont think so it will be easy to do that it will be very hard
thanks for the offer though
use ursina for that type for stuff
Ye, thought it'd be
I'll check ursina out
- notifications
- jsonize map data and save it
Hi. I have a question. If you use this:
Example_Question = input("Hi! Go left or right?")
And then,
Print Example_Question
if Example_Question == ("Left"):
And now, you put in some code,
elif Example_Question ==("Right")
Then, you survive and you put this in a loop if they give the correct answer.
After a while, the game just ends even when there's more code.
cool!
hi guys I have a large 3d scene with roughly 2000 stars/orbiting planets and am looking to use an octree spatial query structure to improve performance. I am using django with three js on the front end; from my understanding I cannot import modules/libraries and can only import within html tags linking to a hosted text doc. The following library looks great, however I do not see a relevant html tag https://github.com/vanruesc/sparse-octree. Am I correct in my understanding, that I need an html tag? Is there a way to create one? Alternatively, is there another appropriate library that does have an appropriate html tag? Thanks in advance.
#web-development But also, you can just load the javascript from your own server.
Hi so basically I'm trying to play audio using the pygame library, everything works fine up untill now, however I can't seem to change the volume of the audio*? I have a vague idea of why it doesn't work but I don't know how to solve it.
This is the code I'm using:
def set_volume(self, vol: float) -> None:
# self.volume = round(vol * 100) <- this part does not matter
self.pmixer.music.set_volume(vol)
return
There is no error.
I think the problem is that I try to change the volume immediately after I start playing the audio. For example if I freeze my script using time.sleep() for as much as 0.1 second, or even less, I am able to change the volume. Does anybody know how to solve my issue? (Note: Yes I do need to be able to change the volume immediately after starting the loaded file.)
my game that i developed myself π
https://github.com/storm772/Jackpot-Python/
It's a really basic Jackpot game, i'm kinda new to Python and I've decided to "challenge" myself, feel free to give me suggestions on how to improve on Python.
Coding video: https://www.youtube.com/watch?v=Csyg3R8NMV0
I plan on adding graphics to this, using pygame or tkinter
Everything about the game explained on README.md (on github)
You can try to make it clear the console before printing the new spin.
how?
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
Im executing the code in IDLE shell, so it don't work for me xD
but thanks anyways
π
You can try making the game more suspenseful since it's a slot machine. I recommend printing whether or not you won AFTER you print the slots and adding a delay between printing rows.
(you can use time's sleep for the delay between rows)
Also btw: ```
[0][0][0] is a row
[0]
[0] is a column
[0]
how do you make a transparent rectangle with pygame.draw.rect?
set the alpha of the current drawing color to something like 100
Well you can't do that with rects but you can do it in surfaces, just write a function that returns a surface with an alpha set to it.
def get_surface(rect, alpha):
return pygame.Surface((rect.w, rect.h)).set_alpha(alpha)
```and then draw the surface with the rect's position
yeah i was wrong i think
Thank you
Does anyone know how to get a list of all the red pixels on a screen in pygame?
Red being (255,0,0)
pretty sure you can loop through every pixel and get their color with win.get_at() or something like that
A loop would stop the game until it's done
I tried To make a start screen for a 2D game using pygame by using this function
def game_intro():
intro = True
while intro:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_c:
intro = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_q:
pygame.quit
screen.fill(WHITE)
draw_text(screen, "Hello", 75, WIDTH / 2, 10)
pygame.display.flip()
clock.tick(15)
but when I press c my screen flashes to the game and then flashes back to this white screen. What do I do to fix it?
your application can only have one main loop called the game loop. Based on what state your game is in you render and update different things.
Does this make sense? A simple game might look like this
running = True
state = 1
while running:
for event in pygame.events.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_c:
state = 2
if event.key == pygame.K_q:
state = 0
if state == 1:
menu_render()
menu_update()
else if state == 2:
game_render()
game_update()
else if state == 0:
running = False
pygame.display.update()
I hope this helps
It helps a lot, thank you so much
You could even have the event loop inside a call to menu_update
instead of having it outside
this way you can have the a key trigger the play game in a menu then the a key does something different in game
this is all very simplified but its something to get you started
developed another game with the same mechanics, but this time it can accept diagonal, horizonal and vertical slots (at the same time)
learning python
Coding video: https://youtu.be/4_FoQR6f6uE
GitHub: https://github.com/storm772/Jackpot-Python-V2
Indicators:
- Y1, Y2, Y3: 1st, 2nd, 3rd column is the same
- X1, X2, X3: 1st, 2nd, 3rd row is the same
- Z1-Z3, Z3-Z1: Diagonal from X1 to X3 and from X3 to X1
so slot machine?
kinda
maybe try your hand at making bejeweled
it has something interesting logic behind it
what do you mean by bejeweled?
candy crush
ooooo i see
match 3 games
i'm not familiarized with pygame or tkinter at all xD
i wouldnt use tkinter
id use pygame
but one day I will try to learn those, so I can add graphics to that
btw, thats looking awesome
i made all the algortihms for it
maybe one day ill tie it all together
do you have it on github or whatever?
or just on your computer? xD
its in C and SDL2 so im not sure if youd gain much from looking at the code
but i have it on github yes
ohhhhh
i thought it was on python
you can make it in python if you want to though
I mean, i don't understand a single line of C lmao
theres not much difference
you guys good with classes?
what do you need help with specifically
can you send it to me?
its a question @dawn quiver #help-cherries
the source is very messy
thank you
if you have any questions about how i did anything you can ask
sure π
@dawn quiver
never mind
try adding this to your shell command -DCMAKE_C_COMPILER=/pathto/gcc
your gonna need to find the path to a c compiler
maybe try which cc in your terminal
thanks for finding that bug ill have to update the cmake file in the future
hey
im using pygame
i have 720x720p
but when i blit my image
i just dont see it
i put the image on coordinates 0 0
Try an open gater.
Why does is say "failed with"
post the code here and i might be able to help
like to draw a rect?
im done with that
now my problem is that it lags
as in when im pressing left it moves left but it disapears and teleports to the left
and then moves normaly
any remedy for that?
show your code
^^^
either use a paste site or put it here in code blocks
okie
```py
code goes here
import pygame
def updt():
pygame.display.update()
pygame.init()
root = pygame.display.set_mode((750,600))
pygame.display.set_caption("Spectrum")
root.fill((150,225,150))
updt()
fps = 60
clock = pygame.time.Clock()
ingame = True
x = 10
vel = 20
while ingame:
root.fill((150,225,150))
character = pygame.draw.rect(root,(255,155,200),(int(x),int(300),int(50),int(50)))
for evnt in pygame.event.get():
updt()
if evnt.type == pygame.QUIT:
ingame == False()
pygame.time.delay(65)
keyinpt = pygame.key.get_pressed()
if keyinpt[pygame.K_a]:
x -= vel
if keyinpt[pygame.K_d]:
x += vel
you are delaying a second i think
you want to limit the framerate to 60 frames per second
in place of this pygame.time.delay(65)
do pygame.time.Clock().tick(60)
okie lemme try
its still lagging
instead of smooth movement
it just teleports to where its suppose to be
import pygame
def updt():
pygame.display.update()
pygame.init()
root = pygame.display.set_mode((750,600))
pygame.display.set_caption("Spectrum")
root.fill((150,225,150))
updt()
fps = 32
clock = pygame.time.Clock()
ingame = True
x = 10
vel = 5
while ingame:
root.fill((150,225,150))
character = pygame.draw.rect(root,(255,155,200),(int(x),int(300),int(50),int(50)))
for evnt in pygame.event.get():
updt()
if evnt.type == pygame.QUIT:
ingame == False()
pygame.time.Clock().tick(fps)
keyinpt = pygame.key.get_pressed()
if keyinpt[pygame.K_a]:
x -= vel
if keyinpt[pygame.K_d]:
x += vel
your calling pygame.display.update() in the wrong place
call it at the end of your game loop
not where you handle events
also updt is a bad name for a function
it should be descriptive
and why that function at all
easier to type
it only calls the pygame update function
so might as well use that
well you only need this function a few times
and very lil times the case is that you need something to be easier to type
compared to easier to understand
the function as far as i see it is uneeded indirection
functions are good to have but when they serve a purpose
okie
glad i could help
um maybe im not sure
there are some functions that allow you to check rect vs rect collision
cewl cewl ok
tried to make mario like physics
but i think this is far from it
i make him move in the air more freely by incressing the horizontal force applied when pressing left / right while in the air
so i like the freedom of movement
maybe his speed should also affect how long he jumps
Super Mario Bros is a classic NES game with great controls and movement. This deep dive into its game feel will break down its motion in hopes of understanding why it feels so satisfying. If you're designing a platformer, there's a lot you can learn from Mario.
Sources:
"You say jump, I say how high?" Martin Fasterholdt: http://martinf.dk/jump/...
Despite Mario being an old game, it's a bit more complex than it might seem.
To make the gameplay feel good.
Mario falling faster with the increased gravity effect is especially important because platformers tend to often suffer from "floaty" physics (lot's of other physics based games do too).
he goes up a lil slower then he falls down
enough time to react in air
right?
oh right falling
faster
then jumping
alright
This
i mean . . .
if you want to replicate marios physics sure
π π
Thanks for answering this question
sooo
i want my object to stop after hitting something
like the edge of the screen
or any objects i want to add
how would i do that in pygame
!paste
thanks for your response can you expand on what you mean? At this point in time, the project does not use node. Is there a way to host js without node? I am currently trying to implement node, however it is preferable not too set up the project again as we have all the connections to the database etc (I have not really been involved in the backend) in place. Do you have any comments on this?
u can put self in the paramiters of a function right?
you need to implement deltatime somehow
oh my gosh im so sorry i didn't disabled ping
so, what was your problem with your game?
if it was the delay to walk i fixed it ^^
its kinda smooth now
i just did what vaxeral#100821 said
if you want me to send it, i send
the "Spectrum" one
You are using Django, a Python web server library which can serve whatever files you want over http/https, that includes javascript. In the html when you put a script tag with a URL, it tries to load a script from that URL. You can have the URL pointing to your own server.
In short, you can download whatever javscript library (given that the license permits) you want and put it on your own web server.
You can make delta time by '''dt = clock.tick(60) *0.001 * 60'''
whats the best place to get a bunch of 2d game assets?
kenney
Sup guys have someone made a Minecraft plugin in python? I have read that it is possible via spigot.
which is the best module in python for game development?
@dense forge https://opengameart.org/
U can filter there via copyright free licenses and u can find many arts with CC0/it's free license
pygame
...
?
nothin
Pygame is literally the only one game developement python module
and what if I want to make fre fire in python
that's quite a [citation needed] chief
you cant
!pypi arcade
ca I make it using pygame
freefire is 3d
do python cant make 3D games
depending how you define "game engine", also panda3d, pyglet...
yeah and champions only do hard work
!pypi panda3d I mean...
thats why they are caled champions
getting that error
even in opeing python.org
please help
...
Isn't it python.pypi.org ?
yeah
..please help..
PLEASE................................................
I want to study python gaming
Well try another browser
What OS do you have
hes trolling
you installed discord, can take screenshots, know what OS you have but dont know how to bypass that error lol
also to have kali linux you need access its website and download it manually
nah ur trolling
With Kali you should already hack the whole pypi
bro linux is giving me the error that this website is not certificated
Probably you have already done it and corrupted their certification authority server lel
ok cool
I tried to study some Ehacking but I am having a series of errors
thats why I cant study it
π¦
hey does anybody in here know ursina
hey
I don't know what it is
(quite fast for a Python program... π
)
is it possible to hack fivem using python?
Read the server rules. We don't discuss these things here. Use common sense
Depends on what you wanna do, but u need a permission from them to hack them
hey
Hey
you know ursina?
It that like joe mama joke?
no
Idk it
Is it like unity?
nothing like it
so i'm writing an evolution simulator, and i'm wondering, how tough would it be for me to link into something like pygame at a later point to handle rendering it?
Shouldn't be too bad
When I get game developing I often have the logic and rendering done separately of each other (This is often in C++ however the same applies to pygame in python)
Then once the rendering is up and running I shouldn't really need to mess with it and I can just worry about physics/logic behind the objects
That's how I also plan to tackle it π
can load exisitng maps now
great work π
thx π
is it done with Panda3D ?
ursina
Usrina seems too easy to work with
i am working on a game with infinite world generation
Hey @half obsidian!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Hello there
You should use the code pasting service the bot asked you to
We don't allow file attachments like that because it can be hard to moderate and in any case most people prefer not to have to download something directly to view
(also next time there's no need to ping random helpers; if you have a question about why things are the way they are you could ask @light nest or #community-meta π)
Hi. I'm building a pygame game similar to the Chrome Dinosaur game and I need side-facing character icons (similar to the dinosaur) for my character. I've searched for icons online but I can't find good side-facing icons. Do anyone of you know where I can get some good side-facing icons?
wdym?
You can simply flip your sprite if by pygame.flip()
python game development is a waste of time
?
what makes you say that?
@glossy wren try www.opengameart.org
@radiant sage cuz u will skill up your python skills
I learned python via pgzero and then switched to pygame
yes but its
a) too much to learn
b) python has a slow runtime
c) python is not made to be compiled and is harder to compile safely
d) you can use game engines like unity to do it more efficiently
you cant really publish your project though
aka someone with 0 python experience cant run it
This is not true.
Also why are you instigating?
Apparently eve online is made with python
im not instigating
im raising a controversial point
not everything has to be perfect
You went into a Python channel which is about development of games in Python and then implied that everyone here was wasting their time with it. I'm not a mod, but that's ban worthy.
am I not allowed to raise points or do i have to compy, nod, and salute?
we're here to be helpful to people who want to use Python for game development. your comments aren't constructive, and we don't appreciate that here.
pygame is really supposed to teach you stuff not use it commercially
it makes you not rely on tools provided by other people
hey im trying to figure out how to have my python game be compile which i think will allow people to play even without python downloaded. py2app wont work for me.
also it there a way to make it so they cant edit and read the games data?
im currently making a text based rpg style game
@chrome copper pyinstaller?
havent heard of it ill take a look
ok it wouldnt work i use 3.9 python it says it only supports 2.3 up to 2.7
really wow
well i think there is another one i cant remeber the name
worse case is you will have to do it yourself
just mimic what they do
ok
i guess i could make a hidden folder with everything needed. then have it so there a script which opens the game
ill just have to make sure either python is installed in the folder or just tell people to install python
why?
so that once you install a module it will install it locally
instead of you having to find the module and copy it over
im not sure
just a guess
well i use pycharm and i code using a virtual environment
cool
im learning git so i can work on a project with some python beginners
gonna try and teach them git
that cool have fun
is your game on github, id like to take a look.
Cool im interested in helping
it a bit of a solo thing sadly. has it part of something bigger i have planned and it just 1 key to a lock
but anyways it is based of my old 2019 game
but with better python skill can 100% make it so it works
if my language skill doesnt ruin me
Using pygame?
For those interested in a Conway's Game Of Life implementation in Python with graphics and Cython acceleration, I just updated the repo: https://github.com/syegulalp/conway-2022
nope due to it just being a text game which is mainly using input
and i simple saving system
with variables like health, mana, etc
though i should prob look into pygame
Try using another browser duckduckgo.com is the best browser service to open stuff you can't on google :)
more mapping done
hey i am doing big project in a server with some other people to help improve our skill. we are making a cool terreria sorta game just for fun to expand our horizons and learn new skills! if you would like to try to learn stuff like that or you just need help with your own thing, dm me! π
@sick eagle what framework/software do you use
Not sure where youβre seeing this. Pyinstaller supports anything 3.6+. I think current versions donβt have 2.X support at all.
I canβt speak to using it with Pygame, but Iβve personally used it with Arcade on 3.10 and it works fine.
OK thanks man
thanks!
@radiant sage with pgzero nope. But with pygame u can use pyinstaller. Or better. Atuo-py-to-exe. I use it and I pack all files into one exe.
Auto*
@radiant sage and you have to deal with it. Pygame forces you to refactor and optimize your code. And i believe that for 2D games it is more than sufficient.
@chrome copper I am using python 3.8.8 and auto-py-to-exe don't have any problems with it. And it is a gui which runs script with pyinstaller..
"visual code" lmfao
Damn bro looks amazing, I don't really specialise in that type of stuff but I might start taking interest it looks really interesting :)
i cant spell
canya show me this auto py thing, pyinstaller never works for me
@sick eagle https://youtu.be/GFadq39XJqY
I learned it via this tutorial.
The solution to this is a little tricky, but if you follow this video you will get it finally. I tried different solutions and put it into practise... so let's see how to make one exe file containing our code for a python app, including the images into the exe file... cool!
The post for this topic: https://pythonprogramming.altervista.org/auto-...
i have a problem with top down collisions every time my object collides from the left or right stops ok so far we are good but if i press the w to go up it just teleports to the bottom any suggestions ?
what is the code
i fixed it (i think )
def h_m_c(self):
player = self.player.sprite
player.rect.x += player.direction.x * player.speed_x
for sprite in self.tiles.sprites():
if sprite.rect.colliderect(player.rect):
if player.direction.x < 0:
player.rect.left = sprite.rect.right
elif player.direction.x > 0:
player.rect.right = sprite.rect.left
def v_m_c(self):
player = self.player.sprite
player.rect.y += player.direction.y * player.speed_y
for sprite in self.tiles.sprites():
if sprite.rect.colliderect(player.rect):
if player.direction.y < 0:
player.rect.top = sprite.rect.bottom
elif player.direction.y > 0:
player.rect.bottom = sprite.rect.top
hm idk
I made trees for my game
is that python
Whatever your imagination can hold? π
?
why is pygame not opening files when i have the exact directory and it worked 10 sec ago but now it does not
Yeah it's Ursina and a lot of math
I don't know in which channel I can post this but as it's based on pygame, I'll post there.
So I'm currently in a project at my own called SHooK (SynnK Hook), it's a "Toolbox" of windows components (such as buttons, text renders, input boxes and in future, many more) but using vanilla pygame.
That's what I did so far!
I'm posting it here because I don't have anyone to tell this.
This project was supposed to innovate PyGame application creation with different components which you cannot access with pure PyGame.
# output of the next image
>>> 'button will print this text'
So if you want to help me to continue this project, please check out my github!
https://github.com/storm772
Source Code of this GUI, Input Box / Button components on my GitHub
Cool your're using pygame me as well
yep i am
But one question em for input boxes and buttons I think Tkinter is better but you can use pygame if it is easier
Those components are used for games in PyGame, e.g: You have a game that when it starts the game wants you to input your username, but you can't do it with normal pygame, so you could use SHooK Input-Box for that
Ohhhh that makes more sense
Tkinter is 100% better than PyGame in question of GUI components, of course. But Tkinter is not designed for games
Ye
I made a cps counter in tkinter but now learning pygame to make space invaders
and snake and tetris and all that lot
oh wow you already got centered text
hmm ill see what i can do to help
@dawn quiver you there?
I just cloned @dawn quiver repo. Made a button class that centers text and uses a callback when pressed. Wannna see?
sure
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
You could,
but I'm too dumb
i gotta sleep soon. What is your timezone? Its 1:29 am for me
id be interested in making a terraira clone
sounds great
you know how to work with git?
lol im kinda new to it
i like to teach people
but ill try to let you do your own thing too
have you made anything in pygame?
alright well cya im off to bed
yeah, but I have abondoned all of them
kla
lmao
very nice
I would like to do game development
not sure if I should start c# tho
Try ursina if you don't want to learn something new
Thats all right. I have alot of abandon projects too. I still pick up a few things though.
you there?
poo
poo what?
i want to talk with some people but they are not on discord right now
Hmmm ok
thanks will keep that in mind as another option, trying to implement webpack and npm atm
some updates to map editor
- you can now clear the map
- you can rotate direction blocks
- the block outline becomes red if the block is in an illegal position
did you make it in ursina?
looks cool
seems like no one uses pygame these days π
ursina is the talk of the town
yup
nah thats still more popular
ursina isnt that widely known
Im using pygame.
But i mostly use it to teach beginners and make projects with them.
!paste
For those interested in how a Conway's Game Of Life implementation would work with Cython-accelerated performance, I've updated my repo
https://github.com/syegulalp/conway-2022
Lol
I use pygame
I'm trying to make a game engine
but i need help
somebody tell me how to do this automatic code generation thing
@wind basalt that's not really something that can be conveyed in a message or two
?
can you elabrote?
This is the wrong channel, if you want help ask in #python-discussion
ok thanks for details
!warn 809865354603397141 do not post chainmail in this server
:incoming_envelope: :ok_hand: applied warning to @deep yew.
Hey!, can someone help me with a tkinter project in python?
Hey!, can someone help me with a tkinter project in python?
!warn 809865354603397141 Hello!
Code / make a specific project / don't make coding the end goal.
what happened to this channel in the last 5 hours lol
are you talking to me?
ah sorry
once you have learned the basic of a language ie variables, control flow, functions, data structures, classes, variable scope then start to learn programming concepts and modules. Like how do i open a file? How do i read a file line by line and store it in a dictionary? How do i read a file that stores an array of map data. How do i store that data?
Id recomend making hangman. Its a simple game that can be played entirely in your terminal / CommandPrompt
you all are blue so kinda hard to tell
lmao
Hello all
How goes py game dev?
(tag me if it takes a while to get back to me)
I have been having lots of fun, implimented A* by redblob vs evaluated blender mesh and made a bunch of geonodes stuff
Hey everyone, looking to dive back into game dev after a one year hiatus. Any new python libraries/engines that might be suitable for 3d multiplayer game dev before I sell my soul to a large engine?
mind taking a look at this repo. im trying to teach some beginners python pygame and git.
panda3d last time I checked was very very undocumented
ursina I was actually looking into right when you mentioned it!
ursina lookin pretty fly not gonna lie
anything to avoid selling my soul to unity3d
is really
Panda3D docs worked for me, although I am not new to game development.
damn, guess I just had a bad time
Ursina is Panda3D with some simplifications / work done for you.
I barely made a rotating panda and moved on lol
im a web dev by trade
I did however see Toontown lol
Panda3D's docs kind of assume you know in general the pattern of how most game engines work.
They all follow a similar design like React vs all its competitors.
ahh, that explains my confusion then
Imagine learning Vue without knowing React first. Or the other way around. Clearly if you know in general how it goes it will be much easier.
I didn't have my basics down
One thing though is that games are very very complex in that they can contain anything in them, including an entire web browser in some cases.
So there is a bottemless bucket of individual ideas / features. So for basics it's more about knowing the system that ties it all together (e.g. Entity/GameObject/Scene systems).
And ofc, they all have rendering in common, so graphics programming knowledge is universal too.
Things like that.
I would recommend Ursina over Panda3D for beginners though. And since Ursina is technically Panda3D you can learn parts of Panda3D bit by bit and mix it with Ursina / go lower level.
Hey guys
I made my first game with pygame
I want to convert it into an exe file so that I can share it with my friend
But I don't know how to do that
?
I think you should look into cx_freeze
I'm a pixel artist and I have a show at a gallery coming up. I had this idea to make a small game and set it up on a projector almost like a slideshow for people to flip through. I'm envisioning a simple 2D platformer where each room is one of the art pieces. Given that I'm kinda OK with python, what's the fastest way I can make this?
You can use ursina for 3d graphics
haw haw
i was just wondering where the x and y coordinates are in a square in pygame
is the x left?
or center
is y top or center
i'm 95% sure it's at the top left
I have heard about pyinstaller will that work with pygame code file, graphics, font, and audio
Sure will look about that
!code
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.
help pls
Pyinstaller is definitely what you want
You can bundle it all into a self extracting EXE file or you can create the executable and ship the static files alongside it. The bundled EXE will have a slower startup but for a majority of projects itβs probably negligible
How do I install pyGame?
go to your cmd on windows or terminal in linux and type "pip install pygame" or "pip3 install pygame" respectively
what OS are you using?
try to reinstall the python interpreter
yea
Ok
How do I do that? Sorry I'm new to Python.
I've been told that Python is not the best programming language for making a game. Assuming that the desired target was a 2D game that uses many different 2D sprites and stores a lot of variables in the form of "statuses", would Python be an acceptable programming language, or would it be better to consider a different programming language?
how many objects are you dealing with? I've written Python games that had hundreds of objects onscreen and that didn't tax even a fairly low-end machine by much
@sharp escarp Also note you can use C to speed up crucial aspects of game performance if needed
Do you mean using both C and another language such as Python at the same time?
@sharp escarp Python is itself built atop C, and allows you to integrate C code into Python.
oh right
Here's a game I wrote that does that https://xtaloid.itch.io/xtaloid
let's say that there are about 400 different "states" that a character can have, though a character is only going to have about 5 to 10 applied at the same time in most circumstances. There are about 60 or possibly more characters that may need to be present at the same time.
60 objects is nothing
if by "states" you mean things like choices from a sprite sheet, that's not going to affect performance much either.
The states don't have unique sprites or anything it's just background states that adjust character stats or capabilities
That should all be fine, although you do want to get live measurements of performance
(profiling)
Okay. Thank you for the insight.
Glad to help
Hello can anyone help me make a .py file .exe? My command prompt thing with the pip install uses different commands and im confused.
for example
The start of my new project!
https://www.youtube.com/watch?v=koTpjviqhWM
I just wanted to go over my idea and direction I want to go with the project and really just get it out there I got a lot to do. I try to post every week but who knows.
Really cool
I thnk i want to work on something similar to terraria or starbound
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
@dawn quiver well if you need help just dm meπ
Will surely try a hand
Is your project available via github?
No not as of right now but when the project get more complete I will release version of it
But Iβm hoping to release the game as a game of itch or steam
ah then maybe a private repo if you plan to sell it. Or even just a local repo using git would be good.
I donβt plan on selling it but maybe or dlc for it but thatβs way in the future for now all the servers for online will be hosted by me π
git is basically history to revert on for your project. It also allows you to collaborate. I wonder if you can use git in conjunction with your own server.
Not a bad idea tbh
I would not mind collabing will people
Itβs going to be a big project
why not host it on github then?
hmm its alright
anyways im gonna work on my terraria clone. Im tired of helping python beginners
Heck yea what all you got done
Have any screen shots
nope not yet
https://github.com/Vaxeral/Bored/blob/master/bored/scene.py This is how im going to handle menus and pause menus and scenes similar to unity
also fade in and fade out transitions and maybe other stuff
instead of swapping the scenes which might be expensive i could just have an index that keeps track of where the current scene is but then id lose the ability for scenes to render together for fades and stuff
and pause menus that partially show the game
or just simply assign the currect scene to the scene found with the appropiate name
since they are references
im gonna make something to show
I might you this in my project is you donβt mind well the idea of doing it that way
sorry i didnt understand what you are trying to say.
You might use my code? Thats fine
So one thing I'm wanting to know, and I'm having trouble looking up, is how should I format my game code in projects? currently using Ursina. I'm familiar with MVC with web dev, but don't really want to accidentally make spaghetti code. If you have any advice, or guides for me, I would love that.
it has some bugs in it as of now. Im updating it regularly
Sorry I was doing something will texting I meant Is I okay if I use your way of dealing with scenes
sure lemme push to github. You can use the code if you like. And i dont mind helping you understand it
I think I understand it idk how your like setting the scenes up but I think I can figure it out
Now is each on of these scenes a separate pygame screen
No its not a seperate pygame screen. they are just containers for data and have callback functions that the Game class calls.
i have one main loop that is ran. In the game class there is a method called run which runs its update and render functions
these call into the current scenes update and render functions
At the bottom of scene.py there is a quick example scene that im using currently. When the scene gets added or made current it executes the scene init function.
then in the main loop the current scenes update and render functions are called
This is sort of an complictaed concept so dont feel bad if you dont quite get it
but id look over the code and try to understand it
hmm its broken as of now
for some reason the window is not resizing even though i pass in the resizable flag
I got you well later Iβm going to write this well something like this into my engine I have and see what it does
Do you know how you would do a scrolling or parallax background like terraria has?
Yep let me get home to my computer real quick and I go over it with you if you donβt mind
This is what I made at my coding camp.
That pretty cool dude
thanks
yes i did use Ursina
nice 3D can be hard to start with if you dont know the math. Ursina made it easier but to make something else might be more involved. So i might try out pygame to make 2d games
hello you can made minecraft using ursina engine
yes
Sure just DM when ready. I might not be on in 30 mins though
not again... why does everyone want to make minecraft with ursina? yes it's possible, but it's not that simple to implement terrain generation, cave generation, ore generation etc. also you'd have to come up with a way to chunk up blocks and come up with alot of performance optimizations.
it's not easy
i saw the exact same thing on youtube
pretty sure you got ripped off
A basic tutorial on how to create Minecraft in Python by using the Ursina Game Engine. This also includes a general introduction to the engine itself.
Timestamps:
0:00 - Intro
1:24 - The basics of Ursina
15:49 - Creating Minecraft style blocks
35:25 - Creating a sky, a hand and adding sounds
Project files are available here:
https://github.co...
found it
do you know how to do wall collision
rect collide probably
wow really cool! you made Ursina didnt you?
yup
Making good progress!
Cool.
I am a bit of a noob with game engines, but I use Panda3D and the performance isn't that great for high-poly meshes. How can I get down and dirty with the GPU (tessalation, instaincing, GLSL, etc) in Panda3D?
Is there a way to tell python to stop keeping track of some memory?
I know that python keeps references to the objects and if all objects are not set to None there will still be memory not freed
id like to load and unload stuff from memory in python
There might be something specific about your mesh that makes it render slowly, normally high-poly meshes are passed through as-is by Panda directly to the graphics hardware, so they should render as fast as they should go
There are some examples on the use of tessellation shaders here, I believe https://github.com/Schwarzbaer/panda_examples/tree/master/shaders/all_stages
Normally the biggest cause of performance issues isn't the number of polygons, but the number of geometry batches (individual Geom objects in Panda)
You can also look at normal mapping for creating the illusion of detail under the effect of lighting, you can "bake" the high detail into a normal map that is applied to a low detail version of the model
How do fix this?

