#game-development
1 messages · Page 98 of 1
people have been plugging ursina a bit here, but it looks like it's barely documented, so that's a nonstarter on my end
boblox
@graceful lance also look at Arcade, pyglet, kivy
Ursinia
where is this UI from ?
Which library you recommend to begin with 3d games and graphics?
Depends how deep you want to go. Just playing around with Ursina might be a good start. If you want to go way deeper there are things like pyopengl and moderngl that are different bindings for opengl. I'm sure there are other options as well.
I only want to give it a shot, if I'll like it. Than, maybe, I go deeper.
Ursina then
Ok, thanks!
Start by playing around with the examples they have
In the Friday evening I will sit down and take a look.
(it's 100% writen in Python, of course :))
really? great work, is this in raylib-py? (just guessing from the font)
thx 🙂
oh thats cool
can someone explain the following code to me please:
import sys
import pygame
class AlienInvasion:
def __init__(self):
pygame.init()
self.screen = pygame.display.set_mode((1200,800))
pygame.display.set_caption("Alien Invasion")
def run_game(self):
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
pygame.display.flip()
if __name__ == '__main__':
ai = AlienInvasion()
ai.run_game()
also, are game mostly made via OOP?
video games existed before OOP became an industry standard 😄
so, no
pacman (arcade): not OOP
outrun (arcade): not OOP
street fighter 2 (arcade): not OOP
all these games were actually programmed in assembly langage 😄
more recent games, on the 32 or 64 bits consoles, were written in C
without a single drop of OOP
possibly, really recents games are created in C++, but C++ doesn't necessarily means everything is implemented using the OO paradigm
import sys # import some system stuff (read some files, scan the disk, this kind of things)
import pygame # import pygame (framework to code games in python)
class AlienInvasion: # why is there any need for a CLASS to implement the game ? Are we going to instantiate the game THREE TIMES in the same single contexte ? (spoiler: no)
def __init__(self): # classic class constructor, it actually will setup pygame stuff (open a screen, init the input devices, ...)
pygame.init()
self.screen = pygame.display.set_mode((1200,800))
pygame.display.set_caption("Alien Invasion")
def run_game(self): # main game loop, a game is mostly ALWAYS a loop, it loops until you die (then loops again)
while True: # loop forever
for event in pygame.event.get(): # if pygame catch a close/quit event
if event.type == pygame.QUIT:
sys.exit() # just quit Python
pygame.display.flip() # swap the virtual & physical display. This is the mandatory stuff to avoid screen tearing or flickering (google on "double buffer")
if __name__ == '__main__': # call this if the main is invoked directly (and not imported)
ai = AlienInvasion() # instantiate the game from the class (again, what is the PURPOSE of doing a class for a game ??)
ai.run_game() # call the run method, the endless loop, you know :)
@nimble pasture voila 🙂
Thank you very much for that! I'm using the Python Crash Course book and it's using classes lol
yeah, I suspect people don't even know why they are using classes
some people, at least
Can someone explain the wizardry of display resolution to me (in pygame)? My screen is a mess. I've spent a week, and all there is on stack overflow is numpties talking about display.FULLSCREEN. I mean, My screen is stretched as f*ck and I don't know why!
DISPLAYSURF = pygame.display.set_mode((1920, 1080), pygame.FULLSCREEN)
That's my shit there, like.
Is Gdot hard to learn if you know python?
My girlfriend says I can never find the GDot.
But, getting back on topic- How can I control the little wizard inside the light box that handles display resolution in pygame?
I've spent a week on this now. All hope has become lost, and I've grown more facial hair than I should have, and have neglected showering. Is this normal for a programmer?
No. Get a terapist.
Kidnap a therapist?
Yes.
Well, alright.
(this a joke)
Yeah I'm kiddin' too don't sweat it. (OR AM I?)
But you should shower man, very useful.
Showering is a great place to talk to my rubber duck about coding
Sometimes he talks back.
He's a great listener!
(Google "Rubber Ducking" it's totally a thing!)
Tell a therapist. This isnt normal
It's 100% normal for a coder to talk to a rubber duck.
Alright, is this a troll?

100% serious. Everything I said before that was just havin' a laugh, but rubber ducking really is a thing!
The idea is that you voice your problems out loud
I think. And then talking it through with an inanimate object
Personally I just think it's because software developers get lonely lol
Ehh, maybe
You know any pygame btw?
I'm pulling my hair out as to why my screen is stretched
Stack Overflow has been about as useful as a fart in a spacesuit
I came for advice, absolutely not
I've narrowed it down to this, but who knows: DISPLAYSURF = pygame.display.set_mode((1920, 1080), pygame.FULLSCREEN)
Ah well
What you need help with?
try making it separetly
I got nothing on tonight
idk
Paste a snippet
Use the three ` things
like hit ` three times
when pasting code in here, and then again at the end
It's the key to the left of the num 1 on keyboard
I'll take a look
Hey @upbeat cosmos!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
type ` three times
then ctrl+v your thing in
then hit ` three more times
Like 'open' and paste in then 'close' with the three `
Hey @upbeat cosmos!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
Hey @upbeat cosmos!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
PLEASE
Yeah, see it might just be too large a file
ok
the code is too long
Do you know where you've gone wrong?
"""print("Hello world!")"""
Just post a wee snippet
i hope that doesnt get filtered
no error
And if you can, narrow it down to the line/s that are flagging an error unless it's a runtime error
o.o
wow
What is it you're trying to do then with your code?
yeah, usually happens in functions
Ugh they are the worst
guys i know the basics
I mean if you miss a bracket, it's like, okay fine
i made a spam bot
Ah! Sweet. What's it you're after then?
No kidding? Well that 100% makes me not want to help you kinda. I mean, are you quite young?
yes
yes
I did that shit when I was a kid, so I can't be too hard on you
Yeah making naughty code is one way to learn. Should probably be doing something else though kid
Like, anarchy sounds like such a great idea but when you're a kid you never think about "What happens when I need a Dentist?" or whatever
if you like this things pick robotic in your high school it teaches you some java basics
Nahhh... it's cool.
Java is great. Sounds like you have reached a point beyond scripting
Interfacing is so hard serdus.
import keyboard, time
def spam():
keyboard.write("spam.")
keyboard.press("enter")
for i in range(100):
spam()
I made a robot arm connect to my RaspberryPi, but after weeks of trying I couldn't get it to move accordingly
oop forgot the time
How did you deliver it?
import keyboard, time
def spam():
keyboard.write("spam.")
keyboard.press("enter")
for i in range(100):
spam()
time.sleep(0.1)
I mean this is really naughty, but you're just a kid.
took code, remade it
that's how everyone starts
I totally started off by doing this stuff
great
As an adult though I regret it
I'm actually 14
Lol, serdus the first thing I ever did was make a ping flooder
That was in the nineties
Sure, that's cool too
You like games tho?
I started doing programs to solve the maths we learned in class
I mean that stuff is all off topic and probably against the rules.
yeah
You would LOVE matlab
Matlab is Chefs kiss!
There's an open source kind of matlab too but I forget its name
Do you know Matlab?
sure but I like more scripting in a basic text editor
OMG you're going to have the best time learning matlab
You can write in any function, and it can not just plot it graphically and solve it, but it can do so much other neat stuff too
You don't use an IDE?
How come?
For learning purposes?
It's one way to do it.
I'm starting to use it but maybe too hard for me right now
NAAHHHHHHHh
It's like if you were doing carpentry, you'd be a wee bit scared of the power tools at first, but you can't be a wimp! Just get stuck in, kid
You won't break anything I promise
like GitHub copilot?
Matlab is more advanced
It's basically the industry standard in scientific research
yeah but I don't know why installing python in windows without Microsoft store wasn't easy
cool to know
Installing Python is a joke. I still, to this day, have no idea why it's so difficult. Like, it sets the default PATH and everything
And then it's like, btw you need to get pip
And gives you some CMD shit
CMD Line,
This is what happens when you put brilliant (I mean that) engineers in charge of UI
I needed to search in Google a cmd command to search the paths of the files to find python
after all I got it installed
I'm actually using windows 10
Yeah, lol, ironically installing with linux is easier than windows
Well, I mean, sorta. Linux is cool shit
Linux is better but not all programs and games can be used in it
If you kids ever get interested in hacking wifi you should look up Kali, or ARCH Linux
I used to use a laptop with Kali on it
And backtrack I think it was called. I forget the softwares name now
But I'm an old dinosaur. Time has probably moved on since I did all that stuff as a kid
This is all very naughty though
Like, really it's better to make sure you're ethical hackers. Don't commit crime!
I mean that
A kid in my college had to pay a £10,000 fine after he broke into the libraries system
He's probably still paying it off
in my highschool in the robotics class everyone copies me because they are too lazy to learn java
That happened to me!
lol
I used to just do their homework because it was a template and only one right way to do it
I'd just give them a copy
But when the tests come and everyone gets 0%
It's pretty hilarious
Like, except you
Just tell them it's like reading a recipe. At the start is the ingredients, and the bit after that is the instructions
but he's the best teacher i ever had
And to go "Line by line"
BASIC is just 1st line to END line
That's why people should start with BASIC
You ever play in pygame?
Like play around?
we are using processing and many of them after more than 2 months don't even know what size() does
nope
I think that's an often overlooked point in programming. "Definitions". English language is integral to understanding what shit does
Like, if you don't know a word, look it up in a dictionary
for sure. 100%
Pygame is pretty fun
always works
I'm Spanish and everyone in my class is really bad at English
It must be doubly difficult to code in a foreign language
But again, use a dictionary! ❤️
I am learning Arabic language
I do evening classes
if you mean Russian for sure but English is not that hard
that's cool
English has a lot of exception words
So you gotta have a good memory
If you're learning English
Arabic is more like assembling Lego
Lots of strange prefix and suffix
most of my friends struggle with irregular verbs
what a comparison
oh I didn't know that
Right, afk. Hopefully someone will turn up who can help me figure out my display problems
Thanks for the chat
bye
more VR in Python using HARFANG 3D
works on the HTC Vive, the Oculus Rift S or even the Oculus Quest 2, in Link mode
@pure prawnno need for this language. please report such incidents to @light nest
Hello so i started a minesweeper project using tkinter the probleme is how do i get the position of the mine i made the mine as a button
Am using grid by the way
ah
personnaly i'm making a 3d project using canvas
but you can use the app module if you have directly install python for all the functions of the modules
here's what i have do so far. The 3d engine is made from A to Z.
but i'm actualy trying to make a sorting algorythme for drawn correctly the cubes(i like cubes)
Hey @safe spade!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
Also, for all the curious i would create a git hub page with the video game engine and if my little brain understand of to do it, i would make a library.
!code-blocks
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.
x = 1
y = 2
soma = x+y
print(soma)
Hey, I teach kids from grade 4-12, 3D modelling and how to create VR/AR games for free. The concept of metaverse has amped recently which has resulted into requirements for creators of metaverse. I am making sure the Neo-generation is here boosting their skills.
If you wanna check out what kids have built, here is an example https://play.hatchxr.com/@Wyatt/Trophy-on-fire this game is built by grade 5 student.
So if you know anyone who would benefit from this, you could tell them to fill their deeds here;
https://ck12.me/s/c/Meta_Discord .
The platform where I teach them to built is patented by me and is built by MIT scientists. If any adults also wanna give it a try; do check it out https://hatchxr.com/
Hey how can i make a License Agreement/User Agreement like this screenshot?
how do you add a border (like a black border for ex) to a shape in pygame
Hi, i have been working on a project. it takes inputs from a Xbox one wireless controller and turns a motor using a raspberry pi, motor controller and some male to female jumper cables. It detects the inputs using pygame. it should print [letter goes here has been pressed] but instead prints the statement over and over again whilst I'm not holding down the button. ```py
import pygame
import time
from pygame.constants import JOYBUTTONDOWN, JOYBUTTONUP
pygame.init()
##GPIO.setmode(GPIO.BCM)
##GPIO.setwarnings(False)
##GPIO.setup(17,GPIO.OUT)
##GPIO.setup(18,GPIO.OUT)
pygame.joystick.init()
joysticks = [pygame.joystick.Joystick(i) for i in range(pygame.joystick.get_count())]
for joystick in joysticks:
JOYname1 = (joystick.get_name())
print ("[Device Found and connected! Device name: " + JOYname1 + "]")
is_4_pressed = False
is_5_pressed = False
is_0_pressed = False
#LB
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
if event.type == JOYBUTTONDOWN:
if event.button == 4:
is_4_pressed=True
if event.type == JOYBUTTONUP:
if event.button == 4:
is_4_pressed=False
if is_4_pressed == True:
print("['LB' Button is held down]")
##GPIO.output(17, True)
##GPIO.output(18, False)
time.sleep(0.5)
#RB
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
if event.type == JOYBUTTONDOWN:
if event.button == 5:
is_5_pressed=True
if event.type == JOYBUTTONUP:
if event.button == 5:
is_5_pressed=False
if is_5_pressed == True:
print("['RB' Button is held down]")
##GPIO.output(17, False)
##GPIO.output(18, True)
time.sleep(0.5)
#Y
for event in pygame.event.get():
if event.type == JOYBUTTONDOWN:
if event.button == 3:
print("['Y' Button has been pressed]")
exit(69)
#A
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
if event.type == JOYBUTTONDOWN:
if event.button == 0:
is_0_pressed=True
if event.type == JOYBUTTONUP:
if event.button == 0:
is_0_pressed=False
if is_0_pressed == True:
print("['A' Button is held down]")
##GPIO.output(17, True)
##GPIO.output(18, True)
time.sleep(0.5)
the image could not be loaded :/ any errors
hey any1 wanna collab on a game
hi iam game designer
are you programer?
Is that pygame?I dont remember it tbh
nah that looks like ursina
Arcade 2.6.6 (2D graphics/sprite library) is out: https://api.arcade.academy/en/latest/development/release_notes.html
lesgo
Hey @safe spade!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
https://paste.pythondiscord.com/ilocowipes.rb
Here's some code for people who want to visit the next dimension
here's an another abomination
working on a new scale tool for ursina's level editor
Nice. Keep up the good work!
Hi Everyone,
I am trying to merge .fbx (3d images) files. Could anyone please suggest python package for that ?
wait- that's ursina?? :O
he made that editor himself ursina itself is just code
If anyone still wants to learn how to build Metaverse, please do sign up here; https://ck12.me/s/c-Metaverse
Winter Break from school is the perfect time for your child to build and code their own virtual world or the Metaverse in 60 mins. Your child could build a snowy Winter Land or an outer space or just any version of their world online. Our Winter Camp, empowers each child to explore the intricacies
hi i am new to game developement
hi
Same
Himaki, isn't that class in JavaScript? If so, you might want to advertise it on a server dedicated to that language. It seems off-topic on a Python discord.
If i wanted to make a 2d "game" so to speak, would the best approach be PyGame?
arcade would be a good choice too
Never heard of it, are there any good courses I can look for?
I don't know, but it does have tutorials in the docs: https://api.arcade.academy/en/latest/
Thank you!
If you are new to Python and want to learn Arcade and Python, you can check out https://learn.arcade.academy/en/latest/
how to make fortnite pls
- Get a 250 person developer team
1. Be a billionaire.
2. Create a new corporation and hire a lot of people.
3. ??????
4. Profit.
just wait two weeks
lesgo bro i have an idea game
🖐️ i have a problem with lobby verible. When I assign the value of False to a variable, the button still displays.
import pygame
import webbrowser
from lobby.lobby import *
pygame.init()
lobby_window = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
class WindowSizeConverter:
def width():
return lobby_window.get_width() / 100
def height():
return lobby_window.get_width() / 100
width = WindowSizeConverter.width()
height = WindowSizeConverter.height()
flag = True
lobby = True
while flag:
if lobby:
# TŁO
lobby_window.fill((0,0,0))
# START PRZYCISK
Buttons(lobby_window, 3, 2, width*20, height*4, (230,7,7), "Test").draw()
if Buttons(lobby_window, 3, 2, width*20, height*4, (230,7,7), "Test").is_over():
for event in pygame.event.get():
if event.type == pygame.MOUSEBUTTONDOWN:
lobby = False
print(lobby)
#webbrowser.open_new_tab("")
# STRONA PRZYCISK
# WYJDŹ PRZYCISK
# IF BUUTON WAS CLICKED
for event in pygame.event.get():
if event.type == pygame.QUIT:
flag = False
pygame.display.update()
you should clear the screen and draw other things when the variable is false right? otherwise it will display the things of the previous frame
how do i clean the screen?
lobby_window.fill(color)
oh thanks, it works
Nice!
after giving the print statement you have to make the variable is 4 pressed false.
oh now i know how to get my assets ready
I want to make my character stand still in the direction he was walking, when he stands still, hes looking straight ahead
Frente = front
Personagem = character
Comandos = commands
Just built a game engine in rust
wow
did you do pygame.image.load("...").convert_alpha()?
Tries to create a state that stores a direction they were going. From there, with else-if, just make the image match what you want.```
Tenta criar um estado que armazena a direção em que eles estavam indo. A partir disso, com else-if, é só fazer a imagem corresponder ao que você quer.
anyone here into blockchain? if so have you heard of XAYA/Taurion/Soccer Manager Elite?
!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.
I'm working on making a dialog box for a game, and I finally figured out how to automate the text to move the next line down so I can just copy and paste batches of dialog. And it feels great.
I'm going to work on making a click to continue the dialog sort of thing next.
hi, cna anyone help me with ursina, only the first platform loads and not the 2nd one
from ursina import *
from ursina import entity
from first_person_controller import FirstPersonController
app = Ursina()
platone = Entity(
model = 'cube',
collider ='mesh',
texture = 'grass',
scale = (10, 1, 10),
postition = (0, 0, 0)
)
plattwo = Entity(
model = 'cube',
collider ='mesh',
texture = 'grass',
scale = (10, 1, 10),
postition = (12, 0, 0)
)
player = FirstPersonController()
Sky()
app.run()
You wrote postition instead of position so they're both in the same place
oh, thanks! haha
any good libraries to make games on the terminal
hi everyone
!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.
i made pong with multiple balls 0_o, its chaos
Hello
can anyone rate my Python game?
Its my first PyGame game
Hey @runic sail!
It looks like you tried to attach file type(s) that we do not allow (.rar). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.
Feel free to ask in #community-meta if you think this is a mistake.
dm .py
ok
how can I make a pygame program to exe]
before with a metal texture on my created blocks.....
after implementing a fricking fish texture on my blocks....
You can try uploading the file and sharing the download link or film it then show upload the video
may i see the source code?
Want to see a flying UFO? Here's my next creation made with my voxel engine : https://paste.pythondiscord.com/uforunisek.rb
!rule 1
1. Follow the Python Discord Code of Conduct.
!rule 6
Idk
!rule 1
1. Follow the Python Discord Code of Conduct.
2. Follow the Discord Community Guidelines and Terms Of Service.
!rule 2");print("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH");
The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.
!rule 2");import flask;import nltk;nltk.download();print("hello world");
The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.
ff
Why my code is always buried under a ton of messages not usefull . But IceeBee is breaking
The rules
Repost with screenshot? :)
Hi!, I want to learn game development what do you recomend?
idk
godot with gdscript is quite near python
hows this for a soundtrack for my game
Nice I like it
Wait a little bit, i would post it
cool
Turn your phone into a wireless game controller for Call of Duty game.
All the setup and source code available at GitHub repo (Give a star if you like).
GitHub Repo : https://github.com/YashIndane/Call-of-Duty-
My Linkedin Profile : https://www.linkedin.com/in/yash-indane-aa6534179/
Play call of duty using your phone as a wireless controller
coco2d, and panda3d
there is a library made for making games with just a few lines of code, its called ursina if you want to check it out
Thanks
godot can be used with python - I've seen people use that to bring ML libraries to godot games
Oh yeah I got it
Hey @devout karma!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
To add to this, Godot 4.0, which is not officially out yet, is a huge improvement and is designed to work with pretty much any language you want as long as someone has made a plugin for it (one for python and many others already exists).
Isn't it how it currently is?
Or does it add more official support for arbitrary language plugins?
You can already, but 4.0 makes it nicer.
ah
here's the accomplishement of my 3d base Voxel engine.
Hey @safe spade!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
arg
https://paste.pythondiscord.com/emoxuwoloz.rb, here's the code for the curious, 100% python using only tkinter for the display
here's the modules not implemented by default:
-pip install mouse
-pip install keyboard
here's the git hub page : https://github.com/ModAndThink/Python-and-game/tree/python
Is Panda3D game engine to go for Python programmers ?
so i need help
i know how to make a window pop up but i cant find out how to customize the window. also, finding out how to edit the window will be helpful
the game will be similar to a clicker game
Hhhhhhhhhmmmmmmmmmmmmmm
You can use tkinter windows
There is by default a package for pop up windows
Or create your own using widget
Tkinter is a power full tool for ui
who knows how to make an autoclicker in pthon?
I made one:
import pyautogui
time.sleep(5)
......
try this
import pyautogui
while True:
pyautogui.click
it'll just keep clicking at 11 cps (i think)
the worst yet best advice is to not make a game with python, try more popular engines like unity or godot
use tkinter
cool cool cool
Just use unity
I'm trying to change either side of an image, using .flip() but when I use a key the image goes back to the initial state or do I do it to keep it flipped?
Need a lot more context here. There are lots of game libraries and image libraries with flip()
I'm use self.image = pygame.transform.flip(self.image, True, False)
I assume it would just keep flipping whatever image you give it
ah right, so there's something with your movement logic
Would it not be simpler to pre-generate two sets of your sprite images?
One left turning and one right turning
.. and just detect direction and pick from the right version?
Yes
I would definitely do that. It's both faster and reduces complexity a lot
Then direction would just be set when pressing the left and right key. easy
I used Sprite.Group I don't know how to update these images below
I actually don't know what to call these images
sprite.image?
Yeah it seems you can assign a surface like that
I'm not that into pygame sprites, so probably others are better to answer this. I would at least load all the surfaces into a dict or something. Have a different key for left and right facing so they are easy to look up.
I'm going to make these keys so I don't know what to call them
This dosent work for me
please help
Creating a window secreen
wn = turtle.Screen()
wn.title("Snake Game")
wn.bgcolor("blue")
the width and height can be put as user's choice
wn.setup(width=600, height=600)
wn.tracer(0)
head of the snake
head = turtle.Turtle()
head.shape("square")
head.color("white")
head.penup()
head.goto(0, 0)
head.direction = "Stop"
food in the game
food = turtle.Turtle()
colors = random.choice(['red', 'green', 'black'])
shapes = random.choice(['square', 'triangle', 'circle'])
food.speed(0)
food.shape(shapes)
food.color(colors)
food.penup()
food.goto(0, 100)
pen = turtle.Turtle()
pen.speed(0)
pen.shape("square")
pen.color("white")
pen.penup()
pen.hideturtle()
pen.goto(0, 250)
pen.write("Score : 0 High Score : 0", align="center",
font=("candara", 24, "bold"))
What doesn't work? What happens? Which part doesn't work?
From what i see, you are trying to make a snake game using turtle. But turtle is not a great library for make video game. I advise you to use the canvas of tkinter. You can use my video game engine for inspiration : https://github.com/ModAndThink/Python-and-game/tree/python
anyone know much about panda3d?
Not a lot
But there is the ursina library who use panda3d. There is a lot of documentation so you wouldn’t be lost
And if you want to use panda3d, you can go see the ursina code
ursina docs are confusing and ursina doesnt hav emuch of a community
idk, the ursina discord seems more active than this chat
but yeah, if you want to use panda3d, use panda3d. I wouldn't use it if it wasn't good
for that matter python is NOT good for anything 3d or games. Id suggest godot if you know python or unity if u know c#
I think it's great for games, especially compared to unity
With my video game engine 🙂
anyone good with pygame ball bouncing physics?
@autumn moat I can help I am working on a pong game right now
For those who are familiar withpy pygame pygame.mixer.pre_init(44100, -16, 2, 512)
as far as my knowledge goes lowering that 512 to something like 64 should give a bad sound(like unclear) but it isnt in my case pls help?
I tried using my pong mechanics but it relies on bouncing off of objects instead of the side of the screen
im trying to make a ghetto version of sideswipe rocket league
Hmm, concept sound nice, BEST OF LUCK 😁
Arcade 2.6.7 is out: https://api.arcade.academy/en/latest/development/release_notes.html
Hi
they told me that on this server they will help me create a blender python script for a game
well you can make the walls of your pygame window bouncy too
(Apologies if this is in the wrong channel, couldn't find where else to post this.)
Has anyone thought about doing a small game jam with Python to aggregate data from sites like Reddit and YouTube using their APIs, and using that data to make a game around it? From the data you could generate character traits, aggression, likeness, intelligence, skills, etc. Coming up with the core game play loop would be the tricky part.. What do you do with those characters that would be fun? Zelda like RPG? Tower defence? Shooter? RTS?
I'm interested in knowing your thoughts!
can anyone help me here?
I want to create a game using python for my exhibition
i dont know anything about python
im learning html
bro think on what ure ssaying
I have, it's based on experience
I've used Unity for 14 years
And have shipped games for all the major consoles
Cross platform is unity's biggest pro by far
sure but pygame doesnt go even close to unity in gamedev
agree
Im looking for some coop game dev. Im not really creative but i enjoy programming games and prototypes. Is there anyone that would be willing to work with me to see their game come to life?
Im also willing to help novice programmers.
Any1 familiar with Ursina Engine?
yes, quite
I can't figure out how to add a custom texture to a cube, could you help me?
just write the name of it
like this: ```py
Entity(model='cube', texture='texture_name')
Be more specific then
How can I add a custom texture. (How do I implement one).
Not sure what you mean. How to make it?
is there anyone that can help with my pygame related problem im in the #help-lollipop channel
As I said, I want to make my own custom texture, and not use a built-in one.
Textures are just images. You can make them in Photoshop for example, or event paint
But how would I implement this texture to a 3D object?
I've already tried that, but it wont work properply
Oh you mean define how the texture will fit on it?
That's defined in the model with uvs
uv mapping
Yeah I guess? I have a png file of a picture, but all the tutorials I followed is saying i need a .blend file for it to be a 3d object
But I can't get it to work
It doesn't fit the object right, and it also is not 3d, check out this message: #help-pancakes message
I can't see anything wrong in that screenshot
Read the messages above too.
What does the console say? Any error messages?
Do you have blender installed? You need that to open blend files
Yup everything is installed, no errors, the textures isnt loaded and it doesnt apply it to the blocks
So what doesn't load? The model or the texture?
Only thing wrong I can see in the code is that you use load_texture() instead of writing just the name
The model doesn't work
The texture still somehow gets applied, but it gets applied wrong
🤷
look up uv mapping on youtube and you'll understand
Alright thank you
anyone?
in #help-cherries now
Anyone looking for coop game dev? Id like to help make a relatively simple game. Ive made tetris and space invaders.
can i get help added collisions to an online multiplayer
i have collisions between players and the map but need help implementing collisions between the players themselves
what engine?
not using an engine
dude I want to create a game like PUBG a battleroyale game
can I create it using Python and how
??
?
??
??
?
?
?
does fullscreen pygame scale things up/down when switching bewteen different resolutions. like for example my monitor is 768px tall so if something is at 800px i cant see it but if i export it with pyinstaller an give it to someone with a 1080p moitor will they be able to see it?
HI everyone, quick question about how to handle the dependencies in python.
I m not much into game dev but more data app but the stakes are the same.
How to build an app and share it to a wide range of people using os or windows or linux and make it usable with an executable file just like any software.
not at all
if ure askin specially with python i dont have an idea.
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController
from random import uniform
app = Ursina()
class Blocks(Button):
def __init__(self, position=(0, 0, 0)):
super().__init__(parent=scene,position=position,model="cube",origin_y=0.5,texture="white_cube",color=color.color(0, 0, uniform(0.95, 1)),highlight_color=color.lime)
def input(self, key):
if self.hovered:
if key == "left mouse down":
block = Blocks(position=self.position + mouse.normal)
if key == "right mouse down":
destroy(self)
if key == "q":
exit()
class Player(FirstPersonController):
def __init__(self):
super().__init__()
class World:
def __init__(self):
Sky().texture = "sky_sunset"
for i in range(30):
for j in range(30):
block = Blocks(position=(j, 0, i))
if __name__ == "__main__":
player = Player()
world = World()
app.run()
Minecraft in 34 lines 
kinda reminds me of that clear code youtube tutorial on minecraft in python
you should also add a y position to the for loop in world
and make it so that the bllocks are randomly generated
tried that, also tried to make the blocks ranges to be bigger but it ended up being super laggy
idk the fix though
i followed that tutorial 😂
I edited it a bit though
for z in range(20):
for x in range(20):
for y in range(5):
if random.randint(1, 3) != 1:
block = Block((x, y, z))
maybe just add blocks gradually on the update function and wait till the blocks are done before loading the player
I dont know what its called but I was thinking of implementing that when you walk, a chunk of blocks gets generated towards the direction you walk, and the same amount of blocks behind you gets removed
to reduce the lag
but idk how to do that
would you have an idea?
if you image in 1D and you move right, when crossing a limit, move the leftmost blocks to the end
then do the same for all the directions
this is good for making an infinite world
but for better performance you should generate chunks instead of individual blocks too
how would I generate chunks? This is also 3d
Store the voxel data in a 3d list, for example 16x16x16. For each voxel, check the neighboring voxels and only add a face if there's not another solid block there. You can use the Mesh class for this. For collision you either want to wrtie custom voxel based collision, or only do collision around the player and not the whole world
Thanks, could you also provide a very simple non-working psuedo code example?
maybe minecraft in python isnt the best idea....
take up an engine unless ure an expert n programming
ursina is a engine?
this is how it looks rn
I just need the blocks to be auto generated
to reduce lag
You'd run into the same issue in any other engine though.
But yes, you should consider starting with something simpler. It's pretty advanced
Hmm, what could be more simple to do, to learn chunk generations
chunk generation is just procedural geometry
Something like an arcade game is easier to start with
Isn’t Minecraft generation the result of making a noise image and replacing white and black by values in the y coord?
It depends how ambitious you are. Shrink the height and visible part of the world makes it a lot easier. Making something Terrariaish is also a lot easier... but still a challenge.
And like pokepetter so saying, procedural games are much more difficult. You can of course start making that, but it will be a massive challenge.
I helped out on a Terraria like game recently using the Arcade library. It turned out to be a lot more complex than the authors originally imagined it to be. Subprocesses to dynamically create new chunks. A lot of optimization to make chunk loading and unloading fast. Collision, block selection, terrain generation.. and the list goes on and on and on ...
Hey @ornate inlet!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
how do i do to convert a python file WITHOUT LIBRARY to an executable
convert to an executable without using any libraries like pyinstaller? You don't.
Python isn't a compiled language. You need the interpreter to run python code. Pyinstaller cheats by packaging an interpreter along with your script into an exe file. That's pretty much the only way to "convert" a python file into an executable.
if your script uses only builtins, maybe nuitka would work to compile your script into C++ code and that way into an exe
ok
i finaly use pyinstaller
because i started to become crazy
here's the game i made using my game engine
Hey @elder hearth!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
:incoming_envelope: :ok_hand: applied mute to @elder hearth until <t:1639859953:f> (9 minutes and 59 seconds) (reason: newlines rule: sent 103 newlines in 10s).
!unmute 689395678484758591
:incoming_envelope: :ok_hand: pardoned infraction mute for @elder hearth.
!paste Please use this in the future :)
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.
sure
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.
Hey @ornate inlet!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
that is my quiz which i made inthon py
did u write the answer
or did it automaticly came?
Ok
The engine still experimental but if I would post a little guide on the git
I think I would work on it tomorrow
Keep in mind that he would change a lot
Did you Just paste the output from Python IDLE into a py file?
@quasi patrol i post a little guide on how to use my engine
https://github.com/ModAndThink/BaguetteEngine, here's the url
i see
but the library BaguetteEngine in the site package
in a folder name BaguetteEngine
No module named 'BaguetteEngine.Library'
File "C:\Users\thema\AppData\Roaming\Python\Python39\site-packages\BaguetteEngine\Application.py", line 567, in <module>
app = Application()
File "C:\Users\thema\AppData\Roaming\Python\Python39\site-packages\BaguetteEngine\Application.py", line 483, in __init__
self.screen = tk.Tk()
AttributeError: module 'BaguetteEngine.Library.tkinter' has no attribute 'Tk'```
idk
it's strange
it's say that tkinter has not Tk()
very strange
were you put the folder BaguetteEngine
@lost agate ?
hm
ok
it's work
what do i need to change here
ok it launched but what is this
i downloaded this
Done
Don’t forget to change the first line
you have also a little code in the README file
Hello, why are these green lines showing in my pygame window?
Code ```py
import pygame
pygame.init()
WIDTH, HEIGHT = 500, 500
WINDOW = pygame.display.set_mode((HEIGHT, WIDTH))
SQUARE_SIZE = 30
BOARD_SIZE = SQUARE_SIZE * 8
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
def draw_squares():
for file in range(9):
for rank in range(9):
square_colour = WHITE if (file + rank) % 2 == 0 else BLACK
pygame.draw.rect(WINDOW, square_colour, (SQUARE_SIZErank, SQUARE_SIZEfile, SQUARE_SIZE, SQUARE_SIZE))
draw_squares()
run = True
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
pygame.display.update()
it runs well enough for me
thanks
Hey @knotty flicker!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
# Player
PlayerImg = pygame.image.load("Player.png")
PlayerX = 370
PlayerY = 480
PlayerX_Change = 0
# Enemy
EnemyImg = pygame.image.load("Enemy.png")
EnemyX = random.randint(0, 800)
EnemyY = random.randint(50, 150)
EnemyX_Change = 0.8
EnemyY_Change = 40
# Bullet
BulletImg = pygame.image.load("bullet.png")
BulletX = 0
BulletY = 480
BulletX_Change = 0
BulletY_Change = 10
# Ready = you can't see the bullet on the screen but its ready to be shooted.
# Fire = The bullet is currently shooted.
Bullet_State = "ready"
def Player(x, y):
screen.blit(PlayerImg, (x, y))
def Enemy(x, y):
screen.blit(EnemyImg, (x, y))
def Fire_Bullet(x, y):
global Bullet_State
Bullet_State = "fire"
screen.blit(BulletImg,(x + 16, y + 10))
# Game Loop
# if Keystroke is pressed check whether its right or left.
if event.type == pygame.KEYDOWN: # Keydown means u are pressing a key
if event.key == pygame.K_LEFT:
PlayerX_Change = -1
if event.key == pygame.K_RIGHT:
PlayerX_Change = 1
if event.key == pygame.K_SPACE:
Fire_Bullet(PlayerX, BulletY)
if event.type == pygame.KEYUP: # KEYUP means u are releasing the key
if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT:
PlayerX_Change = 0
# Checking Player movement's boundaries
PlayerX += PlayerX_Change
if PlayerX <= -2:
PlayerX = -2
elif PlayerX >= 738:
PlayerX = 738
# Checking Enemy Movement's boundaries
EnemyX += EnemyX_Change
if EnemyX <= 0:
EnemyX_Change = 0.5
EnemyY += EnemyY_Change
elif EnemyX >= 738:
EnemyX_Change = -0.5
EnemyY += EnemyY_Change
#Bullet Movement
if Bullet_State is "fire":
Fire_Bullet = (PlayerX, BulletY)
BulletY -= BulletY_Change
I have deleted some unimportant codes coz it was 2k+ words
so when I run my game
it gives me error that
Traceback (most recent call last):
File "d:\Space_Invaders\Game.py", line 79, in <module>
Fire_Bullet(PlayerX, BulletY)
TypeError: 'tuple' object is not callable
can someone help me
am a beginner in pygame
module
I need the blue car to increase in size every 10px to symbolize it's approaching I don't know how to do thathttps://github.com/Gabriel018/Python-Games
The impression of 3D is based on 2 facts :
- your need (internally) a depth information (Z)
- the further, the smaller, so if Z = 1 when the blue car is near and Z = 10 when it is far, just divide the size/scale by Z
- same for Y coordinate: you should not increase it linearly but divide it by Z instead
In a nutshell, you should store your coordinates in 3D, internally
.
def draw_squares():
offset = REMAINING_SPACE // 2
for file in range(8):
for rank in range(8):
square_colour = WHITE if (file + rank) % 2 == 0 else DARK_GREEN
pygame.draw.rect(WINDOW, square_colour,
(SQUARE_SIZE * rank + offset, SQUARE_SIZE * file + offset,
SQUARE_SIZE, SQUARE_SIZE))
The problem is it is drawing the squares from top to bottom, but I want it to draw squares from bottom to top
I want the squares to be drawn like this
Hey @inner crown!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
dont look at the txt files, they are just ascii
im kinda new as well so go ahead and give me tips lol
I'm trying to see the mouse position on the screen in pygame how would I do this?
#help-burrito any1
Where can I get a blender character model thats already rigged for animation to play around with in Ursina?
on Sketchfab, maybe ?
Thanks
anyone wanna recreate Link's Awakening in Python?
In blender....
Texture didnt load in Ursina....
How to get at texture in obj file? @snow hill
Theres also a .mtl file. Is blender loading that?
guys I just wanna ask if its possible to do a game menu with turtle library?
Sure
how? Im still new to python and im trinna make a minigame
But it would be painful if using a seperate game engine....
Explain more of what you want to do? A game with the Turtle module?
Embed turtle.TurtleScreen in a tk canvas
https://pastebin.com/GbY563Vh so here is the script
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
can u check the script first? then ill explain how exactly i wanna do it
You need to learn tk to do this
it depends... The textures are usually mentionned in the mtl file. It can be any format, tga, png, jpeg... it really depends how Ursina is able to import OBJ files.
One detail, however. The OBJ file is usually not able to carry animations or boned/skinned characters
@grim abyss you might want to try this, maybe... 🙂
https://github.com/harfang3d/tutorials-hg2
use gltf/glb if you want to include stuff like textures and animation data
to load textures, write the name of the image
using mtl or loading it from a blend file is kind of weird if you're making textures from scratch yourself
Interesting...
Question: is there person who would like to help me improve my engine?
@snow hill is there a zipfile of the tuts?
I have to send files from my phone to pc. PC without internet atm....
Every single GitHub page give you a download link to a zip file 🙂
Search for a green button 🙂
I had to load the "desktop" site, lol. Mobile version doesnt have green button 🤣
Can’t you share the net connection of your phone to your PC ? 🙂
Well I could except this new phone has USB-C and I have no way to connect to my PC. Waiting on an adapter.....
No 3.5mm jack either... 😐
Hell of a phone though, lol
Well, it shows that maybe having a proper internet connection is a kind of priority over any other topic 😓
I hope you can get this fixed really soon 😗
I live in a rural area. Only decent internet is mobile 4gLTE
Ill be good once the adapter comes and I tether phone to pc
65,000 nodes, n-body simulation using compute shader.
Neat
You need more compute power! I see stuttering. 😝
That's more the video than the program. It runs pretty smooth in person. Makes the graphics card fan kick on though.
Ahhh
Updated:
Simulation of the gravitational interaction between 40,000 stars. About 31 FPS on an nVidia 980Ti.
This is a lot smoother in person. The video compression does not play well with this type of video.
Very cool. You should add in sound for each "body" that increases in frequency with a increase in proximity....
@frozen knoll does Arcade need pytiled-parser 1.5.4 specifically? I have pytiled-parser 2.0.1 and Arcade won't install....
Development branch is using 2.0.1. pytiled-parser 2.0.1 was released like 2 hours ago
It’s all backwards compatible, it should work fine with either
There were no changes to Arcade for updating to pytiled-parser 2.0.1 from 1.5.4
Oh god.....I'm in dependency hell now! 😫
The screenshot shows there are some network issue I think.
The version is there, but pip can't get it?
Yeah. No net on pc. I'm downloading libs from pypi and installing manually...
ahh
Ahh, regardless you should be fine with 2.0.1, just ignore the error about it
Next release of Arcade will default to using 2.0.1
So "force" it to install?
Oh does it actually refuse to install? I assumed it would just complain but continue anyways
If there’s a way to force it that would be fine I’d imagine
Yeah it's refusing.
Yeah if you can find a way to force it to install with that would be fine. We’re releasing a new version of Arcade probably this week that uses pytiled-parser 2.0.1. I just released pytiled parser earlier tonight and updated Arcade dev branch. Otherwise probably need to get 1.5.4 on it if it won’t install at all
I'm trying to resolve dependencies....
There's no way to force it using pip
Maybe I'll try from a tar....
Oh my.....lol
Oh, 1.5.21 is installed...
Ahh yeah Arcade needs the new Pyglet 2 stuff, and particularly 2.0.dev12 if you’re on Arcade 2.6.7.
There’s a good bit of cooperation between Pyglet, Arcade, and pytiled-parser development so the releases of Arcade tend to depend on updates within those dependencies frequently
I see
I've downloaded the zip from the pyglet github
Got it working finally 👍
@flat aurora thanks
this code
pygame.draw.rect(screen, (124, 252, 0), (400, 200), 20)
gives me rect argument is invalid
Supply a rect ```py
pygame.draw.rect(surface, color, pygame.Rect(30, 30, 60, 60))
hello?
hey does anyone how to randomise a position of an object?
Use the library Random
could you explain
Random is an build in library who can generate random numbers in your case
so how would i use it would i just put random x , y?
No
oh
int is solid number isnt it
Yes
ye a int
i thoght that only did small numbers?
no
oh k
so is that saying 0-10
choose a random number in the range [0,10]
5
yep
points.goto(random.randint(0,1000)) so like this
yes
what about the negative numbers
(-10,10)
so in my case -1000,1000
ok thanks for the help
https://pynative.com/python-random-seed/ check this. Use the current time for a seed value to get unique random numbers....
.topic
i got the ramdomiser working 😄
Immersion
anyone have experience with processing.py?
go into #❓|how-to-get-help
Hi, I am creating a game in which you have catch falling objects. It's not done yet, but can somebody review my code and tell me if it is written in a bad or good way? Thanks
hello everybody...i'm starting to learn python and i saw some "game" for learning...what i found was too much child oriented and i'm searching something interesting to do while i do the google course...
do you have some gamification stuff i can do/replicate?
I suggest you to create a pong game
You can use pygame, but turtle is more user-friendly
Anyone use pyglet? I just saw pyglet is faster than pygame.
that's some nice stuff but i was looking for something else...
maybe I expressed myself badly..
i'm not searching a library for building a game,
i'm searching a game for learning python...
hhmmm
i advise you Sololearn
it's also a mobile application
but personnaly, for learn to program, a good book can help a lot and if you combine it with experienc by creating game for example, it's make a powerful combinaison
class board:
def __init__(self):
self.spaces = [
[".", ".", ".", ".", ".", ".", ".", ],
[".", ".", ".", ".", ".", ".", ".", ],
[".", ".", ".", ".", ".", ".", ".", ],
[".", ".", ".", ".", ".", ".", ".", ],
[".", ".", ".", ".", ".", ".", ".", ],
[".", ".", ".", ".", ".", ".", ".", ],
]
def display(self):
for row in self.spaces:
for space in row:
print(space, end=" ")
print()
print("1 2 3 4 5 6 7")
print(" ")```
How would I make it so that this would print as one msg and not multiple?
Yo guys
@rotund crest You might want to look at https://learn.arcade.academy/en/latest/ as a way to learn python via creating games, or if you like to learn by example: https://api.arcade.academy/en/latest/examples/index.html
Salutations! Does anyone have any links to beginner game development courses? I'm currently doing Python as the high level language im studying for GCSE and would really like to extend my knowledge on it and thought game development would be a good start
I'm taking this right now: https://www.udemy.com/course/the-art-of-doing-video-game-basics-with-python-and-pygame/. I'm a little over half way through and so far, it has been great.
You're very welcome.
thank you for this
@native flame I linked one in the message right before you asked for one.
ohh i got confused and decided to ask because you said "as a way to learn python via creating games" but i already know python to some extent
But thank you though
thanks guys...will look at this stuff
for now i'm at "hello world" XD
looks like nothin is exploding
Hi, Im working with pygame rn and I just cant wrap my head around this.
When I fill my background:
self.display.fill((0, 0, 0)) spaceship = self.display.blit(self.surface, (self.spaceship_controller.x, self.spaceship_controller.y)) pygame.display.update(spaceship)
When I dont fill it doesnt cover the sprite.
You need to set the color key on your sprite to make it transparent I think. Pygame doesn't handle transparency without a few extra lines of code.
I used a png as img and the surface is transparent. I converted it into alpha and then set all the alpha values to 0 before doing blit onto the surface
and when i dont fill the screen there is no issue
no box around the sprite
PUT THEM ALL IN ONE STRING
I think ursina is pretty easy to pick up after pygame. There are many good frameworks out there for Python, not only pygame.
Or learn c# and use unity :)
Unity is proprietary, not everyone likes it.
Yeah that wasnt rly serious
There are many other engines and framworks, which a way more beginner friendly
https://en.m.wikipedia.org/wiki/List_of_game_engines
I saw from this list. For 3D game engines, I think Godot and Panda3D would be better to pick for Python, they are open-source. Ursina is not an engine yet, it's a framework, and beginner friendly for animated graphics in games. Ursina supports some 3d graphics, not well suited for high quality graphics though.
Game engines are tools available for game designers to code and plan out a video game quickly and easily without building one from the ground up. Whether they are 2D or 3D based, they offer tools to aid in asset creation and placement.
Arcade 2.6.8 is out: https://api.arcade.academy/en/latest/development/release_notes.html
Further Development of parametric building generator using geonodes tesselate patch by Eric85
@tender ledge give me the github link & I'll review it
🕵️🕵️intresting
hello?
what code can i use for visual studio to use a dualshock 4? (controller PlayStation)
can someone tell me how to add an "enter box " in tkinter because i have made a text box but i want it to run the code after it
Hello everyone, I'm trying to get Pygame running on my Mac OS Monterey. The library installs fine and ends up where it should be. I've written a number of functioning programs with pygame on my Linux machine and am using them as tests. The problem from what I can gather is that pygame.display can't be initialized for some reason. Every time I run a Pygame program it fails on the call to pygame.display.set_mode().
I am primarily using a wack-a-mole clone for testing. Here is the error I get:
pygame 2.0.1 (SDL 2.0.14, Python 3.8.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "mole_attack.py", line 34, in <module>
WINDOWSURFACE = pygame.display.set_mode((WINDOWWIDTH, WINDOWHEIGHT), 0, 32)
pygame.error: The video driver did not add any displays
Please let me know if anyone needs more info. I tried to be as detailed as possible. Thanks in advance for any help.
Hello everyone. Is there anyone, who used ursina?
Can you try updating Pygame? It seems they didn’t have M1 support 2.0.3 and I’m guessing it’s probably what’s causing that.
I updated to Pygame 2.1.0 via pip I think that is the newest version but I got the same error. Also I have an Intel CPU in my mac.
Yes
What do you think about my currently developing game?
it's cool
Proin
Game logic hard
looks cool
Hi everyone
you could store the data into a string then print it out after you build it up.
I love game logic.
Has anyone here used the Ursina game engine before? Because i need help with a thing and i cant figure out how to fix the issue
nevermind
found the issue
Better if you just ask the question with all the details.
If anyone here knows pygame proficiently, I want to create a fairly simple top down shooter, and am looking for someone to collaborate with, dm if interested
ive been working on a 2d rpg from scratch with pygame since March
(also hi, new to the server)
title screen of my game's demo. i'm doing the graphics from scratch in aseprite
dragon quest / final fantasy clone, NES-style graphics. play a party of monster people, try to stop evil time traveling humans from destroying the world
game's called Goblin Hero
pygame is obviously not the most efficient platform for a project like this but i've largely done it this way to get better at programming
(and pixel art)
it's about 5000 lines of code right now, put about 300 hours of pixel art into it
that's the battle mode and the overworld
sorry for spam... just a lot to cover at once
^ this is my dev blog
thanks for letting me ramble
also, i might do some newbie helping here, that's a thing i've enjoyed doing before in other servers
As a beginner to python (first language) who's primary motivation to learn is to someday make a tcg mobile game that i've designed (text) years ago... what are the best beginner friendly python game engines to both learn with and to eventually make a proper game with when I have enough experience?
if you're more interested in making a game than learning to code just for the sake of it, i would choose a major game engine (unity, unreal, etc) with mobile support, a lot of these engines are gonna probably have built in drag and drop style scripting without much actual code, i think
i would say the more beginner friendly an engine is for making games, the less well it'll work for learning to code? because it does more of the ground work for you
pygame for example does basically nothing and you have to build everything yourself, so it's not super practical, but good for learning code
Seriously nice job with the game! Love all the pixel art. Well done.
thank you 😊
My secondary motivation is to use my primary motivation to learn how to code for future jobs
so I want to learn how to code while i'm at it
One of the engines i'm looking at is cocos2d+ (python version) but i'm not sure how capable it is or how beginner friendly it is.
no idea 🤷♀️ i've only used pygame, and it's more of a framework than an engine
engines are better for making games, frameworks are better for learning to code
re: gamedev, start small, make Pong or something. make tiny, tiny projects. grow from there
struggled to get into python in the past so i decided to take a different approach to keep me going
oh definitely, having a giant game project kept me coding for 9 months
Might want to look at Arcade as an engine.
im still in the tutorial phase and i need something to work on to keep me going, that way when i learn new things i can be like "ohh so this can allow me to do that, or i can use this to do this, i wonder how ill apply this to x"
It is a good engine to learn on, and you can work your way up to doing shaders.
also is that an armored core avatar
yup
Sick
I would love to make my own 3d game inspired by armored core someday, but the only games i've planned out in word documents and spreadsheets can be made with a 2d engine and would likely be much easier to make gameplay-wise.
If I can keep with python for a few years i'd love to make my card game on mobile
Yeah 2d easier
I’ve had that same thought before lmao, making a low poly indie armored core style game
Ps2 style
great gameplay, and i love building mech's with all of the different parts to make your own perfect AC.
all of the mech games these days use pre-made mech's or the parts are mostly cosmetic or limited
I thought the twist could be mgs peace walker style base management, r&d and stuff
Running a mercenary unit
Arena is fighting to the top of the merc unit
Fans haven’t had a new ac in forever, there’s a market
imagine an armored core mmo on PC, all of the best parts about the game (building/gameplay), mercenary missions, other players, company wars, large battlefields
You’ll never catch me trying to make an mmo unless I’m getting a steady paycheck for it
Too huge of a project
xD
Mmos are for companies w dozens of employees
hey guys, can somone help me understand why the last row isnt being drawn?
MAP = [
[1,1,1,1,1,1,1,1,1,1,],
[1,0,0,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,0,0,],
[1,1,1,1,1,1,1,1,1,1,],
]
def drawMap():
bricks = []
brick_width = 128
brick_height = 96
for y in range(len(MAP)):
for x in range(len(MAP[y])):
if MAP[x][y] == 1:
x_pos = x * brick_width
y_pos = y * brick_height
bricks.append(pygame.Rect(x_pos, y_pos, brick_width, brick_height))
for objs in bricks:
pygame.draw.rect(screen, GREEN, objs)
im actually brain dead, i forgot the 1's in the left side
glad you figured it out
xD
lowkey tho, those are some bulky ass squares
how could i slim them down
also, quick question, how could i give those squares a outline, does anyone know? im using pygame
make them diet? often times I find the most helpful problem is the one that you solve the moment you ask for help
facts
i think the key is voicing the issue so that you can manifest them and understand them properly
true. because as we all know programming/coding isn't a lot of typing out code. it's solving stupid "gosh darn it I knew that" syntax errors
Hello everyone
Have anybody here created chess before?
I would like to ask some questions
Should be a matter of tweaking the numbers
Add a other rect slightly bigger than the one you want to outline?
Seriously it’s like let the goddamn script run 🤦♂️
I would make checkers before you make chess if you haven’t
Thanks for your advice
But I'm already in progress XD
But i have some doubts
Like you have a board and you need to give coordinate to it
I dunno what's the better approach
Either count a1=0, b1=1, c1=2....
Or a1=0, a2=1, a3=2...
Like 2d array?
Yeah
One master list containing a list of all columns or rows
The intuitive thing to me would be to do it in a way that you can access squares with the equivalent of (x,y)
Or i guess whatever chess uses normally
Let me try that
I actually code it in C, so everything is a mess there 😂
Coming from Python, everything is hard over there
For sure
That’s just my instinct for grid representation, a 2d array
I’ve done menus like that
Hi Guys, im looking for a little help if anyone is free. Ive got the basic mechanics of a "duck shooter" game using pygame but i want to add a few more UI elements. The Ui elements arent the problem themselves rather how i want them to work with the mouse pointer.
It would be awesome if someone could help me out here. Just ping me on my window if you've got time 🙂
All help is appreciated,
Thanks guys
broski
Hey @raw shadow do you wanna get on a call? I think i can explain better that way
@raw shadow this is what ive got right now.
A background
Land and water
ducks
A crosshair
Ive already implemented the shooting mechanism and i works fine. What i want is a rifle (ive got the png image) on the bottom, around where the water is and i want the rifle to "tilt" in the direction of the crosshair
heres the rifle
okay, so this is what your gonna want to do.
give me a sec i was just working with this mechanic
life saver!
😇 🛫 


