#game-development
1 messages Β· Page 89 of 1
ok thank you will do that
Fonts are all drawn, yay, that's a grind
Images for all the letters and numbers
I need to come up with a human controller. Liek I don't want all of a level's humans to be capturable from the start or the first wave of landers would just come snag them all at almost the same time and, no matter how good the player is, some of them would mutate by reaching the top of the screen
So, no matter how many humans remain alive, I only want one or two of them to be capturable at a time
Add all humans that are walking (on the ground, not captured, falling or being saved by the player) to a list, choose a couple randoms and enable their capturable flag
well you can make 2d games
i recommend pygame ebcause thats what i use
You start with a game or an idea for a game and start learning whatever it takes to make that game
I think I'm gonna take arcade for a spin and see if I get scroll a shooter with it
Its hardware acceleration might be worth a try
only 2d?
u cant make 3d games?
with python?
Let's put it this way, you can make game logic and all that for any game with python but when it comes to drawing things fast enough for 3d, just not fast enough
Hmm, that's still conditional. Blender does 3d with a python API, but that's not python doing the drawing, it's Blender with its C or C++ code
why r u taking so long time to answer
because its not a yes or no thing, you can make 3d games with python but dont expect some AAA level quality
Yeah, wtf, it's not like you deserve a definite answer, there isn't one
yes, you can
So I wrote question on here yesterday and did not receive a response. Completely understandable since I am unable to offer anything in return for the help I am asking for. Can anyone possibly tell me where I might be able to post a question that will be possibly answered?
True determines if the set of points are closed, I assume by making a line or not from the end back to the start point of the provided list of points
And yes, that's the case...
closed (bool) -- if True an additional line segment is drawn between the first and last points in the points sequence
Pygame docs answered that question in seconds, just sayin'
Or, of course, you could try the code, and set it to False then compare the difference, surely then it would be obvious what it does
Don't be afraid to poke around with the code you're working with, it can always be fixed if you mess it up or even done better...maybe
Thanks for your assistance. I looked at pygame docs but didn't see anything relevant. It is possible I just did not adequately understand what is written there. I tried removing the bool altogether but did think of changing it False. I really appreciate your help.
Like I've been working on this game for over a month, it's working great but I wasn't totally satisfied with player movement....I just totally deleted the entire player movement method and started over
And it's ok, because I will write it better this time
Gotcha, I will try to be more willing to take risks and change up the code
Of course, I saved a backup of the working code but still, it's a good idea, at least for me, to refactor and redo sometimes
It's like as a piece of code I'm working with evolves, I gain a better understanding of the essential logics and can almost always write it better
Especially when writing long algorithms. I code out step by step then realize about 900 lines later that I'm only changing a couple of variables and can then understand how to set up a function or method to do it in 10 lines
lol
Im having an issue where the player sprite collides with the platform sprite but it stops in the middle of the platform, im trying to make it so it stops on top of it
sst, lol
Thanks again, sst! I'm able to see the difference when I set the bool to False.
https://hastebin.com/usigenibih.rb thats my code btw
Have fun man
What are the dimensions of your two images, the player and the block?
Hmm, that's a tough one @dawn quiver
But I was watching a long tut this morning...
This is it. Sorry I can't help you more directly at the moment but I know that this covers what you need: https://www.youtube.com/watch?v=DHgj5jhMJKg
In this Python tutorial I code a Scrolling Shooter Game using the PyGame module. I'm going to cover the initial game setup and how to create the player
Code and assets on github:
https://github.com/russs123/Shooter
Credits for assets used:
https://mtk.itch.io/grenades-16x16
http://gushh.net/blog/free-game-sprites-explosion-3/
https://erayzes...
okay thank you
And is really well done
He builds the code as he needs it and describes why he's doing what he's doing really well
Beginner friendly but for someone just looking for why their collision is messed up, it's kinda long
Excuse me but....I fuckin did it! Recreated the player/map movement!
The switching direction thing is tricky
Because the player and map both have to move in relation to each other as the player sweeps across the map during the direction change
But I'm pretty sure I got the original algorithm, if not, really really close to it
And oh man does it feel good, feels right
I've only been trying to hammer this out for two or three days
Among other things, this has been lurking and being tweaked
The key was adding a flag to signal when the player is transitioning from left to right side of the screen and adjusting player speed (actually map speed) according to it
Or right to left, for that matter
Adjusting map speed relative though, not absolute
So good, so glad I got that working right
I mentioned earlier tha tI deleted it, well some made it back into the refactor but it has all new movement code
During player update(), it also has to update the siren surface on the player sprite so it changes colors and looks kinda like a siren
Also, if the player has human cargo, check if he's at the ground and drop them off
Here's how i'm handeling collisions.
basically, you have the bounding box of the player, and then you loop over the inside of the box and use a texture to define to collisions, and then create a bounding box for the collision parts inside the player. then get the closest points with the player and the collision, then get a vector between those two points and move the player with that vector
here's the result
Not the best, right?
here's the code for getting the closest point
closestP = [0,0]
insideX = Center[0]-Bounds[0] < P[0] and P[0] < Center[0]+Bounds[0]
insideY = Center[1]-Bounds[1] < P[1] and P[1] < Center[1]+Bounds[1]
pointInsideRectangle = insideX and insideY
if not pointInsideRectangle:
closestP[0] = max(Center[0]-Bounds[0], min(P[0], Center[0] + Bounds[0]))
closestP[1] = max(Center[1]-Bounds[1], min(P[1], Center[1] + Bounds[1]))
else:
distanceToPositiveBounds = [Center[0]+Bounds[0] - P[0], Center[1]+Bounds[1] - P[1]]
distanceToNegativeBounds = [-(Center[0]-Bounds[0] - P[0]), -(Center[1]-Bounds[1] - P[1])]
smallestX = min(distanceToPositiveBounds[0], distanceToNegativeBounds[0])
smallestY = min(distanceToPositiveBounds[1], distanceToNegativeBounds[1])
smallestDistance = min(smallestX, smallestY)
if smallestDistance == distanceToPositiveBounds[0]:
closestP = [Center[0]+Bounds[0], P[1]]
elif smallestDistance == distanceToNegativeBounds[0]:
closestP = [Center[0]-Bounds[0], P[1]]
elif smallestDistance == distanceToPositiveBounds[1]:
closestP = [P[0], Center[1]+Bounds[1]]
else:
closestP = [P[0], Center[1]-Bounds[1]]
return closestP```
then the collision check
global groundPos
sizeX = abs(x2-x1)
sizeY = abs(y2-y1)
inputMiddleX = x1+sizeX/2
inputMiddleY = y1+sizeY/2
lowestX = 50000
heighestX = 0
lowestY = 50000
heighestY = 0
closestPoint = [0,0]
closestPoint2 = [0,0]
unintersectVector = [0,0]
ColSize = [0,0]
ColMiddle = [0,0]
colDetectected = False
stepsize = 5
for i in range(int(x1), int(x2), stepsize):
for j in range(int(y1), int(y2), stepsize):
x = i
y = j
value = collisionMask[y][x][0]/255
if int(value) < 0.5:
if x > heighestX:
heighestX = x
if x < lowestX:
lowestX = x
if y > heighestY:
heighestY = y
if y < lowestY:
lowestY = y
groundPos.append([i,j])
colDetectected = True
if colDetectected:
ColSize = [math.sqrt((heighestX - lowestX) * (heighestX - lowestX)), math.sqrt((heighestY - lowestY) * (heighestY - lowestY))]
ColMiddle = [lowestX + ColSize[0]/2, lowestY + ColSize[1]/2]
closestPoint = findClosestPoint([inputMiddleX, inputMiddleY], ColMiddle, [ColSize[0] / 2, ColSize[1] / 2])
closestPoint2 = findClosestPoint(closestPoint, [inputMiddleX, inputMiddleY],
[playerSize / 2, playerSize / 2])
unintersectVector = [closestPoint2[0] - closestPoint[0], closestPoint2[1] - closestPoint[1]]
return colDetectected, unintersectVector, closestPoint```
I've also got some other stuff for sliding and bouncing
Jumps = 2
GroundNormal = [PlayerCenter[0]-PhysicsCheck[2][0], PlayerCenter[1]-PhysicsCheck[2][1]]
GroundNormal[0] = (numpy.array(GroundNormal)/numpy.linalg.norm(numpy.array(GroundNormal)))[0]
GroundNormal[1] = (numpy.array(GroundNormal)/numpy.linalg.norm(numpy.array(GroundNormal)))[1]
b = numpy.empty_like(GroundNormal)
b[0] = -GroundNormal[1]
b[1] = GroundNormal[0]
SlideVec = [numpy.dot(playerVel, b) * b[0], numpy.dot(playerVel, b) * b[1]]
factor = -2 * numpy.dot(GroundNormal, playerVel)
BounceVec = [factor * GroundNormal[0] + playerVel[0], factor * GroundNormal[1] + GroundNormal[1]]
Bounciness = 0.05
playerVel = [BounceVec[0]*Bounciness + SlideVec[0]*(1-Bounciness), BounceVec[1]*Bounciness + SlideVec[1]*(1-Bounciness)]
playerVel[0] += inputAxis[0]
playerVel[0] = max(-PlayerSpeed, min(playerVel[0], PlayerSpeed))
if playerVel[0] != 0 and inputAxis[0] > 0:
if playerVel[0] > 0:
playerVel[0] -= playerVel[0]/5
else:
playerVel[0] += playerVel[0] / 5 ```
You can. But you need to use something else to draw the 3d mesh.
PUBG using python
but they use C++ to draw the characters
its basically like front end and backend
Like always another language is used for the frontend of the game, and python is used for the backend
Wow
For the logic(if player collides with this what happens)
Just incase you didnt know what logic means :)
I'm automating EverQuest with Python(which isn't against TOS surprisingly). I'm wondering how to handle movement and navigation. I'm able to receive my coordinates and direction I'm facing in a particular zone using a command. But I'm wondering how to go about actually moving from one set or coordinates to another? How should I navigate around objects and such? Here's an example of a zone/map http://www.zlizeq.com/ZlizEQ_Projects-ZlizEQMap
Read about ZlizEQMap on Zliz's EverQuest Compendium: A complete guide to the MMORPG EverQuest 1. Learn about game mechanics, read guides, technical tips and references.
So I just installed pygame on Visual Studio Code with pip3 install pygame and when I went to run my source code, this came up:
Traceback (most recent call last):
File "pygame.py", line 1, in <module>
import pygame
File "/Users/me/Desktop/Python/pygame.py", line 3, in <module>
pygame.init()
AttributeError: 'module' object has no attribute 'init'```
What does it mean and how can I fix it?
because the file you're working in is called pygame.py, it's trying to import itself
try renaming it
I got the same error
you can also think of multiplayer games
or 2 player games, p2p
like online pong, air hockey, pinball
hmm
normally i brainstorm with what i can 75% do
so that i can learn the other 25% :D
i list out 10 games
and decide which ones seems the most fun >///<
this time i decided on a full fledged zombie shooter platfromer type game
nice
My best player class for a space alien side scrolling shooter ever: https://pasteall.org/wg6k
My margins are hardcoded at the moment, but that's just a matter of defining additional constants and using them instead, basically the same thing
So, self.x carries the float of player location x, and self.rect.x is an int. What's cool about that is that I can move player around the screen by its rect without changing its actual x location. Meaning that I can add movement effects without influencing the underlying floats
Want player ship to vibrate as it picked up speed? No problem, shake rattle and roll its rect anywhere you want, the floats and the math with them will remain consistent
So I still have to work out that additional thrust code and implement some very subtle high speed shaking
As thrust is applied to the player ship, the ship slowly moves forward on the screen while the world whips by at top speed
To further enhance the feeling of movement and speed
Still have to work that out too
Just realized that I could make kill_all() and shoot() staticmethods, neither of them reference self at all
about the page being 'bugged'
update, i got it kinda working, but now it's sticky
if not DesireCheck[0]:
playerPos = desiredPos.copy()
playerVel[1] += 5
else:
playerVel[1] += 5
AvePos = [0,0]
for pos in groundPos:
AvePos[0] += pos[0]
AvePos[1] += pos[1]
AvePos[0] /= len(groundPos)
AvePos[1] /= len(groundPos)
GroundNormal = [playerCenter[0] - AvePos[0], playerCenter[1] - AvePos[1]]
GroundNormal /= numpy.linalg.norm(GroundNormal)
canvas.create_line(playerCenter[0], playerCenter[1], playerCenter[0]+GroundNormal[0]*15, playerCenter[1]+GroundNormal[1]*15)
print(numpy.dot(numpy.array([0,-1]), numpy.array(GroundNormal)))
if numpy.dot(numpy.array([0,-1]), numpy.array(GroundNormal)) > 0.5 and numpy.dot(numpy.array([0,-1]), numpy.array(GroundNormal)) < 1.5:
Jumps = 2
factor = -2 * numpy.dot(playerVel, GroundNormal)
bounceVector = [factor * GroundNormal[0] + playerVel[0], factor * GroundNormal[1] + playerVel[1]]
b = numpy.empty_like(GroundNormal)
b[0] = -GroundNormal[1]
b[1] = GroundNormal[0]
slideVector = [numpy.dot(playerVel, b) * b[0], numpy.dot(playerVel, b) * b[1]]
bounciness = 0.1
playerVel = [slideVector[0] + (bounceVector[0] - slideVector[0]) * bounciness, slideVector[1] + (bounceVector[1] - slideVector[1]) * bounciness]```
#Matplotlib #Python #Math
This tutorial shows how to make a simple 2048 game using Matplotlib. We use the Rectangle class of matplotlib.patches to visualize each cell, and we use the canvas' mpl_connect method to make the swipe interaction.
Code: https://github.com/anbarief/2048matplotlib
Facebook: https://www.facebook.com/Mathematical-Scienc...
How to make a jumping mechanism in pygame?
The game keeping 50 baiters spawned at all times, they eventually fall into this kind of pattern. Kinda how they should
So long as I don't move, they shouldn't change their flight pattern
My velocity on both axes is added to theirs. If I have no velocity, they fly a pattrn like those
That's why they can never be outran
They pull in front of you and go into the pattern at whatever speed you're going and if your speed changes, they react to it three times per second
So they have a reaction time
Which can make them hard as fuck to shoot sometimes
Because if they're just above your line of fire and you go up to make the shot, they might react to it fast enough for you to miss and draw you into a chase
Up the screen
Those enemy AIs are a pain in the backside to work out but when they work is totally worth it. I could tweak those guys some but they good for now anyway
Not a very talkative bunch in here, that's for sure. This is a chat, right?
What's happening bud!
Not a lot, chillin, coding this game
Adding player lives, he can now explode
And die
And respawn
Next, adding a game over screen for when player is out of lives
Messing with sounds at the moment though
Can I not access a subfolder of my main without using os when loading the sound files?
For older versions of libraries, namely pygame 1.9.6, how does one tend to find documentation for it, given the website documentation is updated to the newest version?
damn thats good, if you make a huge map and pick a better more lofi relaxing colour pallet, purple and pink, or look at a game like 'Alto' this would be a great game!
Well you spitting paragraphs of the logic behind your games is kinda hard to respond to π
I don't know why, it's a game channel, people talk about games here, not just post promos or answer questions
I mean, seems like other game makers would be interested in how one person is doing it. I know I'm interested in how other people might do some of the things I talk about
But nobody talks
No biggie
Single player coding is just as fun
Its a game channel where we discuss our games yes
not write paragraphs about the details of its logic
unless someone was making the exact same game, no one would be interested nor would they know how to respond π
This is how the description should be
A nice photo/video and then what they are working on
:)
Not the entire logic behind the code
eh, i disagree with that
So ofc i would respond if you just said "Yep the swarmers are going at him now"
but when you try to explain the velocity and particle collision behind it, i woudnt know how to respond unless i read the entire parah or the ones before π
what your doing is making a documentation of your updates
github is there for that
Here is more about where we discuss our game dev, not explain the entire thing unless anyone asked π
I'd say it's good to just explain the concepts behind your code in case someone knows a more efficiant way
well you do you, but dont expect but of a response
that is comepletely fair
Anyways
eh i have exams so i cant continue the dev on my game

after the exams i will tho
:D
are those mushrooms?? 
some of them yes
I like bouncing ideas around, follow me or not, I'll probably still do it
So meh
Sometimes it even helps me
i hope so
throwing ideas around is great
Sometimes I hope someone says, "no man, there's a much better way" and teaches me something
exactly
Like actual game devs in here spewing ideas would be awesome, but no, just me and I barely know wtf I'm doing
Well, sometimes others
How to set up game logic to handle level progression is the next difficult hurdle for this project
character level progression or stage progression ?
i wanna hook up with a decent artist and start doing a metroidvania
using the arcade game engine library...
Stage progression
When to spawn what and end level conditions
Like spawn three waves of five landers in each one. When those are all dead, the level ends and add bonus points for number of humans remaining alive
On the next level, spawn four waves and add one more of the harder enemies, and so on, slightly increasing game difficulty for each level
that sounds relatively easy
but I can see how it would be difficult to add it in if your design was structured to not anticipate supporting it. then it would be not fun....
so I'm making pong rn but how do I add sound effects to my game???
I'm using pycharm as my IDE and I'm using turtle btw
Pong can be quite challenging
If you want to do more than move a ball slowly around the screen
Fast moving things can ghost right through walls
And player paddles
os.system("afplay jumping.wav&")
use os
this is the pong game i made with turtle ^^
I once set up an a priori collision model with pong, it could handle massive magnitude vectors, way wider than the player paddles
for event in pygame.event.get():
if event.type == pygame.MOUSEBUTTONUP and event.button == 1:
(x ,y) = pygame.mouse.get_pos()
if (870-x)**2 + (650-y)**2 < 325**2:
puppychow += click
count1 += 1
if count1 < 3:
text(50, "+1", white, x, y)
if count1 > 3:
count1 = 0
``` why no work
apparently it won't work, that was for MAC only, but no worries I found out that I need to use winsound for windows so it's solved
It calculated where the ball would hit before it got there and if the player paddles wasn't there at the calculated time, player lose

oh yeah
sucks that there are different types of osses
would be nice if there was a universal one yk
Omg it's beautiful
How to keep up motivation for game dev? :(
what lib are u using btw
:(
i honestly dont know
if i dont like making games
i would just stop
good one
and practise my DSA cause my end goal is ML
i was really just using Game Dev as a mode of translation or dev tool
rn I'm trying to hone my pixel art skills
alright good luck
Sorry, those are my own terms
Mode of translation: A library/programming language which you can use to learn new ones since you are very fluent in many concepts and in the functions/syntax of that library/programming language
Developer tool: A powerful "tool" that you have created by becoming very good at a specific topic/field, For example game dev, discord bot or mobile apps
You could use a dev tool to potray your ML into something presentable
For what specifically?
for example with game dev you could potray your ML as a game ai
for a discord bot it could be a chat bot
ect.
the rendering
Ursina is the game engine
All the biome stuff is done with OpenSimplex
Why sad?
It's wicked fast considering it's python
Because ursina does most of the work for you :)
Lol
no shot
exactly man
im so happy
there are actual game devs here
who understand that "oH Lol You cANt ever mAke aNy fORm of Game with pyTHon that iS pLaYABle, I hAVENT triEd gamE dEv But i juST KnoW BEcause ThatS WHat EVERYONE says" is false
and it really spreads false info
@dawn quiver bs there was so much work that went into dynamic chunk loading, biome generation, particle tracking, etc. Making meshes with pure math isn't easy.
lmao true
that you cant make games at all with python
yk PUBG using python for its logic?
C++ for its rendering
also python for its cyber security cause so many fucking hackers
Sure, but no. I would have consdiered it cool if you had done it without a 3D 'engine' and instead used something like opengl
this looks promising, good luck :>
and done all the 3d perspective yourself
It's doable, I started with opengl sec
This whole project started out with me wanting to render snow actually
ursina was just far easier since you could build a point mesh then render each point as a billboard particle
Thanks I will π
I'm working on seemless portals between the procgen worlds next
it doesn't the rotation is just way faster than the snow falling
so it's kinda hard to track the falling
also the fps drops
:0
oof
i did a lot of 2d games with pygame
like 30
only fully finished 7 or 8 tho lmao
so i was thinking
i could do 3d
thats a nice game
wait lemme show what im working on
@next estuary
i tried so many things for a moving background lmfao
like
so many
such as changing the matrix
so if i clikc right
the list will pop and append
but that would look trash af
eventually i got the idea
of just
making a new tile with the changed position
now the idea was correct
but my implementation was fucked
at first it accelerated
cause i forgot to set the relative x value back to 0
later i figuered it out
and it worked
I use move_ip on the player so everything moves relative to the player
Old video so it has a bug where the screen doesn't go down until farther down
I need to learn how that works, the move_ip() thing
It's only been two days and I'm already tired of rain rain rain
Hey yo
Do you know how to make platforms
I already made the jumping mechanism
Let me show you
`if player.IsJump is False and key_pressed[pygame.K_SPACE]:
player.IsJump = True
if player.IsJump is True:
player.PlayerY -= player.PlayerYvel*2
player.PlayerYvel -= player.Gravity
if player.PlayerYvel < -10:
player.IsJump = False
player.PlayerYvel = 10`
IsJump = False
`class Player:
def init(self, PlayerX, PlayerY, width, height):
self.PlayerX = PlayerX
self.PlayerY = PlayerY
self.width = width
self.height = height
self.PlayerVel = 5
self.PlayerYvel = 10
self.Gravity = 0.5
self.IsJump = False
self.OnPlat = False
def Player_Creation(self, WIN):
PlayerRect = pygame.Rect(player.PlayerX, player.PlayerY, player.width, player.height)
Player = pygame.draw.rect(WIN, (255, 0, 0), PlayerRect)
def Player_Movement(self, WIN):
key_pressed = pygame.key.get_pressed()
if key_pressed[pygame.K_d] and player.PlayerX <= 765:
player.PlayerX += player.PlayerVel
if key_pressed[pygame.K_a] and player.PlayerX >= 5:
player.PlayerX -= player.PlayerVel
if player.IsJump is False and key_pressed[pygame.K_SPACE]:
player.IsJump = True
if player.IsJump is True:
player.PlayerY -= player.PlayerYvel*2
player.PlayerYvel -= player.Gravity
if player.PlayerYvel < -10:
player.IsJump = False
player.PlayerYvel = 10`
@opaque fox you might want to look at http://programarcadegames.com/python_examples/en/sprite_sheets/ for ideas
Attract mode demo, not bad:
Just a matter of adding more behaviors to the enemies if the game is in demo mode
And shooting at just the right times
Still a bit of work in progress but close!
goodluck sir
Nice!
does anyone know optimizations for multi body collision
looked up spatial partitioning methods like sweep and prune but i am having trouble understanding those
is it okay to ping the helpers?
have you tried using the help channels
Collision detection systems show up in all sorts of video games and simulations. But how do you actually build these systems? Turns out that the key ideas behind these systems show up all over a field of computer science called computer graphics.
We start off with the basics of animation and then branch off into ideas in discrete and continuous...
thanks, that helps
sweep and prune seems simple to implement
i thought it was more complex
Hi i have a menu and a game and at the moment when i press start playing it will say "thanks for playing" which is fine but i need to link it up to my game instead
!py
!pyp
!pypi
package
def game_loop(self):
while self.playing:
self.check_events()
if self.START_KEY:
self.playing= True
self.display.fill(self.BLACK)
self.draw_text('Thanks for Playing', 20, self.DISPLAY_W/2, self.DISPLAY_H/2)
self.window.blit(self.display, (0,0))
pygame.display.update()
self.reset_keys()```
Python Gamedev (for an Amiga game)
Not exactly a game implemented in Python, but some part of the project I worked on for 3 years are heavily based on a Python toolchain of my own.
This is the game : Athanor 2, for the Amiga computer (a computer that went to the market circa 1985, powered by a 16/32bits CPU running at 7.14MHz)
The game itself is entirely written in C, BUT :
- all the texts, graphics, musics and audio fx are pre-processed from modern formats (png, wav, ...) to a more suitable format, thanks to a set of Python tools I created
- the scenario & game logic was written in a very simple (yet turing-complete) language (made of basicaly 3 or 4 instructions). I relied on Python to transpile this game logic scripts into C.
This is what the game looks like (it should be available in a matter of weeks now) :
https://www.youtube.com/watch?v=3H4jfGa0ImU
Here it is, the Amiga version of Athanor 2 - Legend of the Birdmen
The final countdown has started !
The Amiga version will be available very soon now.
Some spoilers in this video but not more than the Atari Version !
Thanks to FranΓ§ois Gutherz for the Capture on vAmiga and this Amiga conversion of course.
Stay tuned
Twitter : https://twitt...
the Python transpiler takes the langage on the left, here, and translates it into C, on the right :
approximately 30% of the C source code of the game is generated by a Python script
the texts (descriptions, dialogs...) are processed by Python, using many of the available tools, including a hyphenation module that is very handy (the game is both in French & English, and I wanted to pre-hyphenate the texts, so that the Amiga don't have to do it)
it reaaaaally easier to deal with encoding in Python (the original files are in DOS CP 437 for some reasons, and the Amiga works in Latin-1)
all the graphics & audio files were processed by calling either Image Magick or SOX, using popen β€οΈ
and I relied on a CRC16 Python module to generate unique IDs (needed that to make the save/load routine future-proof)
my conclusion
Even for retro-machine gamedev, Python is a real asset!
(some more technical details about the native plaftorm here : https://www.amigalife.org/index.php?topic=158.0)
Python is great for retro gamedev
I've done a few big retro arcades with python
This current project is probably my most completed
Or most like the original
like this one ?
Bug Fixing and refactoring this weekend, so instead of posting new features, I offer you a race between the original #AtariST Drones (Yellow and Green) and the PySprint Drones I have written from scratch, by just eyeballing the original game (Red and Blue). Close enough? #pygame https://t.co/QUH6FlVAKT
hah, that was a fun one, would be fun to remake too
That's hard to do, those drones
How are they finding the path?
woah thats realy cool
Path finding algorithims
Oh really?
Mhm
Well then
Why ask?
You could just learn
ML
Instead of saying you dont know how they are finding the path
π
There are at least a dozen path finding algs, path finding algs doesn't tell me shit
Its up to you to pick one?
I asked about what he/she was using
the source code is here, it prolly starts with some sort of collision detection, then a routine to find the best way to avoid the collision (against the track borders)
Not what I'm picking
Well why dont you go learn some DSA, ML and then come back so that you woudl know what to do
chillll
Especially not yours
Okay
your loss then
For someone who only knows game dev thats pretty cocky
And that too a 2d arcade game being all they made
I know about path finding algs, I've coded some of them myself
Well then, shoudnt you know how they are finding the path? Or do you just want to know the specific alg they are using π
yeah, calm down, folks π
I guess theres no point arguing with that person
Ill stop wasting my time
Stop wasting my time, too
Thanks
I asked someone what they were using and you have some cocky reply "path finding", like no shit sherlock
You're a genius
i'm not sure there's a path finder, here
probably it's far more naive than that, something like "trying to avoid the walls in the next meters"
the track is described as 2D vectors, easy to check is there's a collision incoming
pretty sure a path finding algo will look too janky
unless you lerp the shit out of it
Looks like it's just aiming for the next gate all the time
While avoiding walls
Which gives some insight as to how it's working
The track has multiple 'gates'
And the AIs are always just driving to the next one with some adjustable params along the way in their personalities
I've read and heard it a few times, the simpler the better for AIs
I totally don't know how to code game AIs
For that demo mode, I created an object that runs it and triggers events based on the object's age
I don't know how else to schedule things
So it's basically a chain of if self.age == statements followed by things to do
Still didn't get it pal
How can you make a platform in pygame
I already made the platform
And the collusion of it
class Platform:
def init(self, PlatformX, PlatformY, width, height):
self.PlatformX = PlatformX
self.PlatformY = PlatformY
self.width = width
self.height = height
def Platform_Creation(self, WIN):
self.PlatformRect = pygame.Rect(platform.PlatformX, platform.PlatformY, platform.width, platform.height)
self.Platform = pygame.draw.rect(WIN, (GREEN), platform.PlatformRect)
def Platform_Collusion(self, WIN):
global On_Plat
PlayerRect = pygame.Rect(player.PlayerX, player.PlayerY, player.width, player.height)
Player = pygame.draw.rect(WIN, (255, 0, 0), PlayerRect)
if platform.PlatformRect.colliderect(PlayerRect):
print('platform has been touched')
Right now it's printing a string value whenever a collusion happens
So how to make something stand on it?
You would need to stop the x or y value from proceeding
its simple
normally when you click right/left it moves x by a certain amount
so you just need to say, that when its colliding your relative x becomes 0
for example
isntead of directly changing the value of x
just change some other value
let me show u the pseudo code
relative_x = 0
x = 300
if clicking right:
relative_x += 3
elif clicking left:
relaive_x -= 3
x += realive_x
screen.blit(image, (x, y))
Now what you need to do is basically before blitting it, you need to do one last "check"
relative_x = 0
x = 300
if clicking right:
relative_x += 3
elif clicking left:
relaive_x -= 3
# Last check
if colliding with wall:
relative_x = 0
x += realive_x
screen.blit(image, (x, y))
Now guess what would happen
now the characters x position woudnt change when colliding with the wall
as for jump mechanics
Basically, theres a 'main' loop which runs most games
And we need to define how many times the loop, loops in a second
This called as the FPS, lets say the FPS is 60
During a jump, the y position of the character increasing by a few pixels through every time it goes through the loop(every iteration)
And once the y position has reached a certain maximum value after its initial point, we just make character STOP
Now you may be wondering, if the character has stopped, why does it fall down after a jump and reach the ground?
Well this is because throughout the entire loop, we are infinetly reducing the characters y position
and the reason it doesnt go below the ground, is that we say that it cant go through a certain 'floor'
This is how a jump works in a 2d game
Try reading the pygame docs and implement it :)
in cases like this i recommend reading some nice source code of a platformer
and get to see how others do it as well
This is some good source code
Uh oh, everyone be quiet, the genius is talking...oh wait, there wasn't anyone typing anyway, carry on
hi
need help in making discord bot
need testers too
dm me for any testers and helpers
Well
You first have to make a function
def Player_Movement():
inside it
Do as follow
key_pressed = pygame.key.get_pressed()
if key_pressed[pygame.K_RIGHT]:
(Your player X value) += (The amount of pixels you want to change)
Easy
@dawn quiverYou first have to define a function that will controll all of this
Can you not update the colour of SpriteSolidColor? Inside on_update I've changed the colour of a sprite within an inner sprite list using self.grid_sprite_list[column][row].color = color. And that works just fine, no errors or anything.
However, when I try to then draw the sprite, no changes visually appear even though the attribute now has another colour
Anyone know how I can fix this?
Solved: By using a Sprite instead, with the image being a white square, changing the color attribute just tints the white to whatever colour you want it to be
(this is in arcade just to be clear)
is it possible to design a game using python?
Pretty immature
Well i cant expect much from a 12 year old breaking ToS
lol, some people just don't get the social thing, there's one of them
I doubt someone who sits in their room the whole day would understand what socialism means 
sure
Apparently some of us don't even have a vocabulary, socialism is not socializing
That's enough, there's no need to continue sniping at each other
Yeah, that is enough
Okay, :D
People talk about how awesom the python community is, it's quite a disappointment really when we have smart ass know it all know nothing kids running their mouth
:(
I just sit here filling the channel with paragraphs of my game logic and struggles/accomplishments and this kid wants to be a dickhead by confronting me about spewing the channel? It's a chatroom channel, speak!
I was just trying to say that it would be nice if you kept the description shorter.. π
π¦
!mute 355791171231940620 "1 hour" You were instructed to stop this by a mod.
:incoming_envelope: :ok_hand: applied mute to @limber veldt until 2021-06-28 16:44 (59 minutes and 59 seconds).
Same goes for you Axis if you gloat about this.
game development
Anyone present with experience in nongeographical mapping?
can someone send me a link for a sample code for akinator game?
This is a tutorial to make button in pygame,
If the coder has given height and width for the pygame window then why he is using
width = screen.get_width()
height = screen.get_height()
```??
If the window is resized.
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_a:
x -= vel
if event.key == pygame.K_d:
x += vel
if event.key == pygame.K_w:
y -= vel
if event.key == pygame.K_s:
y += vel
``` How so I set up boundries here?
Ping me when you help thanks!!!
Hello everybody!
I'm so interesting about coding video games
I'm just a beginner and I'd love to create a server with 5 peoples to code
Hello Can u help me to install all the python packages for coding games ?
Hello Can somebody help me to install all the python packages for coding games ?
hello
hello
easy games like super mario etc
ok so casual
its just the begging for me
ok what engine do you want to use
for just starting out unit or godot are both really good ones
2d or 3d
do you want your first game to be a platformer
im asking
?
you responded with ok for a question
yes
why do you want to make games
just for fun
yes
did you make anything?
i create a 3d game with blocks and coins
cool
i create this game on my old pc
but i dont now why i cant login or sing up on a new acc on unity
what questions do you have about developing a new game
yes
whats is the best code program to code games visual studio or py charm
that one is perfect for what you want to do
what game
?
what u mean
and i create a simple calculator
ok
Kik lmfao
what
Wat
Make a racing game like fast-track with low size
.
ok thank
can python be used in unity?
no
I think there's there's a thing focused for the film industry, but not really no
Hey @dawn quiver!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Hey guys m working on a snake game and I don't know how to increment the size of the snake when it eats food below linked is the code i implemented. It isn't very efficient. Someone please look into it and help
https://paste.pythondiscord.com/eyewovugib.apache
Can you take a look at my game?
https://fixcode.itch.io/survivemaster-page
Guys Can I use ursina for making minecraft?
I've done it on a small scale but I wouldn't simply because ursina uses voxels and they tend to be pretty laggy on a large scale but small worlds and building is perfect with ursina
I mean then can I use kivy?
ive never personally used kivy so idk
Im not hating on ursina its still good for game developement
I have used but I think its only used moblile apps and fast 2D and 3D games
ursina is better for 3d games in my opinion
but the problem is if you wanna develop games like Minecraft you have to use Ursina because it has better support for 3D games.(and apps maybe!)
but yeah thnx @slim parcel
yeah i wish there were more options
I guess you are having wrong opinion(no offense)
coz I just googled for great 3d game dev and there is showed this
what did you find
see this
lemme give a link to the article
ok
check it out!
Is there a builder (possibly web based) that I can use to build Pygame GUIs? Then after I finish the GUI it'll give me the co-ords of all the shapes i drew?
Im asking because i've spent the past 2 days building a GUI, most of which were spent tweaking co ords
this is starting to get cumbersome and time consuming so im wondering if there's a way or a tool that I can use to speed tihngs up?
are you using classes for the objects
yes
no. Blender and Pygame use co ords differently right?
on the web it notes them being compatible
yes, but you have to make it the proper way with chunks and stuff if you want it to run fast, not like in the famous video tutorial
ah ok.
Trying to detect collisions
if player.colliderect(player_2):
print("oof")
``` I tried this but this gave me the error,
if player.colliderect(player_2):
AttributeError: 'pygame.Surface' object has no attribute 'colliderect'
I'd love to but my computer is running OS X :/
Is anyone able to help with adding a turnaround animation to a character sprite?
Gladly
how to change screen in pygame? Like moving slides in PowerPoint
Like the 1st slide will contain start button if the user click it then it'll move to slide 2 where he will be asked to enter name and wicket and then it'll move to 3rd slide where he will enter the commands for game
Wicket = number of trials (a cricket π term)
Hey @lucid fog!
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:
lol roasty
ill dm my code if u want

yes please
can i post my shitty game here
hello
i just quit making a game i was working on
;(
im going to start afresh after exams
:D
ello
why would u make an game in python and not just use unity and cs, what r the pros?
you can fix bugs yourself instead of being the mercy of unity
you don't have to use a slow and unstable editor
less waiting for compilation and asset importing
you can control the asset pipeline yourself
you might like python better than c#
unity isn't free or open source
you have access to the whole python ecosystem, all the packages
also making things from bare minimum is fun
And even just economically. There's a lot of waiting when making bigger projects. And if every member of your team have to spend an hour every day just waiting for unity to import assets and such, that's a lot of money wasted. You'll need a really beefy computer
Of course, there's a lot of upsides to unity too, like cross platform support
wdym unity isnt free
if your company earns more than a certain amount of money, you have to subscribe
100k in one financial year
hey, I'm looking for a good python library, to make a roguelike. Do you know any?
Is there any python lib to make a 3D multiplayer FPS ? (In the same network, i might use socket)
There is,wait i will find its name
Ursina Engine
pn me
can anyone tell me how to get the suggestions like in this photo?
like how do i get the suggestions window after typing pygame.
well this is if you use pycharm i think and it just happens automatically
Do you use pycharm?
@brisk monolith If you aren't tied to Pygame yet, Arcade has something like that built-in: https://arcade.academy/tutorials/views/index.html
When i used to make my code in repl.it i could easily make different modules and just import the different 'slides' i dont really know how to do that without repl.it. But what i do now is i'll make these if statements like if game-start equals True then you can do all the code for that slide and like if you press the button that equals play or something and then it will have all the code for that slide. This is my code from repl.it (just an online website to code) https://replit.com/@815398/data-base-7#main.py. (the password is just 123). I am dutch by the way if you don't understand the words
so the other way is for example; if start_game == False: and then the code for that slide. and then if you make a button and you click on it it wil become true. and then you can type else: and the code for the next slide
hope that might help
Guys does this work?
import pygame as py
py.init()
size = (500, 300)
screen = py.display_setmode(size)
while True:
for ev in py.event.get():
if ev.type == py.MOUSEBUTTONUP:
pos = py.mouse.get_pos()
col = (0, 255, 255)
py.draw.circle(
screen, col, pos, 20, 5
)
py.display.update()
π€― 
screen = py.display_setmode(size)
that has an error it says that pygame has no attribute 'display_setmode'
import pygame as py
py.init()
SCREEN_WIDTH = 500
SCREEN_HEIGHT = 300
display_output = [SCREEN_WIDTH, SCREEN_HEIGHT]
screen = py.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
while True:
for ev in py.event.get():
if ev.type == py.MOUSEBUTTONUP:
pos = py.mouse.get_pos()
col = (0, 255, 255)
py.draw.circle(
screen, col, pos, 20, 5
)
py.display.update()
this does work
Are there any libraries like PyMem or ReadWriteMemory, but Linux compatible?
RWM's setup.py classifier lists 'Operating System :: POSIX :: Linux'
but their documentation is rather lacklustre
Thanks
So basically you have divided your game code into different modules right?
I've my project submission on 6 and I've created the text based version but I'm struggling to add graphics because I haven't learnt OOP and the pygame button tutorials on YouTube uses OOP. All I need is gui buttons and display for scoreboard and now currently I'm thinking of using tkinter cause it contains builtin button
so can you help me understand why this doesn't work?:
joysticks = []
for i in range(pygame.joystick.get_count()):
joysticks.append(pygame.joystick.Joystick(i))
for joystick in joysticks:
pygame.joystick.init()
print(pygame.joystick.get_init())```
let me explain a bit more
it does not give an error but also isn't moving my character like it should from this part:
```py
if event.type == pygame.JOYAXISMOTION:
analog_keys[event.axis] = event.value
print(analog_keys)
if abs(analog_keys[0]) > .4:
if analog_keys[0] < -.7 and player.x - player_vel > 0:
player.x -= 7
else:
continue
if analog_keys[0] < .7 and player.x + player_vel + player.get_width() < WIDTH:
player.x += 7```
here is full code:
python file: https://hatebin.com/jwjvpedeng
json file: https://hatebin.com/dgqtvahqqr
I have to go but please respond with possible solutions and I will come back and respond ASAP
someone on stack overflow told me to try this:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
if joysticks:
joystick = joysticks[0]
axis_x, axis_y = (joystick.get_axis(0), joystick.get_axis(1))
if abs(axis_x) > 0.1:
player.x += 7 * axis_x
if abs(axis_y) > 0.1:
player.y += 7 * axis_y```
so I will be trying that as well
Thank you kind sir or ma'am
Hey
is there some way i can call c# events, such as Unity functions, from python? I would like to use python's NEAT play a game I made
So you have a Unity game and you want to use a Python AI with it? From what google tells me, it's possible (unofficially) to script Unity with Python, so that'd probably be the way to go.
When using GDB and attaching to a process it freezes it, is it possible to avoid this?
Thanks, ill take a look !
nvm
so I'm trying to make a boost functionality to TechwithTim's space invaders pygame video but everytime I click the boost button it crashes the game from over loading it here is my code:
if left_trigger_axis > 0:
boost = True
while boost == True:
t = 15
time.sleep(1)
t -= 1
print(t)
if t > 0:
player_vel = 15
elif t <= 0:
player_vel = 7
boost = False ```
yes I'm using a controller the button works fine its the boost parts that don't work
the print always prints 14
t = 15
time.sleep(1)
t -= 1```
you're overwriting `t` each loop
(also while boost == True: can just be written as while boost)
also also it won't do what you want it to, because you're running the loop inside your game loop, this loop will run first, then continue to the next update cycle
on top of that time.sleep blocks your program from running anything so your game wont update
easiest fix would be to set t as a higher value, (in your game loop) check if the trigger is > 0, check what value t is, set player speed and decrement t
or you could also set up a async timer (or compare time between frames) which will decrement t every x seconds
Can you take a look at my game? There will be an update today!
https://fixcode.itch.io/survivemaster-page
Hey
I wanted help in pygame
import os
import pygame
WIDTH, HEIGHT = 900, 500
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Testing")
CYAN = 60, 123, 240
FPS = 60
YELLOW_SPACESHIP_IMAGE = pygame.image.load
(os.path.join('spaceship_yellow.png'))
RED_SPACESHIP_IMAGE = pygame.image.load
(os.path.join('spaceship_red.png'))
def draw_window():
WIN.fill(CYAN)
WIN.blit(YELLOW_SPACESHIP_IMAGE, 300,100 )
pygame.display.update()
def main():
clock = pygame.time.Clock()
run = True
while run:
clock.tick(FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
`draw_window()`
`pygame.quit()`
if __name__ == '__main__':
main()
win.blit isn't working
what's wrong in this ?
wuts the erorr
one sec i will send
um add a pygame.init()
ok
also
pygame.image.load()
i think theres a
break or smth
can u retype that
pygame.image.load(os.path.join('spaceship_red.png'))
do the same for yellow spaceship
it is thinking 300 is also the source
YELLOW_SPACESHIP_IMAGE =
np
can a good 2d game be made with python?
yes
https://learn.arcade.academy/ and https://arcade.academy/ are great places to start
no
sadly python is limited to printing outputs in consoles
if you want to make a good game
learn something like brainf
or assembly
hey guys is there anyone who might be able to help me out with a problem i am struggling with in pygame?
how would they know without knowing what the problem is?
so I have a new problem when I was trying to make it so the player couldn't fly off the screen I made them get stuck to the wall when they touched it any idea why this happened?:
axis_x, axis_y = (joystick.get_axis(0), joystick.get_axis(1))
right_trigger_axis = (joystick.get_axis(5))
left_trigger_axis = (joystick.get_axis(4))
if abs(axis_x) > 0.1 and player.x - player.vel > 0 and player.x + player.vel + player.get_width() < WIDTH:
player.x += round(player.vel * axis_x)
if abs(axis_y) > 0.1 and player.y - player.vel > 0 and player.y + player.vel + player.get_height() + 15 < HEIGHT:
player.y += round(player.vel * axis_y)
if you couldn't tell already this is in pygame
please @ me if/when you respond
is there anyone who could help me with making my left mouse click also a key in my game right now i can only make keyboard controls work but i cant find a way to add my left mouse click
if you can help me pleas @ me or send me a dm
so this is what I did in my pygame for a main menu type thing:
if event.type == pygame.MOUSEBUTTONDOWN:
#what you want to happen
yes look
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_SPACE and game_active:
bird_movement = 0
bird_movement -= 7
flap_sound.play()
if event.key == pygame.K_SPACE and game_active == False:
game_active = True
pipe_list.clear()
bird_rect.center = (100, 512)
bird_movement = 0
score = 0
but I believe this is every button on the mouse though
so instead of KEYDOWN do MOUSEBUTTONDOWN
then i get this error
if event.key == pygame.MOUSEBUTTONDOWN and game_active:
AttributeError: 'Event' object has no attribute 'key'
it should be event.type as well sorry
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if game_active:
bird_movement = 0
bird_movement -= 7
flap_sound.play()
if not game_active:
game_active = True
pipe_list.clear()
bird_rect.center = (100, 512)
bird_movement = 0
score = 0
I believe that should work
oh wait
let me edit that and fix something
there we go
lemme try
yeah
that works
but how do i
mka
make
space and mouse work?
so i can use both
make another one with the space bar
so like i had before?
yes
doesnt work
what do you mean
make another one
i copy pasted my old code
underneath it
so it should be this:
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if game_active:
bird_movement = 0
bird_movement -= 7
flap_sound.play()
if not game_active:
game_active = True
pipe_list.clear()
bird_rect.center = (100, 512)
bird_movement = 0
score = 0
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_SPACE and game_active:
bird_movement = 0
bird_movement -= 7
flap_sound.play()
if event.key == pygame.K_SPACE and game_active == False:
game_active = True
pipe_list.clear()
bird_rect.center = (100, 512)
bird_movement = 0
score = 0
I believe
this makes it work
but
also right click works now
and i only want left click to work
@blissful cape check the result of event.button
1 - left click
2 - middle click
3 - right click
4 - scroll up
5 - scroll down
Where is the event.button?
Check that field when you check if event.type is mouse button down to determine which mouse button it is
And you can only perform the action if the left button is clicked
hi
hi
Yeah I did this but then I changed if game_Active to if event.button == 1: but idk if thatβs bad that I removed the game_active
@blissful cape you can always use and to check both Β―_(γ)_/Β―
how i do this @sharp lily i dont understnad what you are saying
if game_active and event.button == 1:
The if statement will only execute if both expressions on each side of the βandβ are true.
tips for improving/maximizing pygame performance?
does pygame even work with pypy?
I think it refused to launch when I tried, but that was back on Pygame 1.*
I am trying to use arcade, but when trying to impot it, it throws the error that there is no lib called 'GLU'
i have arcade itself installed (duh), as well as opengl 4.6, mesa-utils and freeglut-dev.
i tried following tutorial online, but it still doesn't work, it continues to throw said error
(I'm a lefthander)
who uses ijkl 
me, when having ground control for planes in trailmakers. but thats it. (wasd for pitch and roll, ikjl for car like controls)
not ijkl
i know
just use wasd
wouldn't the game control be worse if the main hand is left and you're using wasd?
Hi
no
have you tried ijkl
bc we use the mouse with the right hand still
ok sure
at least most of us. the others can go to hell figure it out for themselves
i thought left handed uses left hand to control mouse
nope
anyone having an idea?
... it works fine, when executing it via the terminal
just not via pycharm
use vscode , pycharm sucks (atleast for me)
i am
What tech stack?
Like what modules are you using?
Im using django + html + bootstrap css
python and not much else
it's a text based game
gonna be playable in the terminal
ah nice
Mines basically a text based but you click your way through
its about robots
nice
nah i don't think i'll add that
it's kinda based off this game (gimme a sec)
You're eight years old. You wake up in the middle of the night to use the bathroom. But you soon realize that not everything is as it seems in this house tonight. Where has everyone gone? Things look different in the dark.
BE AWARE! Uktextadventures will time out your session if you're not logged in. Download is recommended for best experien...
which was pretty dope
same here, but im not even making the story or anything yet
what i'm making is the game system itself and then i can use that to make as many maps/levels as i want
cool
So basically the system can be for turn based anything
like final fantasy or pokemon style
I am still thinking about how it will work though.. because idk if i really need websockets for the battles
For sure I want ajax request though because I don't want the page to re-render every time
https://paste.pythondiscord.com/musasoduse.py
In this pygame program, how do I make the scroll wheel flash last for three frames consistently? Right now, sometimes it lasts for 4 frames.
The relevant parts are from lines 42 to 55 and lines 129 to 141.
Also I donβt want to use pygame.time.delay because it causes 100% CPU core usage
*I changed the flash time to 42 because that's right between 33.3 milliseconds and 50 milliseconds, 2 frames and 3 frames. It seems like it improved it, but I'm still not sure if it's a good solution.
Are you saying: waited_time = pygame_time_wait(1)
is 4 frames?
Which function specifically is it?
@chilly vine
50 milliseconds is 3 frames
But if I have the flash last that long, sometimes it's shown for 4 frames
What do you guys use to develop the game other than python itself (what do you do for the visual and audio part) ping me. (Im a little new to game development)
You can use arcade, pyglet, pygame, panda3d, etc, for games/visuals. Most graphical libraries included graphics + audio
Why doesn't my arrow keys work? https://paste.pythondiscord.com/oqoyogunoz.py
Umm... because you are always drawing at (SCREEN_WIDTH/2, SCREEN_HEIGHT/2)?
I may have got it wrong tho π¬
π I edited it to: screen.blit(player.surf, player.rect)
It's always such simple mistakes that I always overlook π€£
THANKS
I REALLY NEEDED SOMETHING LIKE THAT
e
Does blender work too?
Blender just makes 3d graphics and animations
I can never remember the name of the library for the life of me π but there is a framework for working with blender
Iβd also assume youβd be able to load models in the 3D libraries but Iβm not sure about that
You can load blender projects with pyunity
how can i change the scaling algorithm in arcade to none?
it uses cubic (or bipolar) as default, but I'm making a pixel art game, so everything just looks reallly blurry
Ah I see
so anything you people would recommend for my FIRST graphical library for python?
https://arcade.academy/ and https://learn.arcade.academy/ are great places to start
Also if youβre working with 3D models/animations it looks like panda3d has native support for it
i recommend pygame
because thats what i use
Hello everyone, I am coding in pygame and I would like to know how to make an image resize to fit the screen size please?
it's somewhat subjective but arcade's docs are a lot nicer
that being said, you'll find a lot more tutorials/examples for pygame
You donβt have to, but a strong foundation in it will help a lot
You need the NEAREST interpolation then.
searching in the docs, I see that the Context objects (representing an OpenGL context) have interpolation modes
where do you set it, hmm...
@wicked lintelAh, there we go:
https://arcade.academy/tutorials/edge_artifacts/index.html?highlight=nearest#aligning-to-the-nearest-pixel
If instead you want a pixel-look, you can use a different filter called βnearest.β This filter also reduces issues with edge artifacts. First, import the filters at the top of your program:
from pyglet.gl import GL_NEARESTThen, in your
on_drawupdate the drawing of your sprites with the filter:def on_draw(self): self.my_sprite_list.draw(filter=GL_NEAREST)
ah thanks :3
i already figured that i needed nearest, but i didn't know how to get it to draw like that
(nearest and none are the same right?)
well, the only way to not have any interpolation is to not resize your textures at all π
if you want the texture to "look the same but larger", that's nearest
ive seen point sampling called 'nearest', 'pixel', 'none'
nearest neighbour for downscaling
Does it have any way you can use a spritesheet in python without Json?
haii I want to make a 2d platformer kind a game for the web a simple game any suggestion on what frame workks i can use?
its fine if its javascript also
scratchπ
hi, im using pygame and im blitting an image but its not blitting anything but i have another for loop which when the coin (the image that isnt blitting) hits the player then the coin will disappear and print('col') i dont see the image on the screen but it is touching the coin and printing col?
code:
for f in foods:
screen.blit(food,(f[1], f[2]))
print(f)
pass```
```py
#making the image move downwards
for j in range(10):
for f in foods:
f.y += j / 9
pass
#when the player touches the coin
for f in foods:
if player_rect.colliderect(f):
if enter == True:
print('col')
lives -= 1
print(lives)
foods.remove(f)
enter = False
else:
enter = True
if lives < 1:
lives = 0```
pin me if u have the answer
@twilit frost Try arcade. Here's a tutorial for a simple platformer to get started: https://arcade.academy/examples/platform_tutorial/index.html
Question for everyone, I'm trying to improve API docs for the Arcade library. I've got this as a quick index to look up Arcade commands:
Any suggestions on improvements? Other libraries that do it better?
I have a question, I installed Kivy on vscode using pip, and it was when I have venv activated. So would Kivy continue to operate if I deactivate venv?
Can i use it on the web?
hey
Hello
Wassup
so whats the issu
e
so i copy pasted the thing but where do i start programming
imma add my variables
You would need a text editor
or an IDE
i recommend starting off with sublime
as beginners do not need an IDE
elaborate
thanks
so i download this
and then i transfere it to my python?
once you download
wait should i have the explorer context menu
In this Python Tutorial, we will be setting up a development environment in Sublime Text 3. We will walk through how to install Sublime Text, install Package Control, install Packages, and much more. Let's get started.
GitHub Sublime Settings - https://github.com/CoreyMSchafer/dotfiles/tree/master/settings
Source Code Pro Font - https://fonts.g...
Here
i use geany
works like train toilet
where does the script go?
i just tested by doing Print ("Hello World")
like if i do Print ("Hello World")
where does hello world go
where can i see it
you should be able to see a console
so like, let's instead of thinking about scripts
let's open up command prompt
and type python and hit enter
Axis, are you being serious?
@dawn quiver Use a text editor
Are YOU being serious?
but what?
ok cool, axis will take it from here chonk, gl have fun
ciao
ok so


