#game-development

1 messages ยท Page 35 of 1

manic totem
#

and its doesnt work

#

wait

#

ok it work again

#

ok something weird happened

#

i try to move an object but instead of just moving its just keep adding more object to the screen

#

why is this happened i thought i know how to do this

#

you use pygame.display.update() to solve this issue right

limber veldt
#

You use that once per frame to redraw the entire screen, not to update moving things

manic totem
#

oh shit

#

how do you update a movement then

limber veldt
#

By changing where you draw them

#

More specifically and also more generally, by moving the rect where you are drawing it

manic totem
#

oh

limber veldt
#

Like: Clear screen, update positions of moving things, draw everything, update the display

#

If using a background image, draw that instead of clear screen

manic totem
#

ah ok

#

im getting alot more understandable about these now

limber veldt
#

My main loop in the chess game ```py
def run(self):
while True:
dt = CLOCK.tick(FPS) * 0.001
pygame.display.set_caption(f'{dt}')
self.get_events()

        self.draw()

        self.update(dt)```
#

There's a lot happening in each of those methods but that's the flow, get events, draw, update

#

Now maybe I implement arrow snapping using these new arrows, they'll just need an update method along with their __init__() methods

limber veldt
idle plinth
#

Do you guys recomend me Roblox to earn money?

#

Cuz people say Roblox is good to earn money, innit?

limber veldt
#

Oh much cleaner code than I had ```py

def drawing_arrows(self, dt): # state
    if self.init_state:
        print(f'entered {self.state}')
        self.init_state = False
        pos = pygame.mouse.get_pos()
        from_spot = self.get_clicked_spot()
        if from_spot:
            print(from_spot.filerank)
            self.from_spot = from_spot
        self.arrow = None

    buttons = pygame.mouse.get_pressed()
    if not buttons[2]:
        self.set_state(self.last_state)
        for arrow in self.arrow_group:
            if arrow is not self.arrow:
                if arrow.from_spot is self.arrow.from_spot and arrow.to_spot is self.arrow.to_spot:
                    arrow.kill()
                    self.arrow.kill()
                    return
    to_spot = self.get_clicked_spot()
    if to_spot is not self.from_spot and not self.arrow:
        self.arrow = Arrow(self.board, ui_images['arrow90'], ui_images['arrow'], self.arrow_color, self.from_spot, to_spot, self.arrow_group)
idle plinth
#

yoooo

limber veldt
#

Hi

teal cargo
#

Seems like you were able to implement my idea!

limber veldt
#

Pretty nice yeah, I can usually implement most things I see, lol

#

Didn't need to change my arrows too much, just put the arrow making in an update() method, so they can be redrawn in realtime

#

Along with a little logic, but nothing too difficult

teal cargo
#

ahh, i see

limber veldt
#

All three of your ideas, but the first one was kind of already done, the pieces shown lately are my originals

#

I have two sets, maybe more eventually

limber veldt
#

Really cool how there's a way to fill a different color on an image, changing my green arrows to any color

uncut dove
#

fixed that now

#

tho it does stretch if you make walls tall

slow copper
slow copper
#

Honestly you can say the same to game dev outside Roblox too

idle plinth
slow copper
idle plinth
#

i know, Lua is cofusing

slow copper
#

lua is pretty similar to python

#

but it does have some wierd stuff tho

#

like array index starting from 1

#

funny stuff

uncut dove
#

you have to be pretty skilled at making games, and if you are good at making games you should rather work for someone making a proper game

limber veldt
#

Now not only restores the rgb to the blend mode but also the h, s and v, updating the color wheel dots and triangle too

limber veldt
#

colorsys! To the rescue, but at least I have the math anyway ```py
# hi = floor(self.color_wheel.angle / 60) % 6
# f = self.color_wheel.angle / 60 - floor(self.color_wheel.angle / 60)
# p = (self.val * (1 - self.sat))
# q = (self.val * (1 - f * self.sat))
# t = (self.val * (1 - (1 - f) * self.sat))

    # if hi == 0: 
    #     r = self.val
    #     g = t
    #     b = p
    # if hi == 1: 
    #     r = q
    #     g = self.val
    #     b = p
    # if hi == 2: 
    #     r = p
    #     g = self.val
    #     b = t
    # if hi == 3: 
    #     r = p
    #     g = q
    #     b = self.val
    # if hi == 4: 
    #     r = t
    #     g = p
    #     b = self.val
    # if hi == 5: 
    #     r = self.val
    #     g = p
    #     b = q

    # self.r = round(r * 255)
    # self.g = round(g * 255)
    # self.b = round(b * 255)
    h = self.color_wheel.angle / 360
    color = colorsys.hsv_to_rgb(h, self.sat, self.val)
    self.r = color[0]*255
    self.g = color[1]*255
    self.b = color[2]*255```
rugged coral
#

where can i host my game server for free?

vagrant saddle
rugged coral
#
import socket
import pickle
import threading

players = {}

def player_thread(connection, player):
    print("Neuer Player verbunden", player)
    players[player] = {"x": 0, "y": 0, "z": 0}

    while True:
        try:
            data = connection.recv(2048)
            if not data:
                break
            
            data = pickle.loads(data)
            players[player] = data

            connection.sendall(pickle.dumps(players))

        except:
            pass
    
    del players[player]
    connection.close()

def start_server():
    server = socket.socket()
    server.bind(("0.0.0.0", 9999))
    server.listen()

    print("Server gestartet. Warte auf Spieler ...")

    while True:
        connection, player = server.accept()
        thread = threading.Thread(target=player_thread, args=(connection, player))
        thread.start()

if __name__ == "__main__":
    start_server()```
vagrant saddle
#

how many players and what game type ?

rugged coral
#

is just a 3d world with ursina and no player limits

pine plinth
rugged coral
vagrant saddle
#

you will have a player limit unless you go UDP or serverless, and most vps hosting will kick you out for TCP

#

a part from that don't use pickle, it is unsecure

rugged coral
#

maybe, just want to make a online 3d realtime multiplayer world yk

vagrant saddle
#

realtime ? that is not possible on internet because of network latency.

rugged coral
#

yk what i mean

vagrant saddle
#

also here's some material about networking/panda3d/ursina https://discourse.panda3d.org/t/distributed-networking-astron-and-owner-view/27232

honest heron
#

I know a few people who have made millions I used to know the owner of gpo way back way and more games the only thing I could say is that they were passionate and took their time.

#

don't do it for the cash because then u will make cash grabs and those suck do it cuz u enjoy it ahd u will make alot of money

idle plinth
uncut dove
# honest heron roblox can be good

https://youtu.be/_gXlauRB1EQ sorry its not good

With Roblox Corporation now being valued at more than $45 billion, we ask whether the kids making the vast majority of its content are being taken advantage of?

Support us on Patreon: https://www.patreon.com/PeopleMakeGames

Written and presented by Quintin Smith:
https://twitter.com/Quinns108

Design and art direction by Anni Sayers:
https://t...

โ–ถ Play video
#

there are a couple games that made millions, but id rather play the lottery instead of trying to make a roblox game

#

tldr the house always wins, and roblox would not get that sucessful if many devs were making profits

graceful yew
#
class BasicSpriteGroup(pygame.sprite.Group):
    def __init__(self):
        super().__init__()
        self.display_surface = pygame.display.get_surface()
        self.offset = Vector2()

    def draw(self, player):
        target_position = player.rect.center
        self.offset.x = -(target_position[0] - SCREEN_WIDTH / 2)
        self.offset.y = -(target_position[1] - SCREEN_HEIGHT / 2)
        # does not work
        # self.sprites().sort(key=lambda e: e.rect.centery)
        # for sprite in self.sprites():
        for sprite in sorted(self, key=lambda e: e.rect.centery):
            self.display_surface.blit(sprite.image, sprite.rect.topleft + self.offset)

why does in-place sorting the sprites not work as opposed to sorting a copy?

limber veldt
#

Gotta be something to do with the AbstractGroup() handling of its self.sprites()

#

I've just been refactoring. I have this panel/menu that I was sending all these buttons to from main so it can handle their behaviors. I just moved all the buttons into the panel's menu opener button and pass them from there to the panel. Maybe I should go ahead and move all of that code into the panel itself

#

As the panel slides, all those button rects need to update their positions, that's why the panel needs the buttons. Plus, they kinda categorically fit there

#

It's a settings panel, it might as well have all its own buttons and handle them. The buttons themselves have an action that is just a method in main(), so main really doesn't need to know anything about them

covert rose
limber veldt
limber veldt
#

Or something like that

#

Actually only 11 buttons

#

But not bad

limber veldt
#

Almost time to publish

covert rose
limber veldt
#

Will do

covert rose
cerulean nimbus
limber veldt
#

Yeah, I never made one before and thought it would be appropriate for this game. Anyone with any kind of color issue can make the board almost any color they wish

cerulean nimbus
#

im stuck rewritinging my deprectated folder. mostly stuck because i rewrite 1 part and add 3-5 features to it ๐Ÿ˜ญ

cerulean nimbus
cerulean nimbus
#

will add more to it tho but i wanna finish rewriting my base of the deprecated stuff

limber veldt
#

The images it uses:

limber veldt
#

Since I have it on a sliding panel (it's animated), it needs the align_rects() method, but if not moving it around, no need for the method

limber veldt
#

I worked a bit on getting the color from the bars, they have an update() method but currently just returning from it, but they can set the rgb too. The idea worked but I'm overriding it for now, it is just a chess game, not a graphics art program

limber veldt
#

The only call I'm making to the picker is to its get_rgb_hsv() method and only to save those values and from it to set_label_color(), the method in my main() class that changes the color of labels

frank fieldBOT
#

:incoming_envelope: :ok_hand: applied timeout to @swift cave until <t:1728078008:f> (10 minutes) (reason: attachments spam - sent 7 attachments).

The <@&831776746206265384> have been alerted for review.

limber veldt
#

And don't even ask me to explain the math in both update_sv() and update_triangle_dot() I googled that part

honest heron
#

off pure comissions and is 20 living in a 3k penthouse like bro if u like something stick to it.

#

if you think you can't make a game you can do commision based things and make lots of money. ROBLOX developers r the most paid developers and it takes a google search to prove that

uncut dove
#

yeah you trolling for sure

honest heron
#

i'm trolling?

#

don't discredit his dreams and its a very viable option to make real money on. it isn't easy but it defintely isnt the fucking lottery

uncut dove
honest heron
#

I used to do u.i and ive paid 600 dollars to 1.2k

#

earned*

#

off single uis

#

I was 14 with 3k bro

#

but I was working 24/7 after school to make the money

uncut dove
honest heron
#

believe what u wanna believe all im saying is that making money off roblox is much easier than making money off steam. you probably won't make a lot of money and will be forced to make projects but you do earn moeny and it is not a bad part time job.

#

it scales with exprience and connections. it can also be luck ; the owner of gpo makes millions but yet in 2016 when he made the discord nobody supported him for those same reasons

#

it took him years to release the game and he built a following off it . U work hard you get paid ANYWHERE in life bro

uncut dove
#

okay let me take apart your arguments one by one

uncut dove
honest heron
#

there are single roblox games that clear entire steam charts

uncut dove
honest heron
#

๐Ÿ’€ whats the connections on the outside? the owner of dark souls ๐Ÿ’€ .

uncut dove
#

so you dont earn anything except for those few who buy cosmetics and shit

honest heron
#

you make money almost always by getting people to play for free. All you do is monetize and make cosmetics or sell cheap gamepasses and roll in money.

#

I know a man who is a genius at monetizing his game clears at maybe 2k players daily but he makes more money then u can imagine. Because his smart and monetizes his game excellently

#

You get people to join for free and make them stay that is the power of roblox games and thats why they clear steam any day.

uncut dove
honest heron
#

I know the person who built for this game.

#

at most this game cleared maybe 2.5k players in its prime. It won a couple bloxy awards; overall it was a passion project but it has made millions

#

one of the most recognized games in all of roblox while having little amount of players.

#

It makes easily almost a mill now in this state. This is MONETIZATION

uncut dove
#

you like throwing around "but i know someone" dont you

honest heron
#

I'm speaking off exprience and knowledge ur speaking off emotion

#

His name was Rookie_ethnic but he was outed for some stuff so he doesn't work there anymore buit he made real money when helped make that game

uncut dove
#

okay then provide some proof if you speak off knowledge

#

provide proof you actually know the person

honest heron
#

Not really friends with him anymore

#

bc you know I don't like those type of people but he made moeny and the people who owned that game made millions and still make millions

#

don't discredit somebody for having dreams bc of ur lack of knowledge

#

He wants to make roblox games you give him postives and negatives. It is much harder to make it as a steam developer than a roblox developer. It is just a simple fact. Now you could said become a game developer but their underpaid. Become a software engineer its hard but pays well.

uncut dove
#

i mean anyone can accept friend requests from anyone

honest heron
#

He deleted discord bc he wsa outed for being a pedophile so i don't talk to him

#

anywhere in life u can make it by working hard and being passionate

uncut dove
#

not true

#

what about the blue collar workers toiling their asses off for minimum wage

#

they aint lazy

honest heron
#

some people r content; a lot of those guys have the potential to make real money.

#

some people have parents who have done that work and they branch out take a loan start a company and work hard building it.

#

they make maybe 300k-600k doing that

#

but we call that a low skill job

quasi hamlet
honest heron
#

exactly

#

they arent lazy but thats the position they put themselves in

#

some are truly unfortunate like immigrants and what not others just made bad choices but eitheir way. some people use that to make real money

quasi hamlet
honest heron
#

but there are ways out

#

such as lets say

#

truck drivers can easly clear 100k and you only need less than ayear of schooling

#

it comes to a total of 3k.

#

3-10k and there is monthly payments of like an extra 300

uncut dove
honest heron
#

there is always a way out

quasi hamlet
honest heron
uncut dove
honest heron
#

I know classmates whos parents were construction workers and busted their ass in a bad

quasi hamlet
honest heron
#

work enviornment

#

they branched out and started their own company

#

@quasi hamlet THERE IS ALWAYS a way out

quasi hamlet
#

if money was really a measure of work, then Bill Gates would've manually moved every single drop of the entire pacific ocean using a glass

honest heron
#

its the mentality.

uncut dove
honest heron
#

never did I say that I just said people who bust their ass off make money

#

doesnt have to be a company

#

it can be a 9-5

#

it can be a blue collar job

quasi hamlet
honest heron
#

a trade

#

u name it

#

yes it is man I came from nothing

#

my uncle cam from nothing

#

we were homeless and my uncle was working a bum ass job and he got a cdl now he makes a 100k

#

he was barely survivng but he paid an extra 300 by taking loans out

#

he got his cdl and made more money if u give up thats you. if you were born in a 1st world country with both parents and ur a construction worker thats on you and nobody else.

#

you didnt work hard to live a good life you made bad choices , prison, drugs, dropping out of school. whatever it may be thats on u

quasi hamlet
#

if there werent any low-paid people there would not be any profit either and therefore no economy, as such, low-paid are a necesity and a circunstance, a status which you either get out or fall deeper in, and it's usually not someone's fault. By taking loans you can indebt yourself even more than what you were originally.

uncut dove
#

theres an element of luck to it

honest heron
#

but you dont work hard earlier in life you work hard for somebody else or work hard for less

quasi hamlet
honest heron
#

thats just how this country works

honest heron
#

but it isnt rlly luck for trades of cdls

#

but like I wanna be a software engineer and im black ik that its gonna be harder for me to get a job

#

but thats fine

quasi hamlet
honest heron
#

??

#

im east african

#

holy shity

quasi hamlet
#

fair enough

#

then you know how life on those villages are

honest heron
#

yes

quasi hamlet
#

or do you life on a comfortable city

honest heron
#

thats africa though

#

I came from kenya

#

and Im not gonna say its easy its dam near impossible there

#

but I MEAN america

#

in AMERICA

uncut dove
#

okay im asking you a question, if you put in the work and be passionate about it, will you become a multimillionare

honest heron
#

you have a choice from a early age USUALLY. some people get played bad cards. Some people get sex trafficked when their kids and wound up in a differnet state 10 years. No highschool, nO GED, no education. thats a bad card. some people had to drop out fcus their parents are dying and they have to take care of them.

honest heron
#

but also there are sure fire ways to become a millionaire such a roth ira but thats when u about to retire

#

u put in 3k in a roth ira and put a 1k a year by the time ur like 50 u have millions

#

if u do that when ur 18 tho

#

but I do think its very hard and it is entirely luck to make millions when you're young

#

but u can build and make those millions later in life

quasi hamlet
# honest heron and Im not gonna say its easy its dam near impossible there

how easy or hard it is depends on the circunstances, and since the circunstances change not only because of you but also because of everything that affects you, there's a clear element to it. We can agree then, that you were lucky to get out of there, because no matter how hard they try, a selled child, 10 years old, married, can't get out of her misery

honest heron
#

exactly

#

you have it right

honest heron
#

well

#

you dont have to put 3k

#

its easy to open one up

#

you can do a 1k a year when u get tax returns and it will make a similiar amount in the end

#

but by the 50 u have 1-3 million EASILY

#

but I also accept and know that its hard to live and thrive in america without support. For some people they will start later but when you have parents , AND BOTH parents. A support system and other things a child needs. Then you end up flipping burgers it is entirely you.

quasi hamlet
# honest heron exactly

how can you say "exactly" so proudly? Do you not understand not everyone can get money easily? or at all?

honest heron
#

yes

#

I come from nothing

#

I relate to all that and above

uncut dove
honest heron
#

no it is you

#

you come from a good family, that can pay for ur education , can pay for your trade. And you fuck around thats just you

#

a lot of people come from less and make more

uncut dove
#

rich people are often rich just because they are born with a silver spoon up their ass

honest heron
#

dude their are kids in south africa that have less then you

#

and they wake up everyday

#

go to school

#

bedcome a doctor

#

make monmey

#

and immigrate ive seen it and thats work ethic

quasi hamlet
# honest heron but I also accept and know that its hard to live and thrive in america without ...

Oh, so you argument is because comparing how hard life is on america and on africa, all problems are your own fault. What is missing there is the fact that people don't understand the situation they're in, if someone doesnt understand, and doesnt fathom how hard it is to actually get a job and work, let alone create a company, they'll think it's easy, even more if they are born around people that think it's easy, it's not entirely someones fault but the people's ignorance of their circunstance's fault to not understand how doomed they are, even when they are born in such favorable circunstances

#

which, looking at it again, has nothing to do with being hard-working

#

what you can't be is something that doesnt attend his responsabilities, but from there to a hard-working person there's a far shot

honest heron
#

I guess . I'm jsut saying that if you got dealt good cards and you fumble thats just you. Other people get dealth much worse cards and make it into an empire.

honest heron
quasi hamlet
# honest heron a lot of people come from less and make more

not really, comparing how many people are born middle-class and how many of them become successful, there's a far greater number than how many people are born poor and become successful, the diference is the fact that for the second group, it always makes a lot of noise

honest heron
#

and then they're 9-5 millionaires. Like if you run a department in a place like nvidia u make millions

#

if you are the head of innovation of their graphic cards u make like 1-2 m

quasi hamlet
#

so because you know more poor people that became rich doesnt mean there's more poor people that become rich than middle-class people that become rich

#

let alone rich people that become even richer

honest heron
#

yes

#

I'm just saying its possible and in america its entirely possible.

quasi hamlet
quasi hamlet
honest heron
#

his saying that their are lots of millionaires that come from millionaires. but their are also self made millionaires from middle class or lower class . Or even below the poverty line.

quasi hamlet
#

this is a fire conversation to have on the game-dev channel lol

honest heron
#

yea

quasi hamlet
#

(srry people reading this, got carried out)

honest heron
#

my brother in law is the exact definiton of work hard and hustle he was making 30k a year and immigrated as a child came from nothing and now he runs his own buisness and his first year he cleared 100k+ and he clears more and more every year.

quasi hamlet
honest heron
#

he woke up and said fkc this bro I got kids and a wife to take care of and that's the real definition of a man yk.

#

@quasi hamlet true

#

thats just life

quasi hamlet
#

then how are you arguing that if someone is not a millionaire it's their fault?

honest heron
#

nbooo

#

noooo

#

you mis understood me

quasi hamlet
#

fine, then how are you arguing that if someone ends up flipping burgers it's their fault?

honest heron
#

I'm arguing that in america you can do better for yourself. Being a millionaire can be luck.

#

bc thats just lazy and no planning man

#

at least if u come from a good background

#

your father is a doctor and mother does whatever and also makes money but u end up flipping vurgers and live with ur parents at 27

#

you grew complacent in life

#

and unfortunately that's a sad fact. You can look at history books and see billionaire families lose everything because the generations became lazier and lazier. They grew complacent and instead of increasing the family fortune they blew it and spent it. Until they ran out.

quasi hamlet
uncut dove
# honest heron and immigrate ive seen it and thats work ethic

while i agree that this is a possibility, you need to have luck, as in you have to be intelligent enough to become a doctor, you need to have the money to attend a good school
while i was working a summer job ordering computer equipment, i had a coworker that immigrated from north macedonia he was paid the least in my department, but worked the most, compared to someone higher up who slacked the first hour at work, went to a smoke break, and paid more than a true hard working person

honest heron
#

intelligence usually isn't a problem especially in the medical field ๐Ÿ’€ you do need money to attent a good school but you can just take loans.

#

Also ur comparing ur friend to soembody else compare him to who he was before.

#

Compare him to who he was when he immigraterd from macedonia

#

then compare him to the current him in 20 years and see where he is at

quasi hamlet
# uncut dove while i agree that this is a possibility, you need to have luck, as in you have ...

you have to be intelligent enough to become a doctor
well, in that I disagree, the fact of wether you're able or not to learn something depends on your perspective of the world and in the way you understand things, I know crazy inteligent people that can't understand simple stuff just because it's not their field of specialization or because they simply don't understand, I don't know how to put it the other way

honest heron
#

yea

#

you just need to be average in intelligence or not have a mental disability that affects your iq

quasi hamlet
#

now, granted that the other way also checks, you have to have the mind structured in a specific way to become a doctor

uncut dove
honest heron
#

you can do amazing things with average intelligence you can work quantum physics.

#

@uncut dove how old is he?

uncut dove
#

43

honest heron
#

he probabl won't be a millionaire but you don't know where he will go

#

but he can easily clear 100k+

#

in 10 years from now

#

comparsion is the thief of joy. just improve who you are now

quasi hamlet
honest heron
#

Dude messing up a diagnosis is just like plain stupidity and not in the iq way

#

yk

#

and it happens all the time

#

and smart people do it more often

quasi hamlet
#

did you know that cancer of anything can have virtually any simptom on any other part of the body?

#

diagnose that

honest heron
#

im saying that you can go through medical school while being below average in iq terms and be an amazing doctor. MEd school doesn't have extremely hard courses. It just has LOTS of information you need to learn and use

#

yes

#

but there are tests that can prove its cancer

#

a cautious doctor goes a long way man

uncut dove
#

i dont see an average person becoming a surgeon because it does require traits that not everyone has

quasi hamlet
honest heron
#

idk if you know just how smart a "average" person is

#

humans are incredibly smart and being just average means you can do about anything anybody else does granted with a harder time.

#

Now you can make a arguement that soembody below the average iq can't become a surgeon and I would agree but they can defintely be a medicine doctor aka MD

quasi hamlet
honest heron
#

most surgeons are probably around 110-130

#

in the iq range

#

and 110 is below average

#

or is average

uncut dove
honest heron
#

but ofc im probably wrong

#

@uncut dove entirely TRUE btw

#

I compeltely agree and I think the IQ tests are a bs method to measure intelligence but oh well

#

btw iq tests are so stupid

quasi hamlet
# honest heron idk if you know just how smart a "average" person is

that's because it's not wether if it's smart of not what you're talking about, it's if the people have the perspective, some crazy smart people, are simply dumb, they're idiots that think lots of themselves and won't learn nothing of nothing,
it's not wether if someone is smart or not, it's about how they think

honest heron
#

^

#

agree

#

anyways you can walk in and study for a iq test

quasi hamlet
honest heron
#

did you know that?

#

you can STUDY

#

to get a higher iq

#

ofc a surgeon will have a higher iq

uncut dove
honest heron
#

plus the human brain like grows yk

#

the more problems you do and the harder it is

#

the smarter you become

#

personally I think im smart but I will never take a iq test bro

#

I suck at riddles and all of that weird stuff

#

plus im very intrapersonal

uncut dove
quasi hamlet
#

man, iq is not a measurement of inteligence, first of all, inteligence is something cualitative, it can't be expressed with a number, for example, I'm crazy good with maths and computers, but, I can't draw shit, I have hard times memorizing simple stuff and yet, I can learn a lot of something really quickly
all those points are examples of "skills" (I wouldnt use that word for that, but wathever, keep it simple) that are mostly unrelated between themselves and therefore if they could be measured, they would have to do so separatedly, and again, since how good or bad are you on something is something subjetive, you can't even measure a single "skill", to give an example, if someone can paint something really beatiful depends on the one that's looking at the painting

honest heron
quasi hamlet
honest heron
#

it doesnt physically grow ๐Ÿ’€

quasi hamlet
honest heron
#

the connections become stronger

#

and you become better at solving

#

and finding patterns and what not

uncut dove
#

lets look at chess, or more specifically bobby fisher who was one of the greatest chess players, he was born with the supernatural chess ability

honest heron
#

yea but that is like michael phelps

quasi hamlet
#

no it's not

honest heron
#

some people r born to do certain things but it doesn't exclude others from it

#

yk

uncut dove
#

most professional chess players were above average in chess in their childhood

honest heron
#

like usain bolt was just made to run but it doesn't exclude others from becoming professionals.

uncut dove
#

yes you can try and learn chess in depth, but you will hit a wall where you reach your cognitive limit

honest heron
#

ok but whats the cognitive limit?

uncut dove
#

it cant be measured what it is, but its the point where you plateau in your performance

quasi hamlet
#

to put it simply, your brain generalizes the "latent space" of ideas, and then holds the current "position" in that latent space and moves around, that adding the actual data becomes our comprehension of something, now, if Boby Fisher was crazy good at chess is because he happened to be born with a hippocampus specialized in whatever mess is the latent space of how pieces interact in the board across time and space, and if michael phelps if superhumanly good at sports is because he was simply born with a diferent proportion of muscular fibres

honest heron
#

ok but tbh

quasi hamlet
#

you can't compare your brain structure with muscular fibres

honest heron
#

iq is false

#

and is incredibly false

uncut dove
#

i was not talking about iq

#

the cognitive limit is not a measure and cant be cleanly defined

quasi hamlet
honest heron
uncut dove
#

i cant say what my cognitive limit is

honest heron
#

but it doesn't exlcude others

#

yk

quasi hamlet
#

problem with chess is the fact that, if you're too good at chess there's a point in which becoming better is memorizing hundreds of thousands of games

honest heron
#

Like when I was young when I was going through the immigration process

#

a part of the concrete roof fell off and hit my head

#

I had to go through all sorts of surgeries and what not. My mom put me through an iq test when I was a bit older like 9 or 10 and I scored 130

#

now i would 100% score lower

quasi hamlet
#

point granted is that some people are better than other on performing tasks, and some people exploit that and some people doesnt

honest heron
#

@quasi hamlet but the arguement cracky was making is that some people are born to do certain things and I agree but those peopl are special cases. like nuero divergent people dominate stem and have a higher iq. But an average human can also succeed in stem. Comparing them in a way that is trying to discredit them is just incorrect

#

yk

#

thats the point I am making and its why I made that comparison some people are built for these things.

#

like I suck at math, and unfortunately, my major is math dominated. I don't know how I will pass that roadblock but I will. While I am not gifted at that, I know I am not a dumb person and it's within my reach. TO step away from it because I am "not talented" or "not smart enough" is just false.

quasi hamlet
# honest heron <@990391928300404748> but the arguement cracky was making is that some people ar...

true is the fact that you can't discredit people because they're worse at doing something, it's completely true.
Yet, since this cruel world doesnt care about credit, the surgeons with most success rate will be the more neurodivergent, and ordinary hard-working people will lack behind, because surgery is something extremely hard to do, so it's a bad example
same applies to medicine, but in a lesser scale, and same applies to everything in a diferent scale, that's our point
you can't say "I'm not a doctor because I'm not a genious", agreed, but you can, finish med school, going to your first hospital, and just being so bad on medicine that you're fired, it's the same neurodivergency that if you're a genious, just, the other way around, and the higher the standar is for a job, the more people it's filtered out by this
it doesnt mean you can't be a surgeon, or a doctor, it just means is hard, and if you happen to be lucky enough to be a genious but unlucky enough to be it on the opposite direction, then you sure are going to have trouble

#

Matter of fact, because of that, normal people that reach the pinnacle of science have so much more credit than literally anyone else

#

thik of Feyman

honest heron
#

And you hit the target

#

nice

#

The exact point I was trying to make I'm just so lazy. I didn't wanna type it all out

#

@quasi hamlet Do you know the rapper Gunna?

quasi hamlet
# honest heron And you hit the target

yeah well but you still don't have into account the fact that so many people are simply unable to keep up with "smart people" on the subject, or it's too hard for them, or they think it's too hard for them and etc, etc, etc.....
the fact that you're second, third, fourth if you're lucky, 10th-40th for normal people it's just not encouraging enough to keep up the effort

#

but yeah, I think we more or less agree on that

quasi hamlet
honest heron
#

Oh I was gonna make the point that while I think he may not be talented at other things such as math etc. He is extremely lyrical and by no means is stupid or below average.

quasi hamlet
#

we gonna get a strike or something because of what we've just discussed on game-dev or smth

#

my fault still tbh

honest heron
#

๐Ÿค prob

finite crow
#

whats up guys. what do ya'll use for develop games? any unreal users?

#

Could you guys imagine a game like runescape or ultima online where the creatures and npc's we're controlled by a GM that's AI. For an dynamic and evolving world? Sounds fun. I dont know if any of guys were around, but when the internent was still brandnew and when BBS's were a thing, we played these guys called MUD's. But they were bascailly the first mmorpg games but mainly text with ANSI . The concept would be a already pre created world but figure how how to let the AI control and manipulate the world

#

I remember playing Neverwinter Nights on AOL as a kid and it changed my life, lol

warm oracle
#

can anyone explain why is it so small even whe n i transflrm it's scale into the size of the screen

lucid gyro
#

can anyone help me with a pgzero code

quasi hamlet
limber veldt
#

By subclassing sprites

#

lol

#

Good morning all o/

#

More refactoring this morning, getting closer to publishing

astral dust
#

Hello, I am making WarThunder like game in python. I want to implement multiple vehicle classes of vehicles: ships, planes, tanks, airships, all of them have an unique properties and behavior, for example some planes are able to carry bombs, have gunner turret, other only can carry rockets. Aircarriers are able to carry aircraft. Above all different vehicles have different controlling.

So, the question is:
How I should organize the architecture ?

limber veldt
#

I still have to make like three of four different sprites before recognizing their similarities and going, 'Hey, I can abstract that to a more generalized sprite and subclass to make specific sprites'

#

Like this, I first had both those last two objects as their own sprites with the only difference being the images and positions ```py

class SelectAPlayerButton(pygame.sprite.Sprite):
def init(self, pos, image, panel_image, action, group):
super().init(group)
self.image = image
self.rect = self.image.get_rect(center = pos)

    self.panel_group = pygame.sprite.GroupSingle()
    self.panel = PlayerPanel((WIDTH, pos[1]-16), panel_image, action)
    self.panel_group.add(self.panel)

def get_clicked(self):
    pos = pygame.mouse.get_pos()
    if self.rect.collidepoint(pos):
        self.panel.set_state('opening')
    # if self.panel.state == 'opened':
    self.panel.get_clicked()

def draw_panel(self, screen):
    self.panel_group.draw(screen)

def update(self, dt):
    self.panel_group.update(dt)

class SelectPlayerButton(SelectAPlayerButton):
def init(self, pos, action, group):
image = ui_images['select_player_button']
panel_image = ui_images['select_player_panel']
super().init(pos, image, panel_image, action, group)

class SelectOpponentButton(SelectAPlayerButton):
def init(self, pos, action, group):
image = ui_images['select_opponent_button']
panel_image = ui_images['select_opponent_panel']
super().init(pos, image, panel_image, action, group)```

#

Both the same object, might as well subclass and send the params to the parent

#

So my best advice for organizing both file and code structure, think really really hard about the relationship between objects and how to categorize them

astral dust
#

I just don't want to repeat code

limber veldt
#

Totally get it

#

I subclass everything as much as I can, still and forever practicing though

#

I actually had the images being sent to the main button but changed my image handling to just import a dict of images into the file instead. I kinda like that idea more than loading all the images into main and sending them from there to all the instances

#

My main() no longer handles many of the images I'm using, just importing a dict of them where necessary

#

I have all these images in one folder atm

#

And they all get loaded into a dict at startup

#

In fact, main doesn't even have a reference to any of those images anymore

#

It could get them from the objects though, but no need

#

I like my stuff somewhat organized and having them all in one gimp project makes it pretty easy

wanton thistle
#

I have made up a guessing game

#

import random

def hadanie_cisla():
print("Vitaj v hre 'Hรกdanie ฤรญsla'!")
print("Myslรญm si ฤรญslo medzi 1 a 100. Skรบs ho uhรกdnuลฅ.")

cislo = random.randint(1, 100)
pokusy = 0

while True:
    tip = input("Zadaj svoje ฤรญslo: ")
    
    # Kontrola, ฤi je vstup ฤรญselnรฝ
    if not tip.isdigit():
        print("Zadaj prosรญm platnรฉ ฤรญslo.")
        continue

    tip = int(tip)
    pokusy += 1

    if tip < cislo:
        print("Moje ฤรญslo je vรคฤลกie.")
    elif tip > cislo:
        print("Moje ฤรญslo je menลกie.")
    else:
        print(f"Gratulujem! Uhรกdol si ฤรญslo {cislo} za {pokusy} pokusov.")
        break

hadanie_cisla()

cerulean nimbus
#

one way to test this is to fill your image with a color

#
image = pygame.image.load(image_path)
image.fill("red")
warm oracle
#

i checked it

#

thanks

limber veldt
#

Currently doing this way but I suspect there's an even better ```py

def custom_draw(self, screen):
    mask = self.mask.copy()
    mask.fill(self.color, special_flags=pygame.BLEND_RGBA_MIN)
    screen.blit(mask, self.rect)
    self.image.fill(self.color, special_flags=pygame.BLEND_RGB_MULT)
    screen.blit(self.image, self.rect)```
covert rose
#

1.This software is free and open source.
2.Any updates and feature enhancements must be discussed with the publisher before release.
3.Any use of this software that will generate income for the user must be discussed with the original publisher of this software in advance.
4.This software created by"HamidrReza Jahanshahi" known as "S.U.P.E".
5.H...

โ–ถ Play video
limber veldt
#

Via a callback from the settings panel to main ```py

def set_label_color(self, color):
    self.board.file_label_group.sprite.color = color
    self.board.file_label_group.sprite.init_state = True
    self.board.rank_label_group.sprite.color = color
    self.board.rank_label_group.sprite.init_state = True``` any time it changes color
#

And then out to the board and to the sprites

#

And the other methods only do logic on a trigger, since their init_state flag immediately get set to False

random geyser
#

good day

#

could someone help me with some homework

#

i have to understand the basics of coding like variables and tuples etc but i genuinely dont understand anything

#

when i look guides online i also get more confused

uncut dove
#

well now i regret arguing on the internet until 2am ๐Ÿ˜ญ

random geyser
#

wait why ahha

uncut dove
#

just scroll up in the chat xD

random geyser
#

oh ahahah

#

can you prehaps help me?

uncut dove
#

yeah

#

so a variable is a container for some sort of data, be it an integer, string, list, and so on

random geyser
#

that i understand but i dont get how to make one

uncut dove
#

you define it, as in

x = 1
#

x is now a variable

random geyser
#

so would that be an int since its a single number?

uncut dove
#

an int is a whole number

#

like -1, 4, 7, 42

random geyser
#

okay thats good to know

uncut dove
#

a float is a decimal number, or an approximation thereof

#

now i saw you talking about tuples so imma explain those

#

and how they differ from lists

random geyser
#

so
cake = eggs, flour, milk
would be an str

#

yeah sure

uncut dove
#

the correct way is
cake = "eggs, flour, milk"

uncut dove
#

well it doesnt have to be multiple, you can have an empty list

#

now the difference is that tuples are immutable, meaning you cant modify them after you create them

#

so if you do x = (1, 2, 3) you cant modify whats contained within x

random geyser
#

like a grocery list?

uncut dove
#

i guess

#

now each object within the list has a number associated with it

#

an index

random geyser
#

could you prehaps show it to me in an image

#

like my school made an powerpoint

#

but i think i understand it wrong

uncut dove
random geyser
#

and can all of this also be applied to pycharm or is that diffirent from python

uncut dove
#

pycharm is an ide

random geyser
#

sorry im so confused what does that mean

uncut dove
#

text editor basically

#

with some features to make coding in python easier

random geyser
#

i see

#

i think i undestand it a but better now

limber veldt
#

Doesn't matter which ide or editor you use, python is python, just some make it easier or do it slightly different than others. Most ides have basic features to make working with code easier

cerulean nimbus
#

ok so im making kinda a pygame-multi emulator (kinda like pygame but with some QoL features like buttons etc and a way to run like multiple games at once)

#

and im working on the "window" feature rn should i add the ability to add a title bar rn

#

the green and black are representing a "window" rn

#

i just temporarily filled the surface

limber veldt
#

Hmm, maybe even a small icon or something representing what it's supposed to be showing

carmine brook
#

yo I wanna make a game but I donโ€™t got much knowledge about what I need I know some js and python

vagrant saddle
limber veldt
#

Morning all o/

#

This sure is a handy little group ```py

class TooltipGroup(pygame.sprite.Group):
def init(self, *sprites):
super().init(*sprites)

    self.tooltips = {
        'dark': [],
        'light': []
        }
    self.enabled = True

def add_dark_tooltip(self, sprite):
    self.tooltips['dark'].append(sprite)
    super().add(sprite)

def add_light_tooltip(self, sprite):
    self.tooltips['light'].append(sprite)
    super().add(sprite)

def set_tooltip_color(self, color):
    super().empty()
    self.add(self.tooltips[color])
    for spr in super().sprites():
        spr.alpha = 0
        spr.image.set_alpha(0)

def custom_draw(self, screen):
    '''
    draws:
    member sprites if self.enabled == True'''
    if self.enabled:
        super().draw(screen)```
#

Now I can add a 'tooltip_color' key to my theme dict and when changing theme, change the tooltips accordingly

#

I have a lot of drawing in a few places/objects, so went through and gave all the draw methods docstrings

#

Easier to make sense out of the main draw method this way

limber veldt
#

More woods

#

Does anyone know how to or a good tutorial for tinting/shading through opengl?

#

I'd like to write a shader that tints/shades the entire screen. I can do that how I'm doing the board, but I'm experimenting

teal cargo
#

no... but I will say your chess is starting to look a lot more polished now

limber veldt
#

Oh thanks

#

The last month or so has been mostly polishing and refactoring

#

I still have an issue with my clicks on moves in the list to mass-redo moves, some of my squares/pieces are not assigning correctly in the process but redo or undo one at a time is working fine

#

I may just very reluctantly disable that feature

opaque swallow
limber veldt
opaque swallow
limber veldt
#

I see, tk isn't really my thing so didn't pay any attention to the ui

icy venture
#

hi everyone

#

im using pygame

#

but in my program, i need to open the file dialogue

#

i did a lot of research, and tkinter is apparently the simplest way to move my jpg file in pygame to whereever the user wants the jpg file to be saved in

#

how can i implement tkinter file dialogue to pygame?

opaque swallow
#

Well

#

Tkinter is definitely the way to go

icy venture
#

may i dm you with further details or should i send all info here

covert rose
opaque swallow
icy venture
icy venture
covert rose
#

wanna see the script?

icy venture
icy venture
opaque swallow
#

Yes please

icy venture
#

?

opaque swallow
#

Hereโ€™s what I think would work:

import pygame
import tkinter as tk
from tkinter import filedialog

Initialize pygame

pygame.init()

Function to use Tkinter's file dialog to save an image

def save_file():
root = tk.Tk()
root.withdraw() # Hide the Tkinter root window
file_path = filedialog.asksaveasfilename(defaultextension=".jpg",
filetypes=[("JPG files", ".jpg"),
("All files", "
.*")])
if file_path:
# For demonstration purposes, let's create a blank surface
surface = pygame.Surface((100, 100))
surface.fill((255, 0, 0)) # Fill it with red color
pygame.image.save(surface, file_path)
print(f"File saved at: {file_path}")

Your pygame loop or event handling would go here

save_file()

pygame.quit()

icy venture
opaque swallow
#

I have a project similar Iโ€™m working on

icy venture
#

wow cool

opaque swallow
#

Just copied and pasted module pretty much

icy venture
#

shall i paste my current code?

opaque swallow
#

Sure

icy venture
#

ok!

opaque swallow
icy venture
#

it keeps deleting my code message

#

when sending here

limber veldt
#

More than enough boards and frames, some of the colors are bad, that's easy to change, but I have a good variety and with the color picker, everyone should be able to find something that works for them

opaque swallow
#

Dang bro nice gui

#

Anyway I gotta go bye everyone

limber veldt
#

Thanks, tried keeping it pretty clean

icy venture
#

oh bye :(

#

hi @covert rose could you please send the pygame script you mentioned sir?

covert rose
#

yeah wait

icy venture
#

thank you ๐Ÿ™๐Ÿป

limber veldt
# icy venture thank you ๐Ÿ™๐Ÿป

This is how I did them for one of my games ```py

    ''' import these '''
    # from tkinter import Tk
    # from tkinter.filedialog import asksaveasfilename, askopenfilename
    
    root = Tk()
    root.withdraw()
    files = [('lvl files', '*.lvl')]
    if is_loading:
        filename = askopenfilename(filetypes = files, defaultextension = files)
    else:
        filename = asksaveasfilename(filetypes = files, defaultextension = files)
    root.destroy()
    return filename```
icy venture
#

see the tricky thing with my code is that it outputs two jpg files, asks user if they want to save these files or not, and if they do then it opens file dialogue and saves the jpg file in the user's chosen directory

#

which i am struggling to implement in my code

limber veldt
#

The entire method, just to be more clear, maybe ```py

def get_path(self, is_loading):
    root = Tk()
    root.withdraw()
    files = [('lvl files', '*.lvl')]
    if is_loading:
        filename = askopenfilename(filetypes = files, defaultextension = files)
    else:
        filename = asksaveasfilename(filetypes = files, defaultextension = files)
    root.destroy()
    return filename```
icy venture
#

just letting you know, idk anything about tkinter haha

limber veldt
#

pygame has methods for saving png from surfaces, if that interests you

icy venture
#

can i send my code, maybe that clears thing better

limber veldt
#

The method I posted above should work for that

icy venture
covert rose
#

i cant post whole code for unknown reason , discord crashed.

icy venture
#

for context, the save_maze() function is the one where i want this new code implemented on line 45

icy venture
covert rose
#

whats that?

#

oh ok

#

give me a link

icy venture
#

ok

#

this is official from python discord server

#

just paste the script and it should generate a temp link for 30 days storing the script :D

limber veldt
#

In your line 55, where it says filename = base_filename + extension copy/paste the method I posted into your code (removing the self, arg from the definition) and instead of filename = base_filename + extension say filename = get_path(False) or even in addition to using your code, trying the method with a different variable name (maybe test_filename = get_path(False) and see what happens

#

You'll need to change the extensions defined in the function too, to match .jpg or whatever filetype you need

icy venture
#

Sorry I am confused by your message @limber veldt

#

If it isnโ€™t much trouble for you, could you send an updated code with your suggestion/improvement?

#

My English isnโ€™t great so I struggle to understand some of message

#

If no I see if chatgpt can understand you for me ๐Ÿ˜‚

limber veldt
#

Just pasted he method into my current project and called it with a keypress

#

With the other changes I mentioned, I can't test it, only you can

#

I tested the method in my code and as we can see, it works

covert rose
limber veldt
#

The implementation might not be what you need but opening a save as... dialog with tkinter can be done like that

limber veldt
#

Some shading on the edges of squares, I dunno

manic cave
#

I tried making a game earlier this year but somehow got things messed up when introducing the ability to open menus and pause/re-start the game, does anyone have any frameworks or suggestions for how to implement a game that needs live-action (WASD movement top-down) and then the ability to pause and re-start based on game actions? I know this sounds kind of vague but I'm not sure the best way to ask this question. I guess I am interested in things like what to use as a class and where the event loop should exist and how to implement pauses

pine smelt
#

sounds like a job for a finite state machine

#

im sure theres a couple examples on google or youtube but thats prolly the easiest way to go from what i think u want to achieve

opaque swallow
limber veldt
#

Implement a neural network like NNUA or whatever the acronym stockfish calls it /j

bold hill
#

May I ask a question here?

limber veldt
#

Oh...yeah

mellow flint
#

you can take inspiration for the engine here

#

it has nnue

limber veldt
#

I looked at various tooltip implementations in the apps I'm running, vscode has a delay of about a third of a second before they fade in, so I gave mine the same, it works

#

And they don't fade out, just disappear

manic totem
#

how do i stop a number from updating after it reach spesific point

#

so i have this a variable that contain a number that i keep subtract it but i want it to stop after it reach 0

limber veldt
#

At or above I meant

manic totem
#

i'll try that

limber veldt
#

There's also max() that does the opposite

#

Combining them can keep a number between two values val= min(10, max(0, val)) will keep val between 10 and 0

manic totem
#

ok it work

#

thanks

limber veldt
#

Sometimes it's appropriate to just use a condition, like if val > 0: val -= something

manic totem
#

oh

#

i have try that before

limber veldt
#

The min and max functions are fine most of the time

manic totem
#

but its doesnt look good on display

#

its look like it glitching out

limber veldt
#

Depends on the implementation

manic totem
#

im using the variable as score

#

sorry for make it not so clear

limber veldt
#

I use the min/max way most of the time, it's one line compared to 5 or 6 lines to get the same result from conditionals

#

I still have to thought process them though, they're kind of counter intuitive since min() is used for setting a maximum limit and max for setting a minimum limit

manic totem
#

yeah, but it also more faster. everything have their own pros and cons they say

limber veldt
#

True

manic totem
#

btw since you here

#

how do i use pygame.time.set_timer()

dusky grove
#

In Pygame, pygame.time.set_timer() is a function that creates a recurring event at a specified time interval. It triggers an event at regular intervals, which you can handle in your game loop

#

pygame.time.set_timer(event_id, milliseconds)

limber veldt
#

It's a pretty limited timer, it works, but lacks functionality I need in timers

#

I have used it a couple of times, it is handy

#

My Defender is using it to cycle colors on a timer

pine smelt
#

is it really worth using tho

#

surely a normal timer is more useful and adaptable

bold hill
#

May I ask a question?

limber veldt
#

Not really, a simple Timer() class can do way more

pine smelt
pine smelt
limber veldt
#

Just feed it dt on an update() method and it can time things

bold hill
pine smelt
#

uh what context

#

like a cell in a grid? a prison jail cell?

limber veldt
#

Can you possibly be more vague

bold hill
vestal juniper
#

Hemlo guys

pine smelt
#

uh not entirely sure what that drawing shows

bold hill
#

It's for a sci fy horror player area a ship of sorts

vestal juniper
limber veldt
#

There is no such thing as a 'player cell' unless you make it

vestal juniper
#

Y y'all ignoring me

bold hill
# limber veldt There is no such thing as a 'player cell' unless you make it

When it's supposed to be in a design for a ship in my game which is supposed to take place under water and using the concept of four-dimensional rift to move anywhere in time so I'm trying to make an area which is generated to be where the player will be for the entire game similar to iron lung if that makes it any easier to explain

limber veldt
vestal juniper
#

Idk why I'm watching someone repair his cycle wheel on discord

limber veldt
#

Just writing some codes

vestal juniper
bold hill
bold hill
limber veldt
# vestal juniper What codes tho ?

Animated buttons, buttons that change color when clicked then about a tenth of a second later, change back, so you can see them clicking

#

More of them actually, I have animated button abstracted

#

Here's the latest one py class RightArrow(AnimatedButton): def __init__(self, pos, action, group): images = [ ui_images['right_arrow_enabled'], ui_images['right_arrow_disabled']] super().__init__(pos, images, action, group)

#

That's all of it

vestal juniper
#

Woahhh cool tho

limber veldt
#

Old as dirt /j

#

Simple state machine

#

Instance the button, send it a function or method as the action it should perform when clicked, send a group to it, draw and update the group

#

And get images to it anyway you want, either by grabbig them from an imported dict like I did for the RightArrow or send the images to the RightArrow

#

Some of my buttons have tooltips, some don't

#

Well, the group they go into to them

#

By making it a state machine, I can call the buttons from anywhere to change their state, like when I press a shortcut key to activate a button, even if not clicked, I can animated it by setting its state to 'clicked'

vestal juniper
#

Woahh

#

This is more cool

vestal juniper
limber veldt
#

4.5

#

lol

#

No man, I'm in my 50s, lots of practice

cerulean nimbus
#

not meant rude

#

T^T

sinful field
#

Someone got a 3d projection script that uses numpy? I would greatly apreciate it !

cerulean nimbus
#

nvm apperantly i deleted my numpy folder

sinful field
#

Oooon, snif

#

Well thx anyways ๐Ÿ˜‰

pine smelt
#

so u get funky stuff like that which is obv wrong

#

the code's there if u wanna try fix it or use the logic from it

#

the matrices and the camera handling itself should be fine altho idk if the camera rotation methods rotate based on its location

sinful field
#

Yoo thx, dont worry abt face culling tho its the ez part !!

limber veldt
twin fog
#

nice

limber veldt
#

Playing around with tryna make a better woodgrain, getting closer

blissful grail
#

!pygame

#

haa

#

hmm

finite crow
#

brah...!

vestal juniper
limber veldt
#

Not bad

limber veldt
#

Never saw a bumpy chess board but I applied a bump map to this to see how it would look, one side bumpy, the other not

halcyon bay
#

people who have experience with render engines/blender dm me

spice tartan
limber veldt
#

What do you mean?

#

It has a border, they're called left, right, top and bottom margins

mellow flint
limber veldt
#

You're younger than mine ๐Ÿ˜ฎ

#

lol

mellow flint
#

Obviously

limber veldt
#

Just wondering if you have a point

#

Obviously not

vestal juniper
limber veldt
#

How would anyone here implement point/triangle collisions?

#

My naive approach would be getting the scalar projection of the point from each face and checking if they're all the same sign

limber veldt
#

Oh nvm, I came up with this way ```py

    inside = True
    if (self.top.x - self.right.x) * (pos.y - self.right.y) - (self.right.y - self.right.y) * (pos.x - self.right.x) < 0:
        inside = False
    if (self.top.x - self.left.x) * (pos.y - self.left.y) - (self.top.y - self.left.y) * (pos.x - self.left.x) < 0:
        inside = False
    if (self.right.x - self.top.x) * (pos.y - self.top.y) - (self.right.y - self.top.y) * (pos.x - self.top.x) < 0:
        inside = False
    return inside
#

I was just checking if the clicked position was less than the inner radius of my color wheel, which works ok but unintentionally grabs the triangle if just inside the circle but not colliding with the triangle, this fixes it

#

import pygame, sys
from pygame import Vector2

screen  = pygame.display.set_mode((400, 400))

center = Vector2(100, 200)

top = Vector2(39, 2) + center
left = Vector2(6, 57) + center
right = Vector2(72, 57) + center

def is_inside(pos):
    if (top.x - right.x) * (pos.y - right.y) - (right.y - right.y) * (pos.x - right.x) < 0:
        return False
    if (top.x - left.x) * (pos.y - left.y) - (top.y - left.y) * (pos.x - left.x) < 0:
        return False
    if (right.x - top.x) * (pos.y - top.y) - (right.y - top.y) * (pos.x - top.x) < 0:
        return False
    return True

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()

    screen.fill('black')
    buttons = pygame.mouse.get_pressed()
    if buttons[0]:
        pos = Vector2(pygame.mouse.get_pos())
        if is_inside(pos):
            pygame.draw.polygon(screen, 'red', (top, left, right))
    pygame.draw.line(screen, 'red', (top), (left), 1)
    pygame.draw.line(screen, 'red', (left), (right), 1)
    pygame.draw.line(screen, 'red', (right), (top), 1)

    pygame.display.update()``` quick example...edit: better example
spice tartan
#

the border around

limber veldt
#

No other chess game I've looked at has a border

#

So I ask again, what do you mean by border, I know what a border is but not what you mean

sinful field
#

Ok guys if anyone is wondering how to do 3d projection i have a script fully working available

limber veldt
#

Maybe a little too wide, it's 8px, could also try 4

#

And mitered corners

potent pebble
limber veldt
#

sys is builtin, Vector2 is a class from pygame

#

And that method or function should be able to work with any triangle but it doesn't, surely something buggy in the code, but it works for bottom aligned equilateral triangles and is all I need it for

dark vale
#

anyone know how i can import pygame into vsc

potent pebble
pine smelt
quasi hamlet
limber veldt
#

Yeah, sometimes I just raise sysexit or so

limber veldt
#

This function is working for all triangles that I've tested so far ```py

def is_inside(pos):
if (top.x - left.x) * (pos.y - left.y) - (top.y - left.y) * (pos.x - left.x) < 0:
return False
if (left.x - right.x) * (pos.y - right.y) - (left.y - right.y) * (pos.x - right.x) < 0:
return False
if (right.x - top.x) * (pos.y - top.y) - (right.y - top.y) * (pos.x - top.x) < 0:
return False
return True``` Going ccw on all checks seems to be working

sinful field
blissful grail
#

does any1 have any like 2d pixel game code made with pygame?

vagrant saddle
blissful grail
#

not commercial

pine smelt
#

u can prolly check past pygame game jams or others on itch too

limber veldt
#

Oh and oops, gotta resize my obs to the new window size

#

Moved/resized some elements slightly

limber veldt
#

Yeah I like it, thanks for the suggestion

#

Made a couple more and I think I'm calling it good enough, culled some boards and backgrounds too, keeping the dark color margins, losing all the lights, they just don't look good to me

#

And all the wood margins, goners

#

Just wood frames and boards now

#

And only three of them, light (like oak-ish, brown like walnut-ish, and red like mohagoney-ish

#

Also keeping what I'll call the three or four standard boards, just ivory colored light squares and dark blue, green, brownish, etc

#

And the two graphics boards, I'm not sure about keeping them yet

#

And I'll probably link the board to border change but not border to board. So like, if you change board, the boarder changes to match it but if you change border, the board doesn't change

#

Just so one can customize to their liking

blissful grail
#

how can i resize a image in pygame? ive done
pygame.transform.scale(player_standing, (50, 30))
but it doesnt work

pine smelt
#

u need to assign it to a variable

#

so

#
player_standing = pygame.transform.scale(player_standing, (50, 30))
blissful grail
#

does anyone perhaps know any free pixel art of a hotel

#

even one nice image

round lichen
#

Interesting ๐Ÿง

finite crow
#

Can anyone recommended a visual game engine. I got the AI already in place and the game engine and rules. But I want to build it with the idea to play it single player against the AI , AI vs AI and multiplayer. Im using pygame for the visuals right now.

minor cloak
covert rose
# finite crow Can anyone recommended a visual game engine. I got the AI already in place and...

i create a free 3d open source one(the game engine) using ursina and i will rewrite it using pyopengl soon if you want it check it out:

https://www.youtube.com/watch?v=cZEWxUdrvlw

i create an game engine in python using ursina in 8 days and i complete it later by working on it 4 more days.

my discord channel:
https//discord.gg/yMugmymnYz

add ":" between https and //

โ–ถ Play video
finite crow
finite crow
# minor cloak https://renpy.org is a visual novel game engine. Not sure if that's the kind of ...

For now I'm just thinking backgrounds I can snag for free, MTG related but they would just be digital game mats but also the board. Organizing the cards and stacks on that board and a mechanism to visualize your hard and interact with it and the board with valid actions. I guess I can leave placeholders in the meantime and try to flesh most of the visuals out first. uggh. sounds like a big undertaking. i know squach in this department.

limber veldt
#

I'd like to some day get into using 3d assets for 2d games, mainly for fx kind of things

finite crow
covert rose
manic totem
#

what does this mean
IndentationError: unindent does not match any outer indentation level

rotund tangle
#

e.g.
โœ…

print('hello')
if age == 30:
  print('meow')
else:
  print('woof')
#

โŒ

print('hello')
if age == 30:
  print('meow')
 else:
print('woof')```
floral quiver
#

Hello any ideas on why this movement wont work?

#
import pygame

pygame.init()

SCREEN_HEIGHT = 500
SCREEN_WIDTH = 600

screen = pygame.display.set_mode((SCREEN_HEIGHT, SCREEN_WIDTH))

run = True

player = pygame.Rect((250, 250, 50, 50))

while run:
    pygame.draw.rect(screen, (255, 0, 0), player)

    key = pygame.key.get_pressed()
    if key[pygame.K_a] == True:
        player.move(-1, 0)

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False

    pygame.display.update()

pygame.quit()
#

Its only meant to move in the left direction but it wont work

pine smelt
#

player.move() returns a rect object

#

ideally u should put player.move_ip(-1, 0), tho i would prefer player.x -= 1 in that sitation

#

also u should probably clear the screen every frame (screen.fill(some background colour)) or u'll end up with visual bugs

floral quiver
#

Let me try player.x -= 1

floral quiver
pine smelt
#

can u send ur current code

floral quiver
# pine smelt can u send ur current code
import pygame

pygame.init()

SCREEN_HEIGHT = 500
SCREEN_WIDTH = 600

screen = pygame.display.set_mode((SCREEN_HEIGHT, SCREEN_WIDTH))

run = True

player = pygame.Rect((250, 250, 50, 50))

while run:
    pygame.draw.rect(screen, (255, 0, 0), player)

    key = pygame.key.get_pressed()
    if key[pygame.K_a] == True:
        player.x -= 1

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False

    pygame.display.update()

pygame.quit()
pine smelt
#

it works fine for me

pine smelt
# floral quiver

these arent errors as opposd to suggestions to structure the code

floral quiver
#

oh okay i hadnt tested it assuming it was an error

pine smelt
#

u can simplify the "if key[pygame.K_a] == True:" to just if key[pygame.K_a]:

floral quiver
#

it does leave a trail tho

pine smelt
#

where?

floral quiver
#

I mean the rectangle leaves a trail

pine smelt
#

in ur gameloop add a line like screen.fill((0, 0, 0))

#

before ur draw the player

floral quiver
#

Thanks

pine smelt
#

so every frame it "clears" the screen and u redraw it

floral quiver
pine smelt
#

no u need a clock object

#

so maybe after u create the screen object, add

floral quiver
#

Import time aswell?

pine smelt
#
clock = pygame.time.Clock()

#inside the game loop
while run:
  ### all ur game logic
  ### ...

  pygame.display.update()
  clock.tick(60)
pine smelt
floral quiver
#

Great thank you

floral quiver
pine smelt
#

uh on and off for a couple years now

dusty breach
finite crow
finite crow
#

Hmm, what about a symbolic RL reward calculator. It would be like hyperparameter tuning except the difference is you build the symbolic engine with the idea trying different formulas and keeping the best ones.

#

sorry I should ask this in the AI channel.

glossy scarab
#

I wanna get started on game dev how can I ping me if you wanna help

covert rose
#

just tell me what your needs in my dm and what you aim for.

finite crow
covert rose
floral quiver
#

is there any sort of delta in pygame as in no matter the fps the movement stays the same? becuase at the moemnt the mroe fps you get the faster the moevemnt is..

limber veldt
#

Pygame has pygame.time.Clock() that is used for timing. CLOCK = pygame.time.Clock() somewhere in your program initialization and in the main loop, something like CLOCK.tick(60) to maintain 60 fps

#

If you want or need deltatime, I get it like this dt = CLOCK.tick(FPS) * 0.001

#

With FPS assigned to a variable holding my desired framerate

floral quiver
limber veldt
#

Because I want it in milliseconds, the return is in seconds

floral quiver
#

That makes sense

floral quiver
limber veldt
#

Subclassing pygame.sprite.Sprite() or any part of pygame really. I often subclass sprite() and Group() for my own purposes

floral quiver
limber veldt
#

Sure

#

For pretty much all sprites, I subclass .Sprite() so I can take advantage of pygame.sprite.Group() drawing and updating

#

And sometimes even subclass from there to make specific sprites from general

floral quiver
#

So you could have like a class to show what is in the players inventory or liek the movement speed, or jumping power...

limber veldt
#

Sure enough, I happen to make just about everything a class

floral quiver
#

interesting I am really new to python only about 1 week in id say some im really just trying to soak up the info I can!

limber veldt
#

Organizing behaviors into objects they belong to helps me keep thing organized to some degree anyway

#

Just as an example, and with the condition that I'm no pro (just a hobbyist), this shows an AnimatedButton() class and a few subclasses of it. It's just a button that changes image when clicked and changes back by itself after some short delay, and gets an argument action that is a method or function called when clicked https://paste.pythondiscord.com/I4OA

floral quiver
#

Any Ideas why this will not work? Its meant to close the window when you press the X

import pygame
pygame.init()

HEIGHT = 500
WIDTH = 500
BLACK = (0, 0, 0)
window = pygame.display.set_mode((HEIGHT, WIDTH))
clock = pygame.time.Clock()
running = True

while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running == False

    window.fill(BLACK)
    pygame.display.flip()
    clock.tick(60)

pygame.quit()
limber veldt
#

The == is a comparison operator not an equal like a single = for assigning

limber veldt
#

I think of the double equal in my head as 'is_equal` since it returns only two possibilittis, True or False

limber veldt
#

I tend to follow that as convention when naming methods or functions that return only a bool, not always though

manic totem
#

i got another error message that i never see before again today. do you also know what this mean
TypeError: 'builtin_function_or_method' object is not subscriptable

proper peak
#

!e it means you tried to subscript a function.

max[5]
frank fieldBOT
manic totem
#

subscript?

manic totem
#

what does this mean

#

TypeError: invalid destination position for blit

glass light
#

Hoping this doesn't get deemed spam but here's a clip of a game I've been working on in Pygame ๐Ÿ™‚

#

Slight Bomberman inspiration but also taken a lot from more modern and difficult games (binding of isaac, celeste etc...)

mystic plume
glass light
#

Thanks!
It'll be another year or so at this rate. Lots of mechanics ๐Ÿ˜„

limber veldt
limber veldt
#

Pretty quiet channel and just seeing others posting projects is fun for me

pine smelt
#

been pretty busy to work on anything substantially and send here

#

i will be entering the new pygame jam tho when that starts (i think in november?)

covert rose
slow copper
#

That's really cool

glass light
#

Love the pixel art on the releases page

raven kernel
#

who drew that

#

john carmack?

covert rose
#

dont forget to leave a star if you like the simple engine!

covert rose
#

i will add more assets + nav mesh + human npcs later on!

covert snow
#

No pygame window is even showing up when I run but I can see that the classes are correctly running due to a print statement I added

#

I am following this tutorial is that is helpful https://youtu.be/WViyCAa6yLI?si=4hSt3GtlY4nIPERy

Did you play too much SNES as a kid? Have you been raised by Nintendo and Mario? Time to remake the most famous game of that generation! For this beginners tutorial we will use pygame to create a Mario style platformer game that includes an overworld as well.

Thanks to Brilliant for the support, you can find them here: https://brilliant.org/Cl...

โ–ถ Play video
#

Many thanks in advance

limber veldt
#

Have you tried running any other pygame code, like something known to work, and does it create a window?

covert snow
#

Yeah, I oppened a different project and it worked

#

It's not like it even opens then immediately closes. Just nothing happens

limber veldt
#

I'm not familiar enough with that project so can't say when it should start working

covert snow
#

There's one thing I think may be related

#

So randomly I kept getting some error from nowhere that I had to fix by changing the audio driver

#

After that, no window opened

ivory cloak
limber veldt
#

Yeah, I saw that over in Clear's server, quite strange

covert snow
#

So I'm wondering if something on pygame has gone wrong and impacted the project

#

Because it was a random audio error (I haven't even touched pygame audio yet) that appeared for seemingly no reason

#

Maybe that was the only visible issue

#

I think it was something to do with ALSA?

limber veldt
#

Might try reinstalling pygame-ce

#

But I don't know, worth a try though

covert snow
#

Might as well

limber veldt
#

Or continue trying to troubleshoot by trying other working code again, after having these driver issues

covert snow
#

Since my other project hasnt had these issues, they seem to be on pygame-ce's part I'll try reinstalling when I get the chance

#

Thanks for the help though

limber veldt
#

I wonder if there was an older version of pygame in your system before installing this one?

covert snow
#

Ooh, possibly

#

Tbh i never uninstalled pygame when I installed CE so it could be that

limber veldt
#

Because there could be conflicts there, installing -ce beside non-ce might be an issue

covert snow
#

I'll give it a look

#

Thanks

limber veldt
#

That's the general advice I've seen with installing -ce, to uninstall the old first

covert snow
#

so, i tried unistalling pygame and it said it skipped over it beacus eit wasnt installed. i then unistalled and reinstalled pygame ce and same issue

limber veldt
#

Sorry man, beyond my troubleshooting skills at this point, but I still suspect there's a conflict from an old installation somewhere

#

If other pygame-ce code works and this code doesn't, that makes me think it's project specific so comparing your code to Clear's would probbaly be my next step

covert snow
#

Without the audio driver chnage i get these errors

@covert snow โžœ /workspaces/Silver-Dofe (main) $ cd /workspaces/Silver-Dofe ; /usr/bin/env /home/codespace/.python/current/bin/python3 /home/codespace/.vscode-remote/extensions/ms-python.debugpy-2024.12.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 47991 -- /workspaces/Silver-Dofe/code/main.py
pygame-ce 2.5.1 (SDL 2.30.6, Python 3.12.1)
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default

#

so uh,

#

ive fixed it

#

ive just cloned my repo

#

and ran it somwehre else

#

now it works i guess

#

thanks so much anyway

limber veldt
#

Well, both the members here I know who might know anything about this are not currently online...

covert snow
#

do you know why that fixed it?

limber veldt
#

No idea, but awesome

covert snow
#

doesnt have the audio driver problem aswell

limber veldt
#

That's a great tutorial, glad it's working for you (no I haven't done that one myself)

#

But I have watched it

covert snow
#

granted, now im having commit isuees

limber veldt
#

I watch all of Clear's releases

covert snow
#

so i dont think i can use codepaces now?

#

im not to experience with git stuff but thats where the issues are

limber veldt
#

You're more experienced with it than I am, so maybe others know

covert snow
#

well i can still commit to agit hub repo with or without codspaces so i odnt hink it really matters

covert snow
#

so, ive deleted my codespace then created a new one from my working code. That codebase has the exact same issue as the first one

#

im really confused

#

guess no codespaces for me

icy vale
#

Yo

#

Should i directly jump into game dev with python

#

With some basic knowledge such as functions statements etc

#

Or stick to normal python coding

glass light
#

Learn Python for a bit first

#

Get a good grasp then try some arcade games to start. Pong etc

limber veldt
#

Same advice here, having at least some understanding of classes and objects helps a lot

smoky kindle
#

Hi guys

limber veldt
#

Hi

smoky kindle
#

Whatsup?

limber veldt
#

Just refactoring some ideas

smoky kindle
limber veldt
#

There are a couple of things I don't like about some of my code, so re-imagining some of it

#

And one main issue that still needs fixing

smoky kindle
limber veldt
#

It's a chess game with undo and redo moves, right? I want to mass undo/redo to any state in the moves-so-far list, and it's almost working but not quite

smoky kindle
#

Oo i see!!

limber veldt
#

Undo/redo both work fine on their own but I want them to work faster, like in an iteration, like a while loop

smoky kindle
#

Btw i'm not a game developer!! But a web designer!! pithink donโ€™t mind it

limber veldt
#

I get it, each does their own thing, I like game dev as a hobby

smoky kindle
manic totem
#

why i cant blit the enemy

enemy = pygame.transform.scale(pygame.image.load("game assets/enemy.png"), (50, 50)).convert_alpha()
enemy_mask = pygame.mask.from_surface(enemy)

enemy_list = []

#Timer
game_timer = pygame.USEREVENT + 1
pygame.time.set_timer(game_timer, 900)

#game while loop
run = True
game_active = True

while run:
    clock.tick(60)


    for event in pygame.event.get():
        if event.type == pygame.QUIT:
                run = False    
        
        #if event.type == pygame.MOUSEMOTION:
            #print(event.pos)
        if game_active:
            if event.type == pygame.MOUSEBUTTONDOWN:
                if jump_rect.collidepoint(event.pos):
                    gravity = -15

            if event.type == game_timer:
                enemy_list.append(enemy_mask.get_rect(bottomleft = (500, 370)))

        


    if game_active:
        #background
        screen.blit(sky, (0, 0))
        screen.blit(ground, (0, 530))
        #pygame.draw.line(screen,'Red',text_rect.topleft, text_rect.bottomright)
        
        #enemy
        #enemy_rect.left -= 5
        screen.blit(enemy, enemy_list)```
#

ignore those codes lines that i commented. i've been practicing some stuff

glass light
limber veldt
#

I haven't but I'll check it out

#

Thanks

limber veldt
manic totem
#

oh i see

limber veldt
#

And you're gonna need a guard before blitting that

manic totem
#

i need to make it as tuple first

limber veldt
#

Because if the list is empty, it's an index error

manic totem
#

does that apply to other stuff

limber veldt
#

What?

limber veldt
#

Or learn to use sprites

#

Look at your code, enemy_list = []

manic totem
#

yup that my code

limber veldt
#

If you try blitting something at index 0 into that empty list, it will be an error

manic totem
#

so how do i fix that

limber veldt
#

Put a guard

manic totem
#

what is a guard

limber veldt
#

Something like if enemy_list: before trying to blit something there

manic totem
#

oh ok

limber veldt
#

That will test if there is anything in the list

#

If there is, blit, if not, don't blit

#

Sprites and groups man, really

#

Really really really

#

See, pygame.sprite.Group() can be drawn any time and it will draw whatever is in the group, if it's empty, nothing will happen

#

It's basically a list of sprites that the group can update and draw. if nothing is in it, it does nothing and you can skip this kind of guard

manic totem
#

ah ok

limber veldt
#

So it's a container for as many sprites as you want to add to it

#

It's a little advaanced stuff, like learning how to subclass pygame sprites but don't let that discourage you, it is not that hard

manic totem
#

i'll gonna do that later. rn im really some more simple stuff like timer for now

blissful grail
#

hi

#

anyone have base code for a minecraft client?

vagrant saddle
#

sounds like pyCraft

honest heron
#

@limber veldt how did u become so good at programming in python

limber veldt
#

I'm not that good, but maybe good at finding how to do some things

#

As with almost anything, it just comes down to practice everything you discover and keep discovering