#game-development
1 messages Β· Page 34 of 1
@nocturne quartz i just did this lol, i can do actual pixel art but i just did this to test it
omg
thats a paddle
π
btw i cant even think of being here its an honor
ive never even made a game other than snake...
oh for the paddle why dont you call position_data just like 'rect'
where??
i am calling the position data?
if 6 > (self.ball_position.x - (other.position_data.topleft[0] + ball_cordinate)) > -6:
...
well its not just position, no? its also size and allat
also i kinda mess up on this too but what id recommend is having coordinates be relative to the width and height
that way if you change the resolution, it doesnt immediately screw everything up
r u suggesting me to use .get_react() or smth?
yes its just positions
what i mean is like you have if 800 > self.ball_position.x > 750:
if the resolution is changed though that'll mess up
truee
what do u mean by "having coordinates be relative to the width and height"
tho
so like say you want the center of the screen
rn that'd be 400,300
since the res is 800x600
right
but say you change the resolution to like 1920x1080
now 400,300 is like over on the top left (i think pygame starts from the top left at least)
also these can be made into one
yes i get it but whats ur fix
to that problem
and then u might also want to like increase the size of ball and paddle?
well what i do is declare 2 variables for the width and height, i usually just use 'w' and 'h', but you might want to just call em 'width' and 'height'
then for the center, it's just w/2,h/2
that would be alot of tweeking i cant imagine how games have options to change soo many resolutions π
well what you tend to do is use a different sort of space for the in game coordinates, and the screen space coordinates
soo everything is relative to the edges of display
give or take, yeah
relative coordinates are one way of doing it
its like fps
if you have the time be frame based, a higher fps makes the game run faster
but if you use something like deltatime it'll be the same speed, no matter what fps
which i keep on forgetting to do in my own stuff lmao
im not an expert but ive been screwing around for a few years
so in pygame.Rect(..)x and y should be center of the screen and its width and height should also be smth relative to the screen so when u change res everything would still look cool
then i assume the image scaling should also be smth relative to the screen
instead of (100, 100)
i think pygame has a way of doing coordinates that are unlinked form screenspace but idk
why is ur paddle soo big π and why is it a square
i figured you just did that for testing lol
oh i see how your velocity thing works
that's an interesting way of doing it
bro uve been doing it for like soo long idk when am i gonna get better than u π¦
anw now i need to make like blocks to break!!
one problem solved 99 to go
honestly it comes in stages
r u like at the final stage of game dev π
nah
well u havent like super helped me or anything w my code but u told me about the scaling stuff and i was kinda getting bored and got to hangout w u soo thanks for that :3
appreciate it :DDD
np
honestly, you already have most of the difficult stuff down
classes and functions are the things most people get hung up on
i mean like game dev specifically
yk believe it or not u actually taught me how to like add velocities to position π like month ago ig
theres better ways to do it btw but they're more complicated
when i was makin snake game
i need to add a feature to it tho which im procrastinating on and i think it requires threading which im nor familiar with
r u familiar with threading in python?
i actually kinda forgot this code ...
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
oh btw one thing i added to your code for testing is making z reset the ball
i also swapped ball_position and ball_velocity and paddle_velocity to just pos and vel
so in check movement i just added
if keys[pygame.K_z]:
self.pos = VectorXd(w/2,1)
self.vel = VectorXd(0, 3)
but ppl said that u should always make your variables more descriptive??
is pos and vel considerd good practise?
well if it's in ball it's kind of obvious that it's for the ball
idk if pos and vel are the absolute best but it's what i use
in naming variables you're constantly balancing readability with compactness i find
oh i did that because like if i make
def velocity(self):
...
```in the ball class then it would be same as
```py
def velocity(....
```ugh tbh idk what im yapping about yes different classes methods can def have same names :))
exaclty
exactly**
oh for your vector btw you can implement something like __getitem__ instead of a method for getting the coordinates
or __iter__
__iter__ is a great one because it makes your object able to do a lot just by default
like casting it to list or tuple
but do i really need that right now?
not necessarily but i noticed it being an issue in your snake c ode
i think you have a different version of your vector stuff between the brick breaker game you've been showing and the snake
reset it to what back where the game started
man..
from math import sqrt
import random
class VectorXd:
def __init__(self, x, y):
self.x = x
self.y = y
self.position = (self.x, self.y)
def __add__(self, other):
# if other is the instance of this class
if isinstance(other, self.__class__):
return (self.x + other.x, self.y + other.y)
return VectorXd(self.x + other, self.y + other)
def __sub__(self, other):
if isinstance(other, self.__class__):
return (self.x - other.x, self.y - other.y)
return VectorXd(self.x - other, self.y - other)
def __eq__(self, value: object) -> bool:
if isinstance(value, self.__class__):
if self.x == value.x and self.y == value.y:
return True
else:
return False
def get_distance(self, other):
if isinstance(other, self.__class__):
return sqrt((self.x - other.x)**2 + (self.y - other.y)**2)
else:
raise TypeError("expected the same instance of that class")
def randomly_change_position(self):
self.x = random.randint(10, 740)
self.y = random.randint(10, 540)
def get_position(self):
return (self.x, self.y)
# self is the instance
def print_first_cor(self):
print(self.x)
try this
what does that do?
when should i start opensourcing stuff tho 
damnnn
generally, i say when you start using the same code in multiple projects
i dont want ppl to judge me by my bad code π
there's also math.hypot which is the distance from an iterable to 0,0 (or 0,0,0, or whatever dimension), so functionally the length of it
interesting
is it more fun coding all that and then seeing it work than just memorising names?
depends
is it opensource
most of it
well, eh
i have like 3000 python files in my scripts folder lol
most of whic hare just a few lines to test some thing or other
yeah im trying to get it to work
u js need 3 pngs
thats all u already have the vector class
yeah i added them, it gets mad about the video system not being initialized oddly
mouth_image name is wrong tho it should be smth like skin_image
this code is kinda hard to read but to be fair my own snake implementation is kinda nightmarish
thats the skin π idk what i was think but idk it it looks good or anything
it gets blitted when snake comes closer to food
aw yep
snake = Snake(snake_image= simage, mouth_image= mimage, blood_image= dimage)
like the minage here
damn ansi stuff
Any place where I can ask beginner questions to get help?
ig here
depends on what you mean by beginner ig
there i think
swapping that actually worked for a sec, it errored again after a bit though
very odd
Yea pretty beginner. Was just wondering how to make a program where it asks for a randon number, and if the user just presses enter the whole program won't send error.
it works fine for me?
I found out how to do this with string but not with integer.
cuz ur head might be crashed
i dont have any error handling logic there
can anyone help me with this?
easiest way is just try-except and try converting it to integer
a better way is to check the input with something like isdigit()
its saying i dont have a module named "settings"
Isn't there any nil values for integers?
did u install pygame?
this is my settings
wdym
i believe so yes
is 'settings' in the same folder
how do i check that?
like in file explorer
Like set a integer value to nil. So if no values has been set to the integer it will just be nil.
oh, None works ig
it's not really an integer but it works as a fallback
yeah that seems to be it
be careful while playing π€§
idk why it did it on start
also i need to fw the blood thingo and ig i need threading for that
ok i put them in same folder and it worked, thanks
np
python really doesnt like it when you have modules in a different folder most of the time
you can do it but it's kinda fucked
wait why
like wait for 3 seconds instead of "pausing" everything keep blitting the blood and then quit the game after 3 seconds
also good on you, using a deque
deques are very nice for a lot of things, i like using them for trails
deque is my another name bro
that O(1) popleft is fire
yeah ik
def display_snake(self):
for segment in self.all_segments:
if self.mouth_in_action:
screen.blit(self.mouth_image, (segment.position))
elif self.snake_is_dead:
screen.blit(self.blood_image, (segment.position))
else:
screen.blit(self.snake_image, (segment.position))
like its snake_is_dead is never gonna get true
that requires threading right @versed aurora
nah
what i usually do in that case is have some sort of countdown variable
so when its above 0, decrement it, when it's equal to 0, then quit
there's probably a better way to do it these days but it's the OG way of doing it
can someone explain why the class doesnt have the run attribute?
one thing that comes to mind is just checking the time elapsed or creating a timer
can u be more explicit what is it???
thats what i thought mate
hold on 1 sec
oh im stupid , thankyou π π
how can i create a timer and so when then timer ends quit the game?
and that timer should also start when the snake_is_dead is true
right
ive never fw time module much in python other than using .sleep()
https://www.pygame.org/docs/ref/time.html#pygame.time.set_timer
this might work but it seems to do it multiple times
in general if you find yourself doing something yourself, chances are pygame has something for it
it is good to try doing stuff yourself though
i always do stuff on me own π
all i need to do is create a timer
which starts when this is true instead of just quitting the game when it isnt true
what i've always done is something like this
countdown = None #not initialized yet
while running:
if some_condition_that_ends_the_game:
countdown = 60
if countdown: #decrement it once it's active
countdown -= 1
elif countdown == 0:
pygame.quit()
this doesn't use any form of delta time though, so it's not optimal, but it's dead easy
that would be less than a sec
i want to SEE DA BLOOD
well yeah
u dont wanna see the blood? when snake dies π
you'd just set it to be longer
using something like time.time() would probably be better in terms of actually timing it, or using the pygame thing
time.time() just givees u real time
yeah
u should maybe try perf_counter()
for this
thats more accurate
ig
but once u get it then what
probably
how r u gonna like start the time and utill the timer is going keep ruinng the shi
when it ends make running = False i think
maybe u shoul add 5 seconds to that
ughhh
idkk
what im thinking
check when the difference of the time when the game ending event happened and the current time is greater than 3 seconds
or the timer from pygame which creates an event
ohhhh soooo if
self.snake_is_dead:
game_ending_time = time.perf_counter()
yeah
then each frame you can subtract it from the current time lol
if current_time - game_ending_time == 3:
running = false
would this work
why u laughing π
thats rude π im js a guy
IM JOKIN nothing is rude
lol
oh yeah i should figure out how i wanna do my terminal module
i wanna try rendering a parallaxing scene in realtime
like this thing i did a few years ago, but better and more detailed
im not 100% sure how i want to render it (since i only have a background and foreground layer to work with, and i want to have effects like rain and snow
i also dont know how id implement additive layers
Does anyone remember who made the MS paint looking python terminal sorry
I'm trying to make an online multiplayer card game and I really don't want to code a website for that from scratch. Are there any websites or something similar that just allows coding the game itself
the easiest way is probably using godot. tho ive never used godot, ive heard good things from its networking module
otherwise u'd have to learn sockets and stuff
maybe ask the pygame-web channel in the pygame discord
does anybody have a good tutorial that actually explains opp well
I struggle to understand it when everything else is really easy
bro i really suggest to just go on youtube and learn pygame. Then just built games with it and you will get comfortable with oop since you will be working with classes quite a lot.
and there are also free tutorials on w3schools that explain everything well
https://www.youtube.com/watch?v=JeznW_7DlB0 this is a nice tutorial by tech with tim
In this beginner object oriented programming tutorial I will be covering everything you need to know about classes, objects and OOP in python. This tutorial is designed for beginner python programmers and will give you a strong foundation in object oriented principles.
βΎβΎβΎβΎβΎ
π» Enroll in The Fundamentals of Programming w/ Python
https://tech-wi...
@nimble spade yea I use it but most of the time I get errors then it takes awhile to find it cus its so dam weird or I gotta watch a tutorial to be able to implement it
opp is def the more weird part of this language like roblox Lua is very easy because their object orientated progrtamming is so much different and simple
but ill watch that video
you'd want a >= instead
My pieces currently, I got em working really well https://paste.pythondiscord.com/UUBQ
Mornin all o/
Now I can get the imports/loads out of there and send those images instead of loading them
That looks awesome!
Do you have a gh repo for this project or nah?
Not yet and thanks!
Cool little groups, just for capture areas https://paste.pythondiscord.com/R4CA
They're only responsibility, drawing those icons in the right places and the right order (though that doesn't really matter with my current setup anymore)
:incoming_envelope: :ok_hand: applied timeout to @dawn quiver until <t:1726716618:f> (9 minutes and 59 seconds) (reason: burst spam - sent 8 messages).
The <@&831776746206265384> have been alerted for review.
link pls
nah it's way better than it used to be
it used to be really bad
I made Flappy bird like game using pygame module but I don't know why my pipe are getting invisible
Can anyone help me please
<@&831776746206265384>
Please don't ping moderators for help
Okk sorry
Can you please tell me
Where I can probably find help
Like in which channel
#βο½how-to-get-help has a description on how to open a help post in the help forum
Ok thanks
this looks really cool!
what window library did you use?
none
yes
thx
well technically it's ansi and some unicode but you can do it without unicode
i wasnt quite as good at terminal rendering a year or two ago
why did you decide to do it that way?
cause its cool
it looks really clean now, I didn't even notice!
i honestly find it somewhat easier to do terminal graphics
oh course... silly mistake... I totally knew that... its like suuuper basic.....
its the terminal code to hide the cursor
also the rendering in that video is pretty inefficient since its doing each pixel even when it doesnt need to
dont want to do some opengl + glfw triangles? XD
gotcha!
i've considered it
i sometimes do pygame but i find pygame code to be kinda clunky
I hate to break it to you but I don't think it'll matter much given you are just printing to the screen lmao
huh I haven't touched pygame before
it can
np
doing each pixel individually vs just printing lines can change the speed a lot
my main bottleneck these days is the max speed the terminal can display stuff like in my gif player
gifs in the terminal sounds crazy
All functionality working, and I mean everything. Can setup custom positions, play them against the bot, reset the position and play it again. The setup mode is way cool now
windows terminal renders it faster but i didnt feel like changing it from the furry theme i have currently
Wow nice
How can I use both pygame and tkinter together in macos anyone have any idea or way to use both at same time.
Why would you want to do that?
some gui element prolly
oh btw how it works is i render all the frames to big strings with ANSI color codes for each pixel and then it just loops through them and plays each frame
i could probably try to optimize it some time but it's mainly just limited by how fast the terminal can display it
yβall Iβm trying to learn python any advice?
I've used tkinter in pygame, there was nothing particularly difficult about it but I'm on windows, may be different on mac. I needed the OpenSaveAsDialog and OpenLoadDialog or so, worked fine
um suddenly my folder for my graphics just wont work
I just remade one but even that one wont work I think this one jus kinda stopped working and its stuck this as its directory
I didnt even realize this channel existed
Welcome!
Thanks
Does anyone have a fast or just efficient way to rotate a 2d array by 180 degrees? My mehtod is working fine and all but I'm curious if there's some other way
like a vec2?
I'm just doing swaps for each row then for each item in each row
Custom objects in the lists
Like row[0], row[7] = row[7], row[0] and so on
like reversing the rows and columns?
Yeah
if its a python list I imagine the fastest way is to just reverse the inner lists then reverse the outer list.
Yeah, I might be able to do that now that I think about it, I know about reverse() but hadn't thought about it
you could always keep a rotated version of the matrix aswel
since they would share the same mutable objects
What about leaving it unchanged? You just access it in reverse order now.
It's chess board squares so it has to mutate when I flip the board
reverse itterators are generally pretty slow
So things keep moving to the right targets
Why?
After flipping if you are told to access the top left item it just remaps that index to the bottom right.
instead of rotating the data, why dont you just make the algorithm access the data as if it were rotated?
or would that require reverse itterating?
The biggest problem there would be going back to states that are already complete
well when you rotate the board are you going to keep a copy of the unrotated board?
You need track a bool for flipped in the state.
Because when a piee is moved by a bot, the board is immedietely updated
Whether or not the piece has arrived at it's target spot
Oh I tracll that
Come on now
You mean animation targetting?
Yeah, the bots moves are animated
But I don't want the logic to wait for the piece to get there
Upon flip all targets need to be remapped.
I must have the logic before the animation, so that all moves can be done in a while loop
So bot gets a move, I assign the piece a .target, mark the spots in the logic, and send the piece on its way
So target is already assign
ed
If flipping the board while the piece is moving, the target either has to move (my method) or be reassigned
The target position is reassigned / remapped. It's flipped too.
Yeah, so flipping the board at any time keeps it valid
Current position in the animation is also flipped.
you could try this at the start of a game:
def rotate_board(board):
board = board[:] #shallow copy the order of the rows
for i in range(len(board)):
row = board[i][:] #shallow copy the order of the columns
row.reverse()
board[i] = row
board.reverse()
return board
board = [...]
rotated_board = rotate_board(board)
``` I havent tested it but it should work. then you can just use whichever one you need since both boards share the same mutable object references.
that way you only need to reverse everything once.
yes, just flip then mutate the objects, since objects are mutable anyways
or objects are by-reference in the terms of other languages
I think all of my references to it are now in the form of [row][col]
I had some earlier methods that could find a square by string, I'd have to check to make sure I'm not doing any of that anymore, made a lot of changes lately
You can also have a function that takes the indices and gives you the remapped ones based on if it's flipped. For ergonomics you can use a class with dunderscore getitem implemented.
better to just have a property that returns the correctly oriented board.
I could fairly easily now flip indices too, might need another method to reassign targets though
Reassign animation targets (vec2s) is actual rotation or two mirrors.
something like:
class Game:
_board:list[list[object]]
_rotated_board:list[list[object]]
rotated:bool # False is _board, True is _rotated_board
...
@property
def board(self):
return self._rotated_board if self.rotated else self._board
Then you dont have to worry about wether or not you are using the right board orientation
Well, my targets are vectors but the point they are targeting is the center of a pygame rect (also a vector if I need)
And I can easily flip a vector
since you will always access data via board_instance.board anyways
Yeah you just need the vector tails to be on the board center. Then it's just negate x and y.
yep
My piece movement is stated so the state will continue until the target is reached while other things continue updating as usual
My idea is like this but you implement getitem so you can directly do: board[row, col] and it just remaps it in the impl.
why not just use property though, its easier
It's about the same.
Changed the class to Game
I'm taking this in atm...
Because that would be nice
The only issue I might see with this is it wouldnt let you use list methods and operations on the class without wrapping them yourself.
Yeah you need to implement such things then. Since you are basically making a custom 2d array type with a special transpose thing.
Very OOP style.
I find that when some type is core, it's worth the effort to make it nice.
You could have the property too.
Because of ducktyping the interface should be about the same unless you need extra methods.
But then you can just extend list if thats the case and use that class instead of a 2d list.
Maybe I could flip the pieces instead of the board
depends if you need to flip it back and fourth
Like each piece is a subclass of Piece so adding a method for any piece to swap sides would be rudimentary
Board flipping in its current state...working
nice
Since it works, what I'm up to now is just refactoring a little here and there, it never stops, and rethinking
And you both gave me things to think about, so thank you
no problem
I think my next play will be trying to flip pieces instead of board
That will be much easier
I think
I dunno, I'll make a backup, lol
The only pieces it matters to are pawns since they're the only directionally moving pieces
But they alread yhave methods to switch drections
def flip(self):
old_y = self.current_spot.y
new_y = 7 - old_y
old_x = self.current_spot.x
new_x = 7 - old_x
new_spot = self.board.spot_array[new_y][new_x]
self.rect.center = new_spot.rect.center
self.current_spot = new_spot``` quickie piece.flip()
There will be details to work out, cause they not only need to flip but reflect
I dunno, I think this is working fine
Yeah, works great, wayyyy better than mutating the list
So I decided on a whim to make a game.
Over a week later and I haven't even intialized the window.
Just been writing code and learning.
Small steps will lead to bigger steps, keep it up
I do have some experience with game making. Not a lot but some. This is my first time using a framework and not an engine though. It's been fun.
I decided I wanted to experiment with something intense, so I'm making a bullet hell.
I mean why not
I started a game 2 weeks ago and havenβt even thought about adding ui. Itβs just terminal rn. The hard part was ai move evaluation.
You got this, donβt worry about the process. Itβs about learning!
i added scrolling
how do i improve scrolling
Looks good to me, what were you hoping to improve?
make it so that scrolling is only activated when player is at the center
Like how to keep the player centered vertically?
yeah
no
it already did that
like initially the player is at the left or right and it doesn't scroll
only when the player is at the center does it start scrolling
did it
it doesn't work that well
Im not 100% sure if this is where I should ask but, In my beginners python uni course, we have been instructed for our final that we need to make a ''game'' or "some sort of generative tool", however we are STRICTLY limited to what is taught in class (image attached from syllabus). I have 3 weeks to decide on what to do.
I was wondering if anyone had any game or generative tool suggestions to push me in the right way. I have been suggested black jack however I have already overheard many other students deciding on this game to recreate. Any suggestions are welcomed. Thank you for your time!!
If this is the wrong channel to ask please redirect me and I will delete my message and move it accordingly!
Tic Tac Toe
I don't even have any terminal. I'm just building the framework and learning how the tech I'm using works.
Othello
With this you could also realy impress your teacher with a simple Alpha Beta Pruning algorithm to have it be single player
I really like data driven programming so I've been setting things up so I can write game objects in TOML.
That part is almost done.
So there are different libraries to make python games. I've heard of pygame, pyglet, and arcade.
Are there any other ones?
Like I'll stick to pygame for now with the idea that I can port my game to a different library if I need to. I'm learning a lot just from this.
also 2D: https://electronstudio.github.io/raylib-python-cffi 3D: Panda3D
and both can work on web like pygame-ce
CE?
So... It's a more recent and still maintained fork of pygame?
it is indeed maintened and by a number of people ( including me )
From what I understand, pygame more or less rules when it comes to small scale games as well as learning the ins and outs of game programming because it leaves most of the work in your hands?
yes pygame same as Panda3D does not "get in the way" imposing some framework
counterpart is you have no ready made interface to make a game like scratch/godot
But I do need to keep in mind that it uses software rendering.
I've played with a few game engines, pygame is, at least for me, more fun
which open a wider market to your games
It is both a boon and a limitation, I do understand.
Work is happening on using GPU in pygame-ce...pygame.Window
What is the best way to deploy the game? Both for executable and for web?
dunno i only do web and wasi, cause it's my field of work/research and don't have much time to make games. You should ask on pygame community discord people are making multiple target release on itch
but code side, you can keep the same for desktop or web
only mobile is a bit different because no keyboard and multitouch and maybe other sensors
in that case you can handle multiple events types like in that page https://pygame-web.github.io/showroom/pygame-scripts/org.pygame.touchpong.html
Ok so what is the best way to deploy for web?
or pygame-scripts like this one but it may be not easy/efficient to bundle assets with that way of publishing
I know pyscript. And by know it, I mean I know how to use it.
But how do I set the display of the game to a DOM element?
when using pygame-ce you should have a dom canvas element with id=canvas
SDL2 should find it automatically, if not then look at pyodide documentation abouts canvases
note that if you have music background in the game you should use pygbag instead of pyscript
or write some js to load music
Do I need to uninstall pygame if I want to install pygame-ce?
yes it is a 1:1 replacement
But other than that, it seems it's just pygame, so it shouldn't affect my code.
only if you are using physcal keyboard mapping, but that is kinda weird in both and advanced usage
I haven't gotten to user input yet.
pygbag handle both ways anyway
Oh so. Pygbag uses asyncio, but I can still control the event loop?
yes it is stock stdlib asyncio, only exception is some futures that involve threading would not work
but unlikely to happen in a game
Like run_in_executor calls don't work?
indeed
Can I use web workers instead?
I mean whatever pygbag lets me use.
you can do what you want in pygbag you have access to everything, unlike pyodide/pyscript
you can hack your way when you need it
So I've been reading the pygbag docs. So I can install it like any python package, but I don't need to import it or use any of its features. I just run it, and then it just packages my game along with the runtime?
That's a lot less work than setting up pyscript, lol.
Am I doing this right?
class player:
#===[player]===#
#player = pygame.Rect(200,200,200)
player_speed = 1
health = 100
stamina = 100
mana = 100
inventory = {}
#===[weapons_use]===#
can_use_bows = True
can_use_swords = True
can_use_magic = True
#===================#
#===[effects]===#
buffs = {}
debuffs ={}
#===============#
#=============#
```
My apologies
no need for a lot of comments
if it gets too complicated create seperate classes and use that
But am I doing this appropriately sorry
I use those comments to separate it into chunks so I know I have to make too many classes because I still want to make it easy on myself because I'm not very proficient with classes maybe dictionaries but that's stretch my apologies
you should get comfortable with classes
But this correct?
I think what Notenlish is trying to say is that simply saying yes or no isn't constructive.
The first question I'll ask is, does your game have multiple players?
Second, is a player the only thing that can use weapons or have buffs and debuffs?
Or have health?
Are players the only thing with a speed value?
Because if there are multiples of a thing that can have these attributes.
Then no, this class is only going to make things more complicated for you.
Or conversely, if you only ever have one player, you need to think if you need a whole class for it (you might, but you still have to think what attributes a player might share with other things).
It's like, imagine a car. It might be red, or green. It might be a two seater or a five seater. It might be a mitsubishi or a subaru. But none of these things stop it from being a car.
Well there's going to be monsters that share the health and other attributes but different I also plan on playing portals so that wouldn't be in a class in itself to teleport the player
I'm not sure how to explain this to you but you should get some practice with what classes actually do.
I read everything and my coding book on classes and follow the examples I don't see what's wrong sorry
Did you practice with it?
It's not so much a problem of "what is wrong".
I just do not get the vibe from this class that you have a lot of experience with using classes.
For starters, I'm seeing a lot of class variables, some of which are mutable, and not a single method.
Also, I cannot easily infer how you are using the dictionaries.
Is it like, using the item as the key and the amount as the value?
So if you do player3.inventory['potion'] = 3
Now all players will have 3 potions.
Because you defined the inventory at the class level rather than the instance level.
And if you then do player2.inventory['potion'] -= 1
Now all players will have one less potion.
Even the ones that are immutable just don't look like they should be class variables, they should be instance variables.
Why is player_speed named player_speed and not just speed?
Also, if the player is represented by a Rect, why not just inherit Rect?
class Actor(Rect): #capitalize a class
def __init__(self, rect, speed=1, health=100, stamina=100, mana=100):
super().__init__(rect)
self.speed = speed
self.health = health
self.stamina = stamina
self.mana = mana
self.buffs = {}
self.debuffs = {}
class Player(Actor): #an actor with properties specific to a player
def __init__(self, *args, weapon_usage=None)
super().__init__(*args, **kwargs)
self.inventory = {}
self.weapon_usage = weapon_usage or {'bows', 'swords', 'magic'}
player1 = Player(weapon_usage = {'bows', 'magic'})
player2 = Player(weapon_usage = {'swords'})
#etc...
This more or less the intent of the class you wrote, but put the way we normally would do it.
are there any level format for tile-based platformer
that supports python
and has a gui editor
its for pygame tho
And there's also one for doing python.
If it's pygame then uh.
Well maybe there is one I really don't know.
My own question: Are pygame surfaces or their underlying buffers picklable?
Tiled?
pygame surfaces themselves arent, idk about underlying buffers
yeah
based on tiles
idk if that matter
tho ive heard u should avoid pickling at all times
no i mean
theres a software called "Tiled"
it exports the tilemaps as .tmx files, which u can load with python into pygame
what package do i have to install to read tmx
ok thx
What you should avoid is unpickling data you don't know the origin of.
oh ok
also it may not be cross platform/cross version , this can be annoying when updating a game
This happens with serialization in general.
Thank you I'm sorry
Do not apologize for wanting to learn things.
I am was just trying to figure out how I can put everything in one self-contained area that's why I do not weird comment ing just in case my code goes too far on a specific spot or if I need to put in a specific for you definitions I can write deaths because I don't really get much sleep and I want to get my projects done I just have a hard time with learning certain things that I haven't already learned I do understand pie game more than numpy sorry
For playing game is there a way of adding achievements sorry
Truly I am
Please do not be.
If people not knowing things was a problem, humanity wouldn't be able to exist.
Also, I respond to you because I want to help you, so being apologized to for doing something I want to do feels like a mismatch.
Is there a way of making achievements?
You can make anything you want.
If you mean steam specifically, there is an API for that.
In game acevments
Once again, you can make anything you want.
hi
class Cloud:
def __init__(self, game: Game, pos: List[int]) -> None:
self.image = random.choice(
(load_image("clouds/cloud_1.png"), load_image("clouds/cloud_2.png"))
)
self.pos = list(pos)
self.game = game
print(self.pos,"is the initial")
def make_move(self) -> None:
self.pos[0] += 0000.5
if self.pos[0] > self.game.screen_width:
self.pos[0] = 0
print("current position is ",self.pos[0])
def draw(self,surface: Surface,offset: List[int]) -> None:
surface.blit(self.image,(self.pos[0] - offset[0], self.pos[1] - offset[1]))
def generate_clouds(number: int,game: Game,max_width,max_height) -> List[Cloud]:
clouds = []
for _ in range(number):
pos_x = random.randint(0,max_width - 1)
pos_y = random.randint(0 ,max_height - 1)
cloud = Cloud(game= game,pos=[pos_x,pos_y])
clouds.append(cloud)
return clouds
i am trying to make clouds for my platformer game
i was following Dafluffy on yt but thought i can continue from my own after a point in the video
now i have added like the clouds but the clouds gets moved to the center that is above the player
when it hit
self.pos[0] = 0
print("current position is ",self.pos[0])```
is this because i did pygame.transform surface as told in the video
the clouds etc shouldn't really have the game as their attribute
I kinda disagree, I find having a reference to the game at all times very helpful so I can access whatever I need from anywhere
however I usually use that to avoid passing arguments in too, like in this person's draw method, I would just have self.game.screen rather than passing in the surface
yo
can one of yall help me
?
i posted the issue in help
if anyone wants to check this out
I sometimes pass the entire main object to things, usually makes more sense than passing multiple other objects from main
My chess has just one or two small remaining issues. Also, I think the code is good but main is too long at ~1800 lines, every method is necessary but I don't like it that long
I could do some refactoring to the ui, since it is now pretty well set in stone and not changing drastically
Like I have 150 lines just instancing buttons (with vertical args one per line)
Hi
Hi
Arrows too! Nice, so one can look more closely at lines and things, or anything you want a line for, they disappear on the next moved piece
Couple of tweaks and we get colors
Right mouse down sets the from square, right mouse up sets the to square if there is a from square
And creating a new arrow in place of an existing, deletes them both, so they can toggle if necessary or just disappear on the next move
Now can highlight squares in four colors and draw arrows in eight
The board has five layers now, the base and four overlays
Woah. The arrows and the highlights look nice!
Current move spots, those shown when a player picks up piece, showing safe squares. Last move spots, the from and to spots of the last move, hint spots, those shown when clicking the 'Show Hint' button, and the highlight spots
Thanks, yeah kinda pointless but streamers appreciate the functionality over at chess.com, so might as well replicate it
Nothing, just variety
No reason to have multi colors, really, but since it's easy enough, why not
I made a little sprite to show the currently selected color, using num row keys 1-8 pops it up then it alpha fades to nothing then dies, just to give an indication that a color was selected and which one
Here it is for pressing 4, orange
Pops up and fades out quickly
Here I run it through all eight colors
And just left click to clear them all
In playing the game, I never use it, or haven't really had the need to use it, really only useful for commenting or describing some position
But chess.com has it so why not and it was pretty easy to code but still good practicing
It's kinda messy though, rotating images in pygame.display does strange things to rects that I haven't worked out beyond just making the adjustments depending on direction of the arrow/vector
I feel like it fades out too fast π€
Yeah, I agree
I mainly went for having it out of the way, haven't really tweaked the behavior yet
I mean out of the way quickly
I see I see
Like give it a second or so before it even starts fading
Yeah that'd be a better user experience I think
I have the highlights identical to chess.com, just rmb to highlight in orange, do while holding shift for red, while holding ctrl for green, while holding alt for blue, and that's also how they do they arrows, just holding those keys and having only four colors to choose from (plenty, even more than enough really)
So the little sprite to show that many and having that many might not be permanent
I've made and scratched a few dozen sprites along this chess game path so far
Just looking back at the changes, amazing, it's not even the same thing any more as when I started, like vastly different
maybe put it on a really stretched or modified sin curve and physically move it on / off screen
I like the off screen ideas, keeps the ui clean
With a 1second delay before fading
class ArrowColorSprite(pygame.sprite.Sprite):
def __init__(self, image, group):
super().__init__(group)
self.image = image
self.rect = self.image.get_rect(topleft = (WIDTH-180, 5))
self.speed = 100
self.alpha = 150
self.image.set_alpha(self.alpha)
self.delay = 1.0
self.timer = 0
def update(self, dt):
self.timer += dt
if self.timer >= self.delay:
self.alpha -= self.speed * dt
if self.alpha > 0:
self.image.set_alpha(self.alpha)
else:
self.kill()```
So I can control the speed of the fade too
the beginnings of a doom style 3d renderer
Does anyone wanna help with my project, Terra-Tactica? It is a top-down strategy game that is entirely in Python.
Our in house OpenGL graphics engine, is also in python.
Yeah the new images get bigger when you rotate them
You need to account for the new size and use a drawing function with origins to handle that
You probably already did that though
I'm just fudging the rect tops an lefts per vector directions, it works ok but it's not perfect
hey I am making a game can someone critique it ? https://saintelgrandosmokio.itch.io/puzzlegame
speed is to high to time this decently
critics ? well got one :p not Python !
Is this your game?
Doesn't seem like it
Have you pip installed pygame
Looks like gpt code copy pasted expecting to work
Which should if they installed pygame
no it was of the person above
Oh
Can anyone help me on this project i got
Yeah lets see it
but if they havent installed it, it'd be a module error
Does anyone know a good level editor of pygame ??? 
if making a side scroller , Tiled can do the job eg https://pmp-p.ddns.net/pygbag/tiles/tiled.test/build/web/#sf2/map.tmx
I'm trying to make isometric view point, will it work??
look at pytmx documentation and make some tests
Thanks :)
there are a few isometric tileset in tiled samples, but iirc i never tested them
let us know
Think I'll work through using vectors for all points of my arrows. Get vector from to_spot to from_spot. move it to to spot. copy and normalize two of them, rotate one of the copies 30 degrees and the other -30 degress and place their tails at the to_spot. Giving three points to draw the arrow head precicely at the center of the to_spot and do the same for the tail of the arrow for the line width
Well, here the vectors, nvm the green arrow, but the red lines forming the arrow are all vectors relative to the target spot center
Connect the dots of the red lines and it's a proper arrow shape just not filled in yet
pygame.draw.polygon() on a large surface would do it
All worked out, I think this method can keep the arrows perfectly aligned to the target spot center no matter their angles
Cause I'm no longer rotating a surface and placing its rect
Another way might be tryna rotate the surface and instead of placing its rect left and top, place its center at the vector midpoint
Oh that second idea actually works really good
Good enough to call that done
And my Arrow class ```py
class Arrow(pygame.sprite.Sprite):
def init(self, color, from_spot, to_spot, group):
super().init(group)
arrow = pygame.Surface((29, 29), pygame.SRCALPHA, 32)
pygame.draw.polygon(arrow, color, [(10, 0), (27, 14), (10, 28)], 0)
vec = Vector2(to_spot.rect.center) - Vector2(from_spot.rect.center)
image = pygame.Surface((vec.length(), 29), pygame.SRCALPHA, 32)
image.blit(arrow, (vec.length()-28, 0))
pygame.draw.rect(image, color, (0, 8, vec.length()-16, 12))
angle = vec.angle_to(Vector2(1, 0))
self.image = pygame.transform.rotate(image.copy(), angle)
new_vec = vec / 2
new_vec += from_spot.rect.center
self.rect = self.image.get_rect(center = new_vec)```
See how I solved that?
That's working fine
run these commands one at a time, it should fix it
pip uninstall pygame
pip uninstall pygame-ce
pip install pygame-ce --force
Hmm, pygame.transform.rotozoom() gives a better rotated image
Zoomed way in with rotate()
And with rotozoom()
Cleaner edges with the latter
I use external tools to scale images...most of the time. Like if it's anythng but a placeholder, I'll just scale it in gimp and load that instead of loading and scaling in pygame, though pygame scales just fine with no interpolation
Looks like rotozoom() is using aa on the edges, definitely wouldn't want that to scale pixels
there is a smoothscale function is you need aa
@limber veldt theres also a draw.aapolygon feature thats planned to be added to pygame-ce btw, you might want to use that when it comes
Absolutely will be checking it out
idk if its yet approved but the pr is there
I'm usually on the latest ce
I've been kind of keeping an eye on the pygame.Window development too, already played with it some and it was great
Rotating in that is essentially free, just tell the renderer the image is rotated
On my list of things to learn, even basics, maybe using moderngl or so
I've been pygame'ing for a few years now, and I'm still always learning new stuff or new ways to do the same stuff
me too
I have a list of pygame snippets/notes that I update whenever I see something useful
Can anyone join a call with me and i want to present my code for practice
Slight redesign for arrows, wider, offset, shorter than spot center to center
Weird, but kinda cool looking, just playing around with gimp
Woah, that is cool
is that animated
Nah, just a still image
Reminds me of Fade from Valorant.
I need to work changing some spot images into my theme setter. So far, I have two sets of those for safe squares and from square, one light colored, the other dark. For boards like the one I shared above, I think more themed colors for those things is kinda necessary
For that board, blue versions of these would be good
Themes are just four images so far, maybe each should also have its custom spots in the same folder/dict
I have to google that for reference...
Oh one of the characters having a blue theme, very cool
And there's the functionality with some placeholder spots, now making more spot colors
Also going to option-ize the rank/file labels, meaning they have to come out of the board images and be their own sprite(s) with a toggle in the settings menu
the channel in general? no, sst just sends his progress and a devlog of sort here
probably something with ur projection code unable to handle cases where the projected point is "behind" the camera location
Yeah, all the damn time. It's useful for me to rubberduck sometimes
Like that idea last night of aligning the arrows to the midpoint of the vector, that came to me while I was typing the other idea
And implemented label toggling
Took a while getting all new images and taking them off the boards
And coloring them accordingly
Nice!
May I ask a question on building a house cell for a game?
ask away
How can I make a crafting system and the spawning system the pentaton variables
Because I want to make spawners that you can change the difficulty on easy medium and hard but to activate the meaning of key which is single use so you have to get lucky and I've been finding it including foraging etc
hey guys, im struggling with random nums, I want my code to generate a different num to dictate my enemy "AI"'s damage but it only generates a random num once and doesnt do it again, im using random.randrange. i know one way to do it is to get write a function but im using classes so idk how to impliment it, heres my code:
AdamSmasher = AdamSmasherAI(name="Adam Smasher", health = 500, Damage=random.randrange(15, 30))
this is a global variable btw
ik this isint game development but i just wanna share this
it puts mods into mod folder ig
generate a new random damage value each time the enemy attacks
maybe solve problem
New arrows for 2squares x 1square vectors
Again replicating chess.com arrows
Those arrows are using an image, not drawing it just rotating and flipping accordingly
hmm taking a lot of inspiration from chess.com huh
You can also look at lichess for some good ideas
Yes, their way works great and is quite popular, it was inevitable
Pretty sure lichess arrows snap to grid somehow... but chess.com's method is probably easier
I'll check it out, thanks
Oh that is neat, I like the previewing
But it has bugs or glitches
Oh wait, no, it only allows arrows on legal moves
So like 2x1 is fine, 3x1 or others are illegal and won't arrow
yea
helps because you don't want to make a random arrow that's illegal
and the grid feels nice too
Making the conditions for disallowing illegal arrows is straightforward, just scrutinize the vector, if x and y are equal or one of them is 0, it's allowed
And make one exception for 2x1s
If abs(x) and abs(y) that is
Can adjust hue too (with sat and val staying at 255)
Just drawing a rect under the board and blending the board.blit
Just experimenting, saw the functionality at lichess and wondered how I could implement. I'm not sure my implementation is correct but it is at least working
And a little hue slider
Not permanently there, placeholding
Just to see if I could, not sure I should use it, I have a selection of colors already
So...do I make a color wheel or two more sliders (one for saturation and one for value or luminosity) or skip it, not sure it's very useful functionality
color wheel feels more intuitive foe the average user I think
or the grid system with a single hue slider like Ms paint uses
fixed it, here are 2 progress recordings
Ooh cool
its not even remotely done, but i got some of the 3d geometry stuff down
gonna fix up texture mapping soonβ’οΈ
mostly did it to check the performance
Isometria Devlog 49 - New Graphics, Casey The Doctor, Biome Keys, Sleeping, and Items! https://youtu.be/0e29EdJs9Tc
Wishlist and play the Isometria demo here: https://store.steampowered.com/app/2596940/Isometria
https://bigwhoopgames.itch.io/isometria-demo
In Today's devlog I show you the latest improvements to Isometria including some new tile art I've been working on. I also added Casey the doctor and a new NPC dialog UI. New keys that will unlock biomes ...
I made a dumb little timewaster:
https://github.com/lemonsqueezycreative/bombsquad
upcoming map editor
as in ones like from the game portal?
Yes
Color wheel progress
The wheel itself is kinda working
Using pygame.smoothscale() to make the gradients
Make a 2,1px image, blit one side with start color, other side with end color then smoothscale it to the desired size, in my case, from 2,1 to 109, 1 and repeat 109 times slightly decreasing the start value each time while moving down the image
The BLEND_MULT that new image with a white triangle, viola, gradient triangle
I'm actually how do I make interior cells so I can run simulations using pygame
!rule ad
That's not on topic to this server and is also against the rules. Kindly remove the message please.
Nice
Yeah, now I gotta brush up on my scalar projection code, I need one
I need the distance at a right angle from the direction that triangle is facing
Some feedback for the board:
- the contrast between the black pieces and the board isn't really quite strong enough imho
- I think the design is great, and could probably be better if it stood out a bit more
- I noticed the rank numbers are placed on the right, which is a bit weird for me as usually it's on the left
I agree on that first and second point and for the third, yeah, I realized how easily I can put them anywhere now that they're their own sprites
I tried darkening the black pieces some, but then they were too dark for the dark squares of the blue lava board
On the lighter squares, the darker black was fine but on the dark squares, too dark, so the board needs more contrast
I think you'll have to find a middle ground for the two boards... or not, because it's still visible and it does work.
Yeah, just a matter of finding the right range between the two colors
Is it possible to make a house cell using pygame
Everything is possible, you know that
Color wheel complete
hi guys , im looking for game developer team for a free open source 3d project in python.
(im developer of this engine and i need some external help.)
https://github.com/hamedsheygh/supePY/releases
i even create a simple game with my game engine (kinda doom / minecrfat style)
i create a full game using my OWN python game engine based on ursina.
my discord channel:
https//discord.gg/yMugmymnYz
add ":" between https and //
why not just Panda3D ?
ursina is less portable
i just want to focus on windows for now
i will try panda later
plus panda is harder to code
imho it is harder to port urisna than coding panda
i dont want to port or add other platform supports to it.
all i want is some help to add much quality as possible.
but you want a team ?
you mean port the source code?
you should have precised windows only then
yeah i know
i think if you don't target web and mobile for a game engine you won't get much traction
you are true but this what it is.
plus you can convert the code later to panda because i open source most of stable versions, (i mean the guys who madly wants other platforms support.)
ho now you want a team for a mostly open source game engine
lol i said at first.
no you said "free open source" not "most of stable versions open sourced"
its because of not letting some random kids making toxic things.i will make it fully open source once the job is fully done.
you should then put a license in that kind https://github.com/PythonTryHard/winamp/blob/1e76df7e599ec5b1362869a48122af7a36548e64/LICENSE.md and maybe avoid using "free open source" as an intro thank you
it had so many restrictions than i thought but thanks!π β‘
btw for anyone reading this it is perfectly ok to make closed source engine with Panda3D and Ursina because both are MIT licensed
one last question
so you mean its not ok to create open source 3d game engine with ursina or panda?
i said the opposite
you can do whatever, but i don't think that covers for announcing you here as "free open source" for grabbing help
and at first it was really open source and it will be again open source very soon when i done
i just dont add 20 lines of code and without that you have less features , its not that much.
i dont want to use panda 3d again!π π€£
Finally figured out a dungeon generation algorithm
nice
@minor cloak hi, im going to elaborate about my game.
first upmost, the game are heavily inspired from a game named Exp Minima, and it's creator @steel cypress(frazerbw) props to him.
now, the game are that common text rpg game in this github, we are planning on remaking it on Godot, as it's very light and easy to use(they say). the game are kind of "please help me! i will give you reward if you do!" kind of thing, and mostly focus on getting stronger. however we haven't even officially made it 'Complete' so it subject to change. the rest are pretty simple fighting game, it's a quick gameplay for now we're planning
oh ok cool
yeah it's kind of boring, we'd like a simple game before thinking of making a bigger game
the biggest problem for now is the fight mechanic optimization
Can you explain more on that?
well uh
the monsters damage are scaled based on the monster's HP
monster hp // 3
then there's fluctuations dmg where it's either -2 or add 2 damages
it'll be very unoptimized if the player has reached high levels
high player HP, low monster DMG
maybe i should scaled it on player HP instead?
How do you calculate for damages?
# attack
monster_dmg = current_monster.dmg
if damage < 0: # checks if -1 (defending)
monster_dmg // 3
fluc_dmg = monster_dmg + random.randint(-4, 2)
player.hp -= fluc_dmg
print(f"{name} dealt {fluc_dmg} dmg!")
time.sleep(1)
I mean like, you could have a special monster that has extremely low HP like 10, but very high defense. So much so that no matter how OP damage the player can get, it will always inflict exactly 1 damage to the monster. But all the player has to do is hit the monster exactly 10 times and its K.O.
oh wait i just noticed my friend's comment on <0:
yeah and monster_dmg // 3?
Correct me if I'm wrong, this is not GDScript, right?
i have absolute no idea about that, even though i edit that
originally, it was monster_dmg = current_monster.dmg // 3
however because of print issue i change it to monster_dmg // 3
print issue.... it's really an overlooked mistake
if it looks like python - it is python
no
gdscript is noticeably different from python
this is still pure python
imo it's like a C
everything i will talk from now on is purely python, for the godot game it will be later after I've done optimizing it further
just to avoid misunderstanding
oh ok so you've not decided to continue on to Godot then?
still learning on tilesets and sprites
it'll probably take another 3 months
we're working on this game in github probably uhh
2-3 month ish
Is it on Github? Share the link?
it's on my profile
lol at the commit messages 
ah... you're putting all of your various projects all in one repo...
don't mind me.... i don't know what to type there
it's just one project
the others are my very old test message
i meant code
its not...
You have Calculator.py, you have crypted.py, etc
Outside of the Game folder
yes, crypted ks just a test
But still in one repo
its a mess.
but that repo is specifically for sharing my codes and all
I'm quite proud at my introduction code when i was freshly new
xD
You should really look into just having one exact repo for just this game project. You can leave this current repo as is but make another just for the game
don't worry I'll change the file to a different repo
after the game officially completed :D
okie dokie
because copy paste all the files are painful ngl
unless i can copy whole folder...
wait.
i can do that
SMH
π
lmao
thats a good start at least
what do people put in commit message btw
i use the github desktop and it always requires me to type something, it's painful to do
Reasons or what changed usually
But what does it mean?
aah
well i mean there's only two contributors in the code for now
me and my friend
it's not that big
commit 1: Changed player defense
commit 2: Nerfed enemy attacks
commit 3: revert commit 1
commit 4: optimize player damage
commit 5: revert commit 2
etc
we always communicate each other out to tell what's changed what's removed what's improved
Do you practice git workflow? Like make feature branches and create pull requests?
my git desktop commit every commits tho
what's that-
i mean someone did try to pull request
Yeah you should really learn how to use git properly, otherwise its just Dropbox or some other cloud syncing drive. https://learngitbranching.js.org/
Anyone want my hsv color picker? https://paste.pythondiscord.com/NY4Q
I halved its size from last time
Now only 100x100px + guages
The only specific thing in it in coloring the underlay image that I use under my board, but one can use its get_rgb() method to get its current color
cool
well im still looking for game developer team for a free open source 3d project in python.
Thanks and good luck with your 3d project
β€οΈβπ₯
Put in a sliding panel, keep it as an easteregg with no button and only a hotspot? Or draw a button...hmmm
Also a help panel, I'm not yet sure what else I'll put in it but there it is
oo looks good the texture mapping is much better
does look like theres some weird stretching happening though
Oh hell yeah, much smoother
I just wrote a save/load system that auto-loads your theme, board, and color settings
I could use a couple more buttons inside panels. One in the color wheel panel for saving the rgb and another in the settings panel for saving board and frame choice
Even better, put the wheel in the settings panel and save all the settings from there
And now saves all those settings when clicking that Save settings button and auto loads them on startup
might consider those colorblind people
i can barely see the pieces
I'm not colorblind, just deficiency
Yeah, that board has issues at dark hues
The black pieces are either too light or too dark
make black border for white pieces, and white border for black pieces
that should helps a lot
or at least something that's not too noticable but still makes the pieces visible
I also have these pieces
looks ugly, but works
Which do look much nicer on that board
i would go for that
just put some little touch on the details to make it more pretty
Thanks for the feedback

or, honestly make it like a basic chess, and make option for the custom theme
Yeah, that's what it all is, those I've been showing are all options
i see
it looks fun, it's not like GPT who used 4th dimension ability right?
Nah, I can beat it and I'm not great at chess
hmm i see
It's Stockfish, though I don't have any bots at its highest skill level, it still plays really good at the high levels I do have
is your game online or executable file?
Python+pygame
how would you make it available for others?
Sharing source
pretty much executable file ig, not literal .exe
It's open source, or will be when I eventually upload it
It's cool cause it can play bot vs bot too
I'm thinking it's pretty much finished, just gotta package it up and upload to github to share
Clean up some files here and there, some code too
One would have to download and extract the stockfish binary, because I won't be distributing that
But there's nothing to that, just download the file from their page and extract it then point code at it, oh and also pip install stockfish
Like so in the code ```py
self.stockfish = Stockfish(Path('stockfish', 'stockfish-windows-x86-64-vnni512.exe'))
self.skill_level = 1 # default```
That's for the easy bot
I'm not sure if chess.com can play bot vs bot directly, it can if you keep switching player every time it's your turn
Mine can also do that
Wow cool, I found how to change color of a surface while preserving its alpha! All those Ls are green images
It's two lines
self.image.fill((255, 255, 255, 0), special_flags=pygame.BLEND_RGBA_MAX)
self.image.fill(color, special_flags=pygame.BLEND_RGBA_MIN)```
anyone for help
https://paste.pythondiscord.com/KXFQ All arrows now using an image
I mean a loaded image, instead of creating them on the fly, just crop from an image
