#game-development
1 messages Β· Page 64 of 1
@spare phoenix how do i set the image to the background of my game??
do image = pygame.image.load
then draw the image onto the screen
by doing screen.blit(image, (x, y))
hope that makes sense
@warm cradle
@spare phoenix I got his error
@warm cradle good
uh
game devs
just wondering
or at least i want to confirm this
drawing the sprites and assets first, and then making the game is an awful design principal, correct?
visual studio @warm cradle
can someone help me convert python script to exe file
anyone know how to add hitboxes and collision
id saw jus use raw codes
such as if statements using the x and y cordinates
but if you really want to get complex there is a coliision method on the pygame website
@spare phoenix https://datatofish.com/executable-pyinstaller/
Need to create an executable from Python script using pyinstaller? If so, I'll show you the full steps in Windows to accomplish this goal.
that is for windows
hello i am new to python i have been watching an tutorial on youtube
on how to make pong on python i did what he did and it still doesnt work
can anyone help me?
Iβve watched the video your talking about
Itβs made in the turtle module which I do not know much about
However I made a pong game using pygame which is much better and there are plenty of tutorials online
@dawn quiver
In terms of your code I think you need to define black. Do black = (0, 0, 0) at the top
You also need to define white
in the buttom
Direct message me
Hey Guys,
I am new to Python
Do you guys have any suggestions for a beginner who wants to design games?
how do i fix this?
Not enough information to answer that
how do i make my mmo server more scalable
??
for instance, in a scenario when i update the state for a player action and send the packets to like other players in the server, the server crashes....
π
nvm π
help me
Where is player() defined? Because you're trying to call that function with those four numbers
@tranquil girder
Look after cHeight in __init__, it's followed by ,
@tranquil girder i removed it but it still gives me the same error
Can I just send someone my code?
Does it fit here? https://paste.pythondiscord.com/
@potent ice yes
@potent ice https://paste.pythondiscord.com/seyehufiqi.m
problem now is?
@potent ice I keep getting this error
@warm cradle you wrote __int__ instead of __init__
@olive parcel ty so much! i was getting so frustrated lol
import sys
a,b=map(int,sys.argv[1:])
b-=1
c=a*2+4
r=range(1,c)
print("\n".join("".join(" "[c-i<j>i:]if(j!=2+a!=i!=j)&(c!=i+j)else str(b:=b+1)[-1]for j in r)for i in r))``` is there a way to get this shorter @silver stratus @full otter
i reduced it to 168
anyone wanna work on a game together
would I be better off using pygobect (gtk) or pygame for a clicker?
Wdym?
now
Whats wrong with it?
fake virus
Its for halloween :[
It is im going to make it playable
!warn 611032279103307798 you've been told repeatedly not to discuss your shady projects here. Is that the only reason you come here for? don't post 3gb download links of whatever it is you're making
:incoming_envelope: :ok_hand: applied warning to @slender tulip.
This is not for a game but i used pygame for this i am a beginner and it is not working
if "play me some music " in query:
pygame.mixer.music.load("D:\(File link)\badguy.mp3")
pygame.mixer.music.play("loops=0")
it is not playing the song
nvm the file name had .mp3 so i had to type .mp3.mp3
test

Any of you ever check out the Tuxemon project? It's an open source Pokemon-style game written in Python:
I'm only learning Python, so I can't assess the quality of the code or anything, seems like a cool idea though.
idk where to get support but im asking here cause its game development anyways i cant figure out how to get the pygame module to be in thonny i clicked the setup file 100 times asked google 1000000 times dm me if yk
@small bridge How are you installing it? You should be using the pip module. Do pip install pygame in the command line to install
My Pygame doesnβt ever work when I try to import it
did u install it
sudo pip install pygame in the terminal
"sudo pip install pygame"
its ez same to say hello !
it said it downloaded, yet it gave me a directory error and then when I try to run it in python, it wont import
how can i check if mouse has been clicked on certain part of screen in pygame
@azure shuttle can you post the error
Hi here! New to this sub :D
I mean, server, sorry lol been using Reddit a lot
I wanna get started with game development using Python, where do you guys suggest I begin?
I have developed a game and published it using Unity(coded in C#).
Would appreciate if y'all could tell me more anout thisπ
Hey Phantom im new to python myself but you can check out pygame.org its a good start
@azure shuttle if youre on linux ya there is that problem because pygame isnt properly connected to pip. You would have to specify a version like pip install pygame==1.9.6. Worked for me.
Send the error of pygame pls
Moon light
I m on Linux and my pygame work really good
Or u can install in the site
There is a site where u can install the last version (2.7)
Write install pygame and u can install the version that u want
It's ezzzzzzzzzzzz
Clap
π π π π π π π π π π π π π π π π π
π
Im on a macOS
hey guys could I get a bit of help?
I'm trying to draw something with pygame but it's not working...
here's my script
Hey @zealous blade!
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:
what is not working?
Hey @zealous blade!
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:
how can I send my script?
because I can't send .txt files
ok well here's the main game loop
def draw_window(win, bird):
win.blit(BG_IMG,(0, 0))
bird.draw(win)
pygame.display.update
def main():
bird = Bird(200, 200)
win = pygame.display.set_mode((WIN_WIDTH, WIN_HEIGHT))
run = True;
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
draw_window(win, bird)
pygame.quit()
quit()
main()
def draw_window(win, bird):
win.blit(BG_IMG,(0, 0))
bird.draw(win)
pygame.display.update
def main():
bird = Bird(200, 200)
win = pygame.display.set_mode((WIN_WIDTH, WIN_HEIGHT))
run = True;
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
draw_window(win, bird)
pygame.quit()
quit()
main()```
mhm
You can use https://paste.pythondiscord.com/ for long code snippets and share the link instead
Theres no parenthesis in line 4, and it would be helpful to show what bird.draw() do
what do you think how hard will it be to code among us in pygame
Gameplay-wise, it wouldn't be the worst, but I think the hardest part would be networking
Do you guys have any idea what filter/shader effect is used here to smoothen out the pixel art?
maybe it was actually drawn that way?
No its a filter for custom designs in Animal Crossing New Horizons
ah
Alright, I think I found it: https://en.wikipedia.org/wiki/Pixel-art_scaling_algorithms#SAA5050_'diagonal_smoothing'
The closest ones seem to be either hq4x, EPX, or xBR.
Looks like you have an infinite loop on lines 17-18
run never gets set to False, so the loop will go on forever and everything below line 18 will never execute
Perhaps you meant to put code past line 18 inside the while loop too (by indenting it inwards by 1 level)
can anyone help me learn pygame
I usually use pycharm but it seems ok
Also for the pygame.draw.square use pygame.draw.rect
If you need help learning pygame I recommend TechWithTim or readthedocs.io
whats pycharm
?
@soft minnow
@dawn quiver
Pycharm is a Python IDE; Here's the link
can someone help me?
i want to implement the ability to aim using a mouse causing the character to point something at that direction
hi there, im trying to code a character creator for my terminal text adventure game and i really could use some help. i want the user of the program to be able to create as many characters as they like and then view the stats of a character by typing ? @character_name into the prompt. i have a function that creates a new instance of the class playable_character and then appends the instance to a list named playable_characters.
the part of the code that is supposed to provide the inspect functionality:
elif '?' in user_input.split()[0]: if '@' in user_input.split()[1]: pc_name = user_input.split()[1].replace('@', '') pcs.index(pc_name) if pc_name in pcs else -1 print("@@@") eval(pc_name).show_stats()
my character creation function:
def create_pc(): character_name = input(" What is thy name?\n> ") # append the new pc to the list of playable characters pcs.append(pc(character_name))
my show_stats function (i tried using it as a class method and as a normal function outside of the player class - instead of passing self the function then takes a character object):
def show_stats(self): print(" Edge", self.edge, "| Heart", self.heart, "| Iron", self.iron, "| Shadow", self.shadow, "| Wits", self.wits, "| Harm", self.harm, "\n Momentum", self.momentum, "| Health", self.health, "| Spirit", self.spirit, "| Supply", self.supply)
my implementation of the functionality described yields a name error: 'character_name' not defined. my diagnosis of the problem is that the playable_character is not available in the namespace (at least thats what i gathered from my stack overflow searches). so when trying to call the function that is supposed to show the stats for that character it results in that Name Error. I appreciate any help very much, thank you. π
Maybe it's the eval? Why not do pcs[pc_name].show_stats()?
this gives me the following error:
TypeError: list indices must be integers or slices, not str
i changed this part of the elif statement like so:
elif '?' in user_input.split()[0]: if '@' in user_input.split()[1]: pc_name = user_input.split()[1].replace('@', '') for pc in pcs: if pc_name == pc.name: # eval(pc.name).show_stats() pcs[pc_name].show_stats()
Oh, my bad. I assumed it was a dict
you can use the return value from pcs.index from the line above then
pc_name is just a string
so eval(pc_name) won't do anything
you can use the return value from pcs.index from the line above then
@tranquil girder can you eloborate please?
like so?
for pc in pcs: if pc_name == pc.name: pcs.index(pc.name).show_stats()
this gives the error:
ValueError: 'pc_name' is not in list
pcs.index(pc.name).show_stats() gave me the same error
by the way thank you for responding π
π
get the index in the list like you already did
then get the element in the pcs list with that index
list[index]
tbh, im getting more confused by the minute. im very much a beginner programmer so i really dont know what you want me to do. i put my code in a pastebin so you can maybe take a look at it. https://pastebin.pl/view/5fc5a89f RAW: https://pastebin.pl/view/raw/5fc5a89f sorry for being a noobπ
Pastebin.pl is a website where you can store code/text online for a set period of time and share to anybody on earth
this is the largest program i have written so far, im learning a lot in the process, but im also way in over my head if you cant tellπ
I'm trying to get several objects to spin around a player. I create them just fine, but calculating their position is giving me some trouble.
`def floatWeapons(player, weapons, iteration=100):
if iteration:
iteration -= 1
else:
print('finished running')
for weapon in weapons:
weapon.teleport(player.origin)
weapon.remove
return
x,y,z = player.origin
r,ΞΈ = cartesianToPolar(x,y)
for i in range(0, len(weapons)):
x2,y2 = polarToCartesian(r+60,ΞΈ + ((math.pi/2)/6 * (i+1)))
weapons[i].teleport(origin=Vector(x2, y2, z + 60))
Delay(.02, floatWeapons, (player, weapons, iteration))
def cartesianToPolar(x,y):
return math.sqrt(x2 + y2), math.atan(y/x)
def polarToCartesian(r,ΞΈ):
return r * math.cos(ΞΈ), r * math.sin(ΞΈ)`
x,y,z = player.origin
r,ΞΈ = cartesianToPolar(x,y)
why do you calculate polar coordinates of a player?
r,ΞΈ revolves around (0, 0, 0) point of the world
for every weapon, calculate relative cartesian coordinates first:
rel_weapon_pos = weapon.pos - player.origin
then transform these relative coords to polar
In your code you rotate weapons around world origin, 60 points farther than player
also, cartesianToPolar can raise division by zero error in expression y/x
good observation...
There's special function for this case https://docs.python.org/3/library/math.html#math.atan2
I would have a collection of food objects
Food objects would theoretically have a location attribute
Assuming the AI knows where all the food is, iterate over all the objects, calculate distance, sort the results, and move to the lowest value
@prime juniper There're lots of spatial tree datastructures, easiest of them are quad/oct trees. They optimize reading (finding nearest food) and make writing somewhat slower (adding food). But for the user it looks like "a list" with ability to add and remove.
I'd go with neumond's suggestion though. It has the benefit of having pre-calculated values, although if your AI moves a lot it could be more (time) costly
I recommend using a dict, @hasty sand, if you don't need to be able to have several characters with the same name
I recommend using a dict, @hasty sand, if you don't need to be able to have several characters with the same name
@tranquil girder
I will look into that with a fresh mind, ty 
Can I set rect in a pygame.sprite.Sprite object to something to skip rendering?
need pygame develepors for project
@tranquil girder
get the index in the list like you already did
then get the element in the pcs list with that index
list[index]
i think i did what you suggested, the tip to make the list of pcs a dictionary was golden, it works now, like i wanted it too. thank you very muchπ₯³ that made my day manβΊοΈ
does somebody know how to randomize some coordinates for an item in a limited area?
maybe just have it pick two random numbers in a range and use that as coords?
@jovial quartz depends on area shape and density distribution
pip install pygame
File "<pyshell>", line 1
pip install pygame
^
SyntaxError: invalid syntax
this is in thonny with python 3.7.7 please help i want to add pygame
is the command wrong?
did download pip lol
didnt*
Youβre probably running it inside the python shell, which is for python code
You should do it in your terminal
You're trying to run the command in the python shell
You should be running it in your command line
Anyone got any good ideas on how to prevent having to draw a scene every cycle in arcade
Cause I'm just drawing squares and the frames realllllly go down
I assume i should be using sprites or something but just wondering what people would suggest
actually yeah I'll just go with the sprite idea
Another question
window.set_update_rate(1/30) for some reason this throws an error whenever i try to set it below 30 fps
TypeError: must be real number, not tuple
I already know how i could probably make a workaround
But just wondering why this is
@valid seal I believe it is because it thinks you are trying to divide the number because it is lower than the average frame rate. Iβd try to find a workaround which Iβm not sure I will be able to help you with.
is there any way of resizing an image in pyglet?
Iβm not familiar with it so IDRK but ask google or YouTube.
I know pygame works though.
Oh ok. Well Iβm sorry because Idk pyglet.
alright. PIL is always a way.
If you would like to make a game with me with python, and have knowledge of pygame DM me and we can make a game together.
if self.paused:
self.paused -= delta_time
if self.paused <= 0:
self.paused = 0
return
Basically just that in the on_update
so i can do like
Oh ok.
self.paused = 1 and it'll pause for 1 second
so i can just set it to update every x seconds
Yes.
any example of how to make loading sign with arcade?
any pygame devs instersted in working on a project
Is there a "descriptors for dummies" book out there? I been trying to read about them but my brain goes fuzzy
I get the idea that if I have an object with properties I can change the attributes using get, set, delete
But there are a lot more scary big words in the definitions i read
Hi dp can u create a server for the creation of the game with the team
@south forge define command line?
My favorite PyGame method name is Surface.get_rect()
Is there a way to move a polygon similar to the way a rectangle is moved?
Hey Phantom im new to python myself but you can check out pygame.org its a good start
@magic rain Thanks, will check it out soon :-)
Dp i dont arrive to send u message
I did a server for our game but i dont arrive to invite u
Pls do a server for our game
guys why do i cant import pygame?
any ideas why it won't change color?
What wonβt
@uncut roost did you download pygame?
By default pycharm installs your modules in a virtual environement so you would have to use the same for vscode
Drop code
You can't use async for a function name. It's the name of a keyword.
Change the async function
how to change async function can u tech me the tutorial
any ideas why it won't change color?
@solemn basinpygame.display.update()is outside the game loop. Cut and Paste it in
So i want to keep a view for 20 seconds and then autmatically switch it
how can i do this
this is what i have tried
https://emkc.org/s/KBaaNn
Dp_Dontmiss pls send me an invitation bc i have a bug and i can't speak with u and invite u
Magnifique pseudo π₯° π
cimer
@spare phoenix pls send me an invitation
@spare phoenix I can't speak with u andinvite u
@spare phoenix my girlfriend has create a server for speak both
@spare phoenix so pls accept
@spare phoenix Ah sorry she didnt invite u
@spare phoenix She will do that
@solemn basin
pygame.display.update()is outside the game loop. Cut and Paste it in
@dense creek alright thanks
Hi everyone. I'm participating in my first PyWeek and using PyGame for my game.
I have this issue: When 2 keys are pressed simultaneously I can detect them with pygame.key.get_pressed() but not with event polling (pygame.event.get()).
with event polling only the last key pressed generates KEYDOWN events and the other one is completely ignored even after releasing the last key.
Is this a bug in pygame?
Hey @eager gate!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
You should see an event for each key, you just have to process the events one at a time
This is Python 3.8.0 and PyGame 1.9.6
But using get_pressed is probably more convenient anyway
Apparently it's the only way that works. I'm baffled no one in the PyGame community identifies this as an issue. I use an event loop to process all events but I can't get them all.
Well, you should get an event for each key. The events shouldn't disappear
If you have PyGame experience, could you take a qiuck look at my posted code to see if there's some obvious mistake from my part? it's simple enough that I think should just work.
https://paste.pythondiscord.com/iquvehogok.cs
@eager gate This one @mint zenith . Thanks
It looks fine
Which two keys are you trying to detect?
Even if you do a simple ```py
while True:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
print("key down ", event.key)
elif event.type == pygame.KEYUP:
print("key up ", event.key)
and press some keys at the same time, you should see an event for each key
Is it either moving or jumping, but not both?
right. I tested the simple loop you suggest. Pressing any 2 keys, only reports events for the one pressed last.
I tested the same thing, and I get an event for both keys
Maybe it's a version or OS thing. I'm in Linux. PyGame 1.9.6. Python 3.8.0
I converted the code to use get_pressed() and it works that way. So I guess I'll just use that.
Thanks @mint zenith
I was testing on Windows for what it's worth
Well, I actually get both events. However, one of the keys reports one event and nothing more while it's still being pressed.
I press RIGHT and hold, then press SPACE immediately after.
events go like this:
right, space, space, space, space, ..., space
while it should be:
right, space, right, space, right, space, ...
while keeping both pressed.
Not sure what you mean. The events only get reported twice: once for key up and once for key down
For the events to repeat like that, you'd have to spam the keys rather than hold them continuously.
I set key repetition, but I guess the issue is there. ( pygame.key.set_repeat(1,100) )
Yeah maybe. I actually didn't notice you did that.
Pls dp_dontmiss accept the invitation
Can i make a game in unity with python
Seems so, with a third-party addon
i'm making a non-gui guess game and in the following code, even if I enter yes, it says I don't understand that. Same goes for no
`else:
print(f'You lost! Correct answer was {sec_num1}')
time.sleep(1.1)
play = str(input("Play again?(enter 'yes' or 'no') ").lower)
while play != 'no':
if play == 'yes':
from levels import guess_1
else:
print("I don't understand that.")
quit()`
plz anybody help
plz
It's .lower()
You should try printing play, that way you can easily see what's wrong
ok
while play !=no @barren sky
Dp Pls accept the invitation of kermit pld
S
@Dp_Dontmiss Pls accept
The invitation on the server at ah
H
Pls sp
Dp
Dp
Plsssss
Can anyone help me fixing my game problem?
dont ask to ask
Okay
I'm making a dinosaur game. But I'm unable to make the collusion
How can i make the dinosaur collide with the trees and then game over?
not really.
pretty much just a,b = a+lst[0], b+lst[1], and that's pretty ugly.
If you need to do stuff like that, don't have them be separate variables at all, but instead something like numpy vectors.
anyone know a server for pygame
but like a dedicated server to it
can someone help me pls
`import tkinter
import random
colours = ['Red', 'Blue', 'Green', 'Pink', 'Black',
'Yellow', 'Orange', 'White', 'Purple', 'Brown']
score = 0
timeleft = 60
def startGame(event):
if timeleft == 60:
countdown()
nextColour()
def nextColour():
global score
global timeleft
if timeleft > 0:
e.focus_set()
if e.get().lower90 == colours[1].lower():
score += 1
e.delete(0, tkinter.END)
random.shuffle(colours)
label.config(fg=str(colours[1]), text=str(colours[0]))
scoreLable.config(text="Score: " + str(score))
def countdown():
global timeleft
if timeleft > 0:
timeleft -= 1
timeLabel.config(text="Time left: " + str(timeleft))
timeLabel.after(1000, countdown)
root = tkinter.Tk()
root.tilte("The Colour Game")
root.geometry("375x200")
instrutions = tkinter.Label(root, text="Type the colour of the words and not the word text",
font=('Helvetica1', 12))
instruction.pack()
scoreLabel = tkinter.Label(root, text="Press enter to start",
font=('Helvetical', 12))
scoreLabel.pack()
timeLabel = tkinter.Label(root, text="Time left: " + str(timeleft),
font=('Helvetical', 12))
timeLabel.pack()
label = tkinter.Label(root, font=('Helvetica', 60))
label.pack()
e = tkinter.Entry(root)
root.bind('<Return>', startGame)
e.pack()
e.focus_set()
root.mainloop()`
line 34
@prime juniper now it is line 39
i am using python IDLEis that ok?
@prime juniper srry to bother u again but if run it and then what i what donsnt show and there is a load of error codes as well
Use VS ( visual studio) @brittle orchid
i try but i cant any more it crashes my laptop
ik so i use python IDLE now
Use VS ( visual studio) @brittle orchid
@ionic depot VS Code, mind. Visual Studio is a different IDE that's far, far heavier π
Right
oh ok
i would it is good for things like this
i would start learning it @prime juniper
it is something hady to learn if u want to do GUI stuff and like that
like to open websites using Tkinter
Is it possible if some one can help me with my code
pls
thanks @prime juniper
my code now works
i did see that but i dont see how i could do that
do u have an idea what to do?
ok i cope with it as it is for the min but i will keep on trying difrent things
i need help installing pygame on vscode
i put pip install pygame into the terminal and it said: 'pip' is not recognized as an internal or external command, operable program or batch file.
Do you have python installed?
use py -m pip install pygame
I made a text adventure game in python! https://chrome.google.com/webstore/detail/text-adventure/cldlljbdmkemnfnjbbecldfhognfnjgn?hl=en-US
Iβm looking to create an online quiz buzzer system that I can use to activate macros on when system when individuals buzz in. Does any have any idea for a best way to do this?
I have started learning game development using pygame recently. I am confuse about pygame.ACTIVEEVENT. Please can anyone tell me the use of it?
Hey @barren sky!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
i have a PlayerCharacter Class that has class attributes holding the PCs stats (like momentum, which represents how well the PC is doing on his quest. momentum changes depending on what happens in the game, for example momentum is decremented as the result of an action the PC takes). I want to set maximum and minimum values for these types of class attributes (momentum cannot be greater than 10 and not be lower than -6), but have not been able to implement it so far. i tried using a lambda function to always return a value in a specific range, but if i assign the lambda function to the class attribute, obviously the function is being returned instead of the value. Any advice?π π
i have a PlayerCharacter Class that has class attributes holding the PCs stats (like momentum, which represents how well the PC is doing on his quest. momentum changes depending on what happens in the game, for example momentum is decremented as the result of an action the PC takes). I want to set maximum and minimum values for these types of class attributes (momentum cannot be greater than 10 and not be lower than -6), but have not been able to implement it so far. i tried using a lambda function to always return a value in a specific range, but if i assign the lambda function to the class attribute, obviously the function is being returned instead of the value. Any advice?π π
@hasty sand so basically you want to validate what can go into the attribute?
@stark anvil the type of the attribute does not change. in the case of momentum it will always be an integer between -6 and 10. i want to make sure that it never can go outside of this range, eg: if an action of the PC lowers their momentum to -7, it will be -6.
>>> class Player:
...
... def __init__(self):
... self._attribute = 5
...
... @property
... def attribute(self):
... return self._attribute
...
... @attribute.setter
... def attribute(self, value):
... self._attribute = max(min(value, 10), -6)
...
... def __repr__(self):
... return f'Player with attribute {self.attribute}'
...
>>> p = Player()
>>> p
Player with attribute 5
>>> p.attribute = -3
>>> p
Player with attribute -3
>>> p.attribute = -10
>>> p
Player with attribute -6
>>> p.attribute = 20
>>> p
Player with attribute 10
example for you @hasty sand
yw
i am trying to make this in arcade (a inventory system), any ideas how to do it
pygame.init()
win = pygame.display.set_mode((10000, 10000))
pygame.display.set_caption("E")```
this returns Module 'pygame' has no 'init' member
pls help
@eager iris what version of pygame and python are you running?
pygame?
how do i check that?
print(pygame.__version__)
did you install it?...
try pip show pygame
ok
pip not recgonized
π
oh ok
wait
simple fix
do screen.blit(screen,(0, 0)
@dawn quiver
@uncut karma wait what
ok
doesnt work
...
@dawn quiver Man, i told you multiple times - learn how to code first, learn how to read errors
Yeah
It clearly says argument 1 must be pygame.Surface, not int
ya
you dumb Ass
So you can't
w8
...
yeah
wha
@dawn quiver what game are you making?
i hated working with pygame
if i had the skills i would make a better python game library
Does anyone know how to download pygame?
pip install not working?
@brittle orchid
python -m pip install pygame at the command line
for windows at least
Ok i will have a look
I hate pygame
Pyglet is better imo, especially if you know how to use decorators and such
Pygame is good in itself but is very limited. I had to switch from pygame to pyglet
@dense creek pyglet whats that?
It's another game module
It supports both 2D and 3D
and the caps and :()
What ide are you using?
er ok
The coordinates start from bottom left corner
anyone have some inspiration
pls Dp_dontmiss accept the invitation
@stark anvil thanks for the tip again. i have been reading a lot about the property decorarter and checked out the code sample that you provided for me. i got it working in a seperate file:
`class Player:
def __init__(self):
self._momentum = 2
{at}property
def momentum(self):
return self._momentum
@momentum.setter
def momentum(self, value):
self._momentum = max(min(value, 10), -6)
def face_danger(self):
print(self.momentum)
self.momentum += -20
print(self.momentum)
pcs = {}
name = 'eric'
pcs[name] = Player()
print(pcs)
pcs.get(name, {}).face_danger()`
when i implement it in my game file it raises an attribute error when trying to resolve self.momentum += 20:
AttributeError: 'PC' object has no attribute 'momentum'
why can i not call the setter on self?
Im really confused as to what is going exactly, maybe you can help me out again?π
i got it working by not using property at all.
self.momentum += -20 momentum = self.momentum self.momentum = max(min(momentum, 10), -6)
i created a new function as a class method of PC since i need this logic a bunch of times, so its not too bad i guess?
however i was wondering if there is a better way involving properties
had to remove the proper syntax because of discords tagging
pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 0, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 100, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 200, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 300, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 400, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 500, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 600, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 700, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 50, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 150, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 250, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 350, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 450, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 550, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 650, 50, 50))
pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 700, 50, 50))
this is a function that i have for drawing a finish line
i also have a player
is there any way to make the player appear on top of the finish line?
yeah i tried that
keys = pygame.key.get_pressed()
if keys[pygame.K_RIGHT] and x < screenwidth - 100:
x += vel
if keys[pygame.K_LEFT] and x > 0:
x -= vel
if keys[pygame.K_UP] and y > 0:
y -= vel
if keys[pygame.K_DOWN] and y < screenheight - 100:
y += vel
if keys[pygame.K_SPACE]:
pygame.quit()
win.fill((255,255,255))
pygame.draw.rect(win, (0, 255, 0), (x, y, width, height)) #here player```
@prime juniper
And you can't do that?
I mean , you don't know how?
You have to specify the position
x = ...
And y = ...
@eager iris
Let's make it straight
What do you want to make
A simple race game , right?
ya
Your player can move?
yes
You drew the finish line
yes
uhh
no
i know how to do that
i just want the player to show up on top of the finish line
cuz right now its under and the player is being covered by it
yea
yes
You want your player to appear on the finish line
Like it stands there
@prime juniper
You managed to do the code?
I asked @prime juniper
ok
Okay , let me think
You have to make those block to appear under your player
I know
But you sent a ss
i tried drawing the finish line before the player in the loop, but it didn't work
With the actual result
ss?
ok
pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 0, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 100, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 200, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 300, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 400, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 500, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 600, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 100, 700, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 50, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 150, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 250, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 350, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 450, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 550, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 650, 50, 50)) pygame.draw.rect(win,(0,0,0), (screenwidth - 50, 700, 50, 50))
@eager iris
@ionic depot
@hasty sand in general you should not tag specific people for new questions
anyway, Iβm p sure you made an instance of the wrong class
otherwise it should work
also, use three backticks for code blocks
You would have to draw the finish line first
hi can someone help me formulate something plz
im looking to use basic python 3
and classes
im looking to make an app that registers input, compares it against a database, and sends out result based on matches
a game-type thing where the game will print text and request user input
text based? @frigid knoll
i dunno, im just trying to learn classes
HELP
@dawn quiver bro , you put the condition , but no a event for the condition .
@dawn quiver i fixed it
i used another way to make my character move
@dawn quiver i fixed it
@dawn quiver what do you want to make , more exactly ?
soo I'm new here , in this group , because i want to study deeply the game dev with python , I will make a RPG like some dungeon to search in a labyrinth
the masterpiece of this idea , it's that labyrinth generate randomly , for every new game
what can recomend me ?
what book for read ?
what video to watch?
i am making
an score based
game
like asteroid
and necromancer
like asteroid
@dawn quiver you should tell me before , take this :https://www.youtube.com/watch?v=FfWpgLFMI7w&list=WL&index=8 maybe can help you
Learn how to use Pygame to code games with Python. In this full tutorial course, you will learn Pygame by building a space invaders game. The course will help you understand the main game development concepts like moving characters, shooting bullets, and more.
π» Code: https:/...
this have the principles of the movement sistem
i dont need it anymore
i already found a way to do it
@dawn quiver
pls meme
@stark anvil sorry about that. thanks again for pointing me in the right direction, seems like i just needed a clear head. by now i figured it out using the property decorator π₯³ i have also implemented the same logic using the property decorator for 3 different class attributes that work the same (health, spirit, supply), they have different maximums and minimums. works like a charm nowπ
what game exactly @lusty oyster
idk what to say
dm me
hello π i need some help with a classmethod that im trying to code. this is my class so far:
class Vow:
def __init__(self):
self._name = ""
self._rank = 0
self._description = ""
self._progress = 0
@property
def name(self):
return self._name
@name.setter
def name(self, value):
self._name = value
@property
def rank(self):
return self._rank
@rank.setter
def rank(self, value):
if self.rank < 0 or self.rank > 5:
# user should input the rank again
self._rank = value
@property
def description(self):
return self._description
@description.setter
def description(self, value):
self._description = value
@property
def progress(self):
return self._progress
@progress.setter
def progress(self, value):
self._progress = value
@classmethod
def swear_an_iron_vow(self):
self.name = input("Give this quest a name: ")
self.rank = int(input("Give this quest a rank: "))
self.description = input("Give this quest a description: ")
self.progress = 0
iron_vow = Vow()
swear_an_iron_vow = Vow.swear_an_iron_vow()
print(iron_vow.name, iron_vow.description, iron_vow.rank)
**i want to make sure that the rank of an iron vow is always between 1 and 5. **
since the player provides the rank when swearing an iron vow i thought the range check for rank should occur in the rank.setter? am i mistaken? should i just implement a check in the classfunction after the player provided a rank? tyπ
guys, any good source of "balance" in multiplayer games?
i'm developing a browser game that is by far unbalanced
excel is not handling such problem
hahaha
In this 2018 GDC talk, The Pokemon Company's Dylan Mayo sets some base truths and examines the curves of some of the biggest games in the CCG space, including Magic: The Gathering, The Pokemon Trading Card Game, Hearthstone, The Spoils, and Clash Royale.
Register for GDC: ht...
@somber bramble he is talking about card games, but the conceptual approach he takes to balance is very nice. i think balance is often a problem regarding agency. an unbalanced game removes player agency because there are to few playing styles that are optimal or at least viable. removing player agency is bad for games since they are all about that. one way to balance your game might be to focus on winning playstyles in the game that you have, disregarding the rest. a game like rock paper scissors for example has only 3 play styles but it is balanced because each play style is countered by one of the other two. so the fun of rock paper scissors is guessing what your opponent chooses. even though there might be less variety in rock paper scissors than in rock paper scissors lizard spock it might be more fun because of it.
i'll watch it, my game is space based, so there will be races, each race with different approaches with different playstyles, some will be able to start colonizing when they start, others don't, the main problem is equalizing the economics :X
but thanks π
@strong raptor u know yesterday that i asked how to download pygame i have tryed it but it still doesnt work even though i have downloaded it off its website
any pygame devs who want to work with me and a team of devs to build the next upcoming game.
How are you displaying the text
@spare phoenix of any level of knowledge?
Rip famous last words
@dawn quiver What function are you using?
String formatting would clean that up a bit
let me rephrase again
what function are you using to 'print' the text to the window
ty
@ionic depot intermediate level python/pygame knowledge is preffered.
Sad :))
why?
@dawn quiver can you send the part with the screen.blit
where are you getting console_arrow_rect\_* from
I get that ya
but if the values are incorrect/negative that'd explain it
and your calling pygame.font.init()?
actually nvm ya that doesn't need to be there
would "{}\n".format(commands[console_text]) work?
output = game_font2.render("{}\n".format(commands[console_text]), True, white)```
sorry I'm not to familiar with pygame
would you not have to update the screen
I'm pretty sure you have to pass the blit() to an 'update' function
"PyGame's built-in dawning functions and the .blit() method for instance return a Rect, so you can simply pass it to the display.update() function in order to update only the "new" drawn area."
but you'd have to pass the blit to update() in order to update the window
because as far as I can see you're just building one
Ya so (I could be wrong someone correct me) I think you're not actually initializing the blits
idk actually sorry pygame without oop confuses me
where are you getting again from
can you add something like print("error") after the if again:?
could be that it's not going into the condition at all
or a breakpoint would work too ig
where are you getting draw_again from then
is that %100 working
like it's not displaying any sort of error
actually can you send the whole script so I can run it?
!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.pydis.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.
na just the script you're working on
na just the one you're working on
I can change the sprites
Ok
try if event.type == pygame.KEYDOWN:
I think you need it everywhere
no but like event.type will return pygame.'event that happended'
unless you have something like KEYDOWN = pygame.KEYDOWN you'll need to change each one
hm then I'm not sure sorry
hello
I have a camera class which moves with the character, is there anyway i can make everything on the camera bigger? If i just try to transform the size, it gives me bigger sprites, but the camera starts from the top left and is not focused on my character. Additionally, collisions dont work
im using pygame, and pytmx for my map
@brittle orchid hmmn
can you open the command prompt?
Go to start menu, type "cmd", hit enter
From there, type the following:
python -m pip install pygame
you DO NOT need to go to any website and download any files
the command does it all
@brittle orchid
after that's done, you can just import pygame to use it in your scripts
if you need help @ me
Hey, I'm making a space invaders game with pygame, can you tell me how do I do collisions of bullets with enemies??
Thanks in advance:)
I am not using pygame but am making a very small section of a game and am having trouble
I'm trying to calculate hit chance in the most simple way and it is not working at all.
I've tried a hundred different ways of doing the same thing and none of them have worked
import random #Imports random class
randhit = random.randint(0, 10)
crit = 10
if randhit < 4:
print('Miss!')
else:
pass
if randhit > 5 and crit:
print('Hit!')
elif randhit == 10:
print("That was a critical!")
print (randhit)
Here, it says invalid syntax because of the line "if randhit >5 and crit"
But why?
If both of those things are True boolean, it should print the line "Hit" right?
I get this with the lesser than operator as well.
"if randhit is greater than 5 and less than critical, which equals 10, print the line "hit""
Why is that invalid syntax?
I tried using randrange, randint, random.choice
none of those work because it says that I can't compare an integer with a range
What's the point in even using a range then?
if randhit < 4:
print('Miss!')
elif randhit > 5 and crit:
print('Hit!')
elif randhit == 10:
print("That was a critical!")
print (randhit)
.
Changing the code to his now works, but when I hit a 10, it still just prints out 'Hit!' instead of 'That was a critical!'
I've spent about 12 hours off and on searching google
and nobody can tell me what I'm doing wrong, or what to use
import random #Imports random class
randhit = random.randint(0, 2)
crit = 2
hit = 1
miss = 0
if randhit == crit:
print('You hit a critical!')
elif randhit == hit:
print('You hit!')
elif randhit == miss:
print('You missed.')
print(randhit)
This is the only thing I can get to work, but I want the critical to not be a 25% chance, I want it to be lower
lvl1_enemies = ('s1', 'z1')
chr_exp = 0
def experience(self):
global chr_exp
if str(self) in lvl1_enemies:
chr_exp += 15
return chr_exp
else:
print("wrong")
self is y(comes from a battle def it is too long to put in here so i cant. Think that there are two types of enemies and there are three diffrent levels of them and one of them fights with you) At the end of the battle chr_exp should go up diffrently by the level of the enemies not the type. Print wrong statement is there because i use it to learn if statment works or not. Apparently it doesn't working. I know i can code it individually with if and elif statements but its too repetitive. I repeat i just get 'wrong' as a result (if str(self) in lvl1_enemies:) doesn't work. What should i do? (I tried it with for and while loop as well they didn't work if there is a method works with them tell me about them as well please!!) s1 = Skeleton('Skeleton', 80, 0, 5, 0)
z1 = Zombie('Zombie', 100, 20, 5, 3) these are what will be self/y specifically s1 and z1
hi there, what does "self" mean in terms of writing classes?
like why cant i just use ```py
pLayer.name()
i asked google he said stfu
What exactly is queue?
I'm making a text based game written in python, but I want to display sprites using pygame. Would I need threading to achieve this or would a queue be good enough?
@frigid knoll I'm pretty sure that self= is invalid Python; I don't know where you picked that up from. You can just use pLayer.name()
@tranquil robin A queue is a list/array-like data structure usually used for pushing stuff into one end and popping from another. I am not sure what it has to do with displaying sprites in PyGame though.
Also, needing threading for displaying sprites sounds like asking if you need an airplane to get to the grocery store. I highly doubt you'll need to do some threading (of your own, don't know about PyGame internals).
i know sry, its because i was using ```py
class pLayer:
def __init__(self):
user.append(input(">>> " + user[0] + " . . . "))
def name(self): # <---- i was putting self right there
user.append(input(">>> What is your name? . . . "))
Ah, yes, that is the correct spot for self.
The first item passed into an instance method is the instance itself.
You could really use any name for the first argument, but self is the convention.
import threading
import queue
pygame.init()
screen = pygame.display.set_mode((300, 300))
quit_game = False
commands = queue.Queue()
pos = pygame.Vector2(10, 10)
m = {'w': (0, -10),
'a': (-10, 0),
's': (0, 10),
'd': (10, 0)}
class Input(threading.Thread):
def run(self):
while not quit_game:
command = input()
commands.put(command)
i = Input()
i.start()
old_pos = []
while not quit_game:
try:
command = commands.get(False)
except queue.Empty:
command = None
if command in m:
old_pos.append((int(pos.x), int(pos.y)))
pos += m[command]
for e in pygame.event.get():
if e.type == pygame.QUIT:
print("press enter to exit")
quit_game = True
screen.fill((0, 0, 0))
for p in old_pos:
pygame.draw.circle(screen, (75, 0, 0), p, 10, 2)
pygame.draw.circle(screen, (200, 0, 0), (int(pos.x), int(pos.y)), 10, 2)
pygame.display.flip()
Here's a threading code for displaying a circle on a separate screen when you press either 'w' 's' 'a' or 'd'
@tranquil robin any particular reason to use input()? PyGame should have a non - blocking way to get inputs.
However, from a high level, what you have should work, and is a basic producer-consumer pattern. It just seems overly complicated for basic stuff.
It's a threading code I got from someone else
global location
#print(room.get('Main Hall', 'item'))
while adventure == True:
for x in npc:
print(x)
npc_Action(x[0])
desc = room.get(location, 'desc')
exits = room.get(location, 'exits')
if room.get(location, 'visit') == "False":
globals()[room.get(location, 'event')]()
print(desc)
print(exits)
global advaction
advaction = input('>')
if advaction == "quit":
sys.exit(0)
print(advaction)
explore_Dungeon()```
This is the main loop of my text based game
hi all
I am making a game ike mc in python
but I dont know to to add controls
Can someone hep me
please
i have imported ' from pyglet.gl import * '
have you used pyglet before @shadow dock
Yes
Hi, I want to make a simple Minecraft terrain generation clone with Pyglet. There are some clones of "Minecraft" with it, so I want to do it too. I also need to learn OpenGL. However I can't find any good resources to learn from. Many tutorials just don't explain anything and I end up with copying the code from them, without any understanding. I will appreciate any tips! β€οΈ
can we insert a video into python arcade?
s1 = Skeleton('Skeleton', 80, 0, 5, 0)
z1 = Zombie('Zombie', 100, 20, 5, 3)
class Zombie(Enemy):
def init(self, Name,Health,Mana,Ad,Ap):
Enemy.init(self, Name,Health,Mana,Ad,Ap)
lvl1_enemies = ('s1', 'z1')
chr_exp = 0
def experience(self):
global chr_exp
if str(self) in lvl1_enemies:
chr_exp += 15
return chr_exp
else:
print("wrong")
def battle(x, y):
print(f"Encountered with a {y.name}")
while x.health and y.health > 0:
command = input("> ").lower()
if command == "a":
y.health = y.health - x.base_attack()
print(f"Remaining {y.name} health is {y.health}")
x.mana += 5
if y.health > 0:
x.health = x.health - enemy_attack(y)
else:
break
print(f"Remaining Health and Mana are {x.health} {x.mana}")
return print(f"{y.name} is dead"), print(f"Remaining Health and Mana are {x.health} {x.mana}"),experince(y)
So I have
def drawDecor():
for i in range(10):
grassBlock_pos[0] -= 100
win.blit(grassBlock, grassBlock_pos)
but the grassblocks do not go across the screen like intended
also Ik that this will lag
so im having an error that it cant load my icon and when i play the game it still doesnt load it, but when i go to the file in the file explorer and open it it displays the icon. here is a vid.
and here is my code too but watch the vid first.
import pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Space Invaders")
icon = pygame.image.load("ufo.png")
pygame.display.set_icon(icon)
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pls tag me so i know someone replied and im a begginer at pygame and python thats why i dont know this easy thing which is hard for me. π
s1 = Skeleton('Skeleton', 80, 0, 5, 0)
z1 = Zombie('Zombie', 100, 20, 5, 3)
[1:30 PM]
class Zombie(Enemy):
def init(self, Name,Health,Mana,Ad,Ap):
Enemy.init(self, Name,Health,Mana,Ad,Ap)
[1:30 PM]
lvl1_enemies = ('s1', 'z1')
chr_exp = 0
def experience(self):
global chr_exp
if str(self) in lvl1_enemies:
chr_exp += 15
return chr_exp
else:
print("wrong")
what is the error @tidal magnet
@lusty oyster it wont display the icon when i run it using vs code but when i go to the file explorer and open it from their it displays the icon. To undertsand me cleare go to the other message and their is a vid watch it and then ull understand.
@strong raptor
i have tryed that but it comes up with this
ModuleNotFoundError: No module named 'pygame'
@lusty oyster ?
Hi Iβm bones Iβm looking for members who could help me make this game in roblox studio
Please dm me for more info
sigh You do realize you're going to get kicked or something right
you're just slightly rephrasing the question so that it doesn't sound like recruitment anymore
@brittle orchid not sure then. @ someone else maybe they know more than me
@west egret lmao
@tidal magnet what's the prob
I could probably help you
running(or 'game_over') = false
while not running:
for event... :
if event.type == pygame.QUIT:
running (or 'game_over') = true
Try this one
@tidal magnet
i was trying OPEN GL and I am running into some issues
import OpenGL as GL
import pygame
from OpenGL.GL import *
from OpenGL.GLU import *
verticies = (
(0, 2, 0),
(2, 2, 0),
(2, 0, 0),
(0, 0, 0),
(0, 0, 2),
(0, 2, 2),
(2, 2, 2),
(2, 0, 2)
)
edges=(
(0,1),
(0,5),
(1,2),
(1,6),
(2,3),
(2,7),
(0,3),
(3,4),
(4,7),
(6,7),
(5,6),
(4,5)
)
def Cube():
glBegin(GL_LINES)
for edge in edges:
for vertex in edge:
glVertex3fv(verticies[vertex])
glEnd()
def main():
pygame.init()
display = (800,600)
pygame.display.set_mode(display, DOUBLEBUF|OPEN_GL)
gluPerspective(45, (display[0]/display[1]), 0.1, 50.0)
glTranslatef(0.0,0.0, -5)
glRotatef(0,0,0,0)
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
Cube()
pygame.display.flip()
pygame.time.wait(10)
main()```
my Code
i was trying to make a cube
π¦
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "Glstreamer.py", line 60, in <module>
main()
File "Glstreamer.py", line 44, in main
pygame.display.set_mode(display, DOUBLEBUF|OPEN_GL)
NameError: name 'DOUBLEBUF' is not defined
the error
hey im new to python can you make games with it
@ancient olive yes , ofc
I want to learn how to make games fast with python independently can I get help for it
Any game
But a platform game would be preffered
What exactly
Like a endless runner or one where the Player must dodge obstacles like undertale
Yep
But I've made snake game
A ping pong game
But they were from a tutorial and I want to learn to do it off the top of my head
Oh , so you want tips
Hmm
Cuz like I would prefer a long one where I actually learn things and not just Hello world
i was trying to make a cube
@rigid brook :(
which library do i need to make chess with django
hey any one can suggest how to make chess with DJANGO with some graphics .....means which library we gonna use
beginner here trying to get into game designing, whats the difference between python game development and c++ game development. which is better?
@prime juniper thank you for the answer, is it better to start with c++ or python if you're a complete beginner with no prior experience in coding except HTML, CSS and a little bit of python?
^ /unreal
@fresh fiber
Python game devβll probably be a bit easier if you have experience with py but like sfdsf mentioned, youβll be limited by the library
That being said libraries like pyglet (+ others) use low level stuff like OpenGL
hi all. do you guys know of any packages that involve NLP for the purposes of text adventure games? I was thinking about Facade's use of NLP. i would love to see more of that or maybe just mod facade to create another story.
There's monumental room for Facade-like games.
eh I downloaded a pygame flappy bird looked at the code and said nope and never touched it again this channel is not for me.
that much code should never be in a game so little as flappy bird.
@dawn quiver that's the reality
Other big games have millions lines of code
Are you new in this programming thing @dawn quiver?
@dawn quiver Btw , how many lines of code does your flappy bird game has?
I didnt count atleast 50
just for a quick animation and a random set of pipes obviously with gravity and controls but still
but they werent like 3 word lines they were packed
How old are you?
13
listen, my age shouldnt matter I personally dont like people who think im not "old enough" or "experienced" enough to know how to code or learn.
Yeah , the age doesn't matter
what brought you to the python world?
Some kind of influence
Or from pure curiosity
?
13
@dawn quiver samee
@ionic depot oh me I wanna be a dev
@olive quail what about you
I have been coding for like 3 years and im off to a good start.
How many projects do you have ?
over 20
And in what programming language?
node.js and python
And you find flappy bird hard to make?
yes.
That's impossible
something about pygame just isnt in my list of capable things
Tried to make a bot once with java script once without knowing it at all, and quit that after like a week, I'm trying to make another but but this time I'm using python, but I don't know python at all so I have to watch videos for it lol, planning on trying to learn it but with school idk @ionic depot
Is one of the most easiest games out there
dude I took one look at it and said no.
My Grammer sucks
all the different functions ima stick to c# in unity
Can you show the code?
yea lemme find it again
Error it is showing is.... There is no module named 'pygame'........
After I written import pygame...... Why???
But it's limited
python just isnt meant for games. unless we talking og mario graphics
Means.... From where...
@olive quail try to learn python in free time
personally I love to code bots but I have moved to much bigger things...
theres a bot for everything yea you get credit but better to use someone elses bot thats already more known and then you dont gotta pay for servers
To move from small thing to bigger ones
Can i get a source of of a game.... I want to learn it...... Just a begginer
oh for me it was easy I didnt start with bots I started with big things... then moved down then back up
https://www.edureka.co/blog/snake-game-with-pygame/ @prisma beacon
Thanks broo
One more thing
There are some issues with first stpes
@dawn quiver send the code
I want to see it
alr
thats the one I did
not did
you know what I mean
Right
it dont even got a menu and it still complex
Jesus that's old
You should find tutorials from 2018 to 2020
Those are the newest ones
And the easiest
Cause python evolved
YouTube is a good source to find projects
readmes are usually useless but I know what most functions do.
Where to give command to pip install pygame??????
Vs or cmd
Why so many question marks?
:))
lol
Cause he's desperately fixing that prob
cmd means????????????
A beginner thing
Fair
Hmm , how to explain
It's much easier on Vs code
@prisma beacon download Vs code first
Then Vs means?????
Visual studio
From where should I download it

First I have install pygame module..... Or just directly open Vs
I have pycharm
yea about me making my own code I do as I told you 20+ projects games in python just arent my strong suit
Okk
@dawn quiver but you did in other programming languages
After downloading python in Vs.... What I should do
I don't understand that :))
I make tools im not allowed to discuss here not really games I just wanted to make some I could play offline for boredom and yea I think unity is a great engine for games I can easily make em in that
I should run my program in Vs then.... It will not say error in import pygame
@olive quail are you trying to make bots?
@ionic depot discoed bots lol, just not at my computer so I don't know whats wrong with code rn or what I wanna add
At some point I wanna try to make a game but lol
I can't apell
Spell
@olive quail lol
Why do you ask?
From curiosity
Ah
No u haven't, don't really know what a gamebot is, well besides its prob a bot in a game or ai or somthing
Idk coding lol
Oh , okay
Hello
Hello @ionic depot we want to ask that how shoud we add sound effects to our game
In this video I will be explaining how to add sound effects and music into your pygame in python version 3. I will also be covering player - enemy collision and what to do when the two objects collide.
Please leave a LIKE and SUBSCRIBE for more content!
Download Code: https...
@stiff panther
Does PyGame have Vsync?
π
Does pygame has life?
Hi, I am working with tutorial and I can't get camera rotation to work. It works when I rotate (even though the screen rotation is the same), because my flying direction is changed. Here's my code -
Hey @forest oak!
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:
This is the tutorial I am following - https://www.youtube.com/watch?v=Hqg4qePJV2U
Nevermind, the guy made a mistake in the video.
Good to know
Hey can i get a advance game source code.... I want to try learn it. π
what i need to do in this code?
import os
import pyautogui as p
os.system('echo hello')
p.typewrite("h")
@prisma beacon like what
@prisma beacon I can send you my Space Invaders like game I'm working on, it's nowhere near finished, nor 'advanced' but it might be what you are looking for
how do i get pycharm in the game activity thing