#game-development

1 messages Β· Page 63 of 1

vestal vessel
#

how do u make these kind of artstyle

#

for 3d model

#

this dude oskar stalberg is freaking cool

#

his works are so mesmerising

lapis raven
#

How would I go about making a double jump feature in pygame?
This is my code for jumping
sprites.py

    def jump_cut(self):
        if self.jumping and self.vel.y < 0:
            self.vel.y *= 0.5

    def jump(self):
        # Check For Platforms
        self.rect.y += 1
        hits = pg.sprite.spritecollide(self, self.game.platforms, False)
        hits_1 = pg.sprite.spritecollide(self, self.game.small_box, False)
        hits_coin = pg.sprite.spritecollide(self, self.game.items, False)
        self.rect.y -= 1
        if hits and not self.jumping:
            self.game.jump_sound.play()
            self.jumping = True
            self.vel.y = -PLAYER_JUMP

        if hits_1 and not self.jumping:
            self.game.jump_sound.play()
            self.jumping = True
            self.vel.y = -PLAYER_JUMP

main.py

    def events(self):
        # Game Loop - Events
        # Game Loop - Update
        for event in pg.event.get():
            # Closing Window
            if event.type == pg.QUIT:
                if self.playing:
                    self.playing = False
                self.running = False
            if event.type == pg.KEYDOWN:
                if event.key == pg.K_w:
                    
                    self.player.jump()

            if event.type == pg.KEYUP:
                if event.key == pg.K_w:
                    self.player.jump_cut()

Any help would be good

#

I've tried a lot of things but they don't work

fervent rose
#

@vestal vessel like you'd do any kind of 3d modeling tbh, you start with some primitive, extrude into all the different tower, bevel all this sh*t, make the roofs with a mirror modifier because you're lazy, add the stairs and the other details (windows, thingys on the roofs, doorways...) and then texturing

#

Although thanks you, because this is going into my inspiration box lemon_fingerguns

vestal vessel
#

Ahh sweet thnx for the info sounds easy lol. Hopefully its ez as u make it sound haha. N ur wc

#

Textering seems the harded :()

fervent rose
#

IMO it is the easiest here

#

With some very basic technique you can do some cool stuff

vestal vessel
#

Wait have u told u it can be procedurally generated

#

Wait let me pop the link for u

fervent rose
#

For instance, I did this a lil while ago, it is entirely procedural using only two kind of nodes, voronoi noise and color ramps (and some base nodes)

vestal vessel
#

freakk looks pretty neat n hot

fervent rose
#

Thanks lemon_pleased

vestal vessel
#

u make it sound ez coz u know lot about it lol

fervent rose
#

I don't know that much about blender tbh

vestal vessel
#

how do u do this lol

#

sorry for asking too much questions

fervent rose
#

It took me an hour last time to make a freakin' stair because I had only 3 faces and I was struggling haha

#

Can you screenshot it, I'm on mobile please ?

vestal vessel
#

haha well im just getting in 3d modeling

#

let me send u a video then

#

the most fascinating thing about it is

#

when u actually destroy the middle bit

#

it will implement the structure the whole structure based on that

#

but i wanna implement more of earlier artstyle on this. well thats not the issue atm haha

fervent rose
#

The video doesn't play smh

#

But I'm guessing based on what you place, it generates the rest of the structure?

vestal vessel
#

yes

#

? how do u accomplish that

#

its mp4 lul πŸ™ƒ

fervent rose
#

Phone says the video is corrupted

#

It might be the wavefunction collapse algorithm

#

Hold on

#

It generates a larger image based on a small sample

#

This algorithm is crazily simple but awesome

#

There's a "Higher dimensions" section at the end

vestal vessel
#

i misunderstood, its not what i meant

#

hmm

#

let me try another video

#

nvm freak the video

#

i wanna make something like the game townscaper is implementing ?? πŸ˜„

#

def gonna learn how to make the artstyle adapted with that game

#

this game arts really breath taking

fervent rose
#

Riiiight I see

#

Basically, for every square, you choose the asset you want to draw depending on the current type and the the neighborhood squares

#

You'd want each asset to be as modular as possible, so you can fit them together seamlessly

#

Sometimes you'd even have many modular meshes inside the same square

#

About the style of the game, it looks like low poly with some stylized drawing-like texture, if you want to Google that

vestal vessel
#

sweet!!! thnx heaps m8 u really helped me alot πŸ˜„

#

im gonna dig all the info now thnx again

fervent rose
#

Any time lemon_pleased

vestal vessel
unreal trail
#

hey

fervent rose
#

That's pretty cool, thanks

#

Hi glitched!

unreal trail
#

Hey im starting game dev

frank fieldBOT
#

Hey @dawn quiver!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

β€’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

β€’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

dawn quiver
#

Hey everybody :
I want to put some noises on my game with pygame and I have this error :
pygame.error: Unable to open file '/home/pi/Musique/pain.wav'
My Python is Thonny Python IDE
I tried to put ogg and not wav and its not good !
Please help me

#

And I insttaled the last version of pygame

#

I have this error since 1 year !

#

And I never understand

umbral crow
#

"Pygame (version 2.9 at least) doesn't support 32-bit float WAVs. Re-encode it to a signed 16-bit WAV (using Audacity for example)."

dawn quiver
#

ok thank you

#

I see you know the numbers hexadecimal

hasty geyser
#

@dawn quiver I am not the best at it

#

But I can understand a bit of it

#

So on the right side 0-9 decimal is represented by 0-9 hexadecimal only

#

While the letters A-F represent decimal 10-15

#

These are the 16 units

#

While as in binary system which consists of only 1 and 0

#

0 is written as 0000

#

1 as 0001

dawn quiver
#

hum okay

hasty geyser
#

2 as 0010

#

And so on till 9

#

A as 1010

#

Do you know how to convert decimal to binary?

#

@dawn quiver

dawn quiver
#

Hum not now

#

I don not do

#

Thx for ur explication

hasty geyser
#

Welcome man

dawn quiver
#

where ?

#

A sry

#

lol

#

I like ur profile picture

valid trellis
#

HI... im ussing vscode and im getting "module pygame has not init member" Does someone know how to fix it?

umbral crow
frank fieldBOT
grand patrol
alpine nebula
#

Hey,
I need help with making curve line in pygame.

zealous estuary
#

Im so cool i joined a python group and i only know lua 😎

potent ice
#

You have done some programming then. Easier to learn a new language πŸ™‚

hasty geyser
#

I like ur profile picture
@dawn quiver thanks man it’s my little friend

royal halo
#

so im making a text rpg game

#

and i want to make it so that

#

whenever they type in "stats"

#

it shows their stats

#

is the only way to do this putting an if statement after every input

#

or is there a way to just set it so that its for any input

vestal vessel
#

like in command line?

#

wym?

#

can u be more descriptive haha ?

dawn quiver
#

T'habites ds le coin ou quoi

acoustic gulch
#

whats the best ide for game development?

near wedge
#

If you're looking for a Python IDE, PyCharm is a good one. I wouldn't say there is a "best".

#

VS Code is also a good editor with a lot of plugins available.

acoustic gulch
#

alright thanks

night bluff
#

vim, vscode, pycharm πŸ˜‰

#

The first two are more like advanced editors while pycharm is a full IDE

#

What options do I have for rendering a huge point cloud (realtime) in python? Each point is a circle with varaible size and color. Need to be able to explore it.

#

I know this is more related to rendering than games in general

near wedge
#

@night bluff I am guessing you'll want a 3D representation of the point cloud? Panda3D would be my go to, but I haven't played around much with the other options (e.g., Pyglet, ModernGL, Ursina).

night bluff
#

Thanks! I will take a look πŸ™‚

prime schooner
#

Hi, here is a question for someone who knows pygame !

I am doing a pac man but when I move my pacman, the older view still there.

Here is the code to move the player:

    def move(self):
        self.pos[0] += self.dir[0]
        self.pos[1] += self.dir[1]

        self.draw()

    def draw(self):
        self.window.blit(self.image, py.Rect(self.pos, self.size))

(self.pos is a tuple representing the position)
(self.dir is a tuple representing the direction equal here to (1, 0))

I am searching where is the problem in my code but... I don't find at all

umbral crow
#

how many self draws() do you have

prime schooner
#

the first code is in a class called Player and the second in class Level

untold garnet
#

@dawn quiver tu parles fr dans un serv avec une commu 99% anglophone

prime schooner
#

mdr

#

ok sorry I find the problem, I just forgot to draw the background on the beginning of the frame x)

dawn quiver
#

a

placid wigeon
#

I need help with math for my game

#
else:
     percentage = (self.groupgathering / self.difficulty) * 100

     if random.randrange(0,100) < percentage:
       self.success()
     else:
       self.failure()
#

If the player's skill in that particular task (groupgathering) is lower than the required level (difficulty)

#

the player can still attempt to do it and have some % chance of succeding

#

depending on how close they are to the difficulty

#

however, it always fails, no matter what, even if the percentage should be eg. 97%

#

It should almost always suceed in that case, but it doesn't work

#

it always fails even after minutes of trying

acoustic gulch
#

guys is the tkinter module alright for python game development?

placid wigeon
#

I have no idea why this doesn't work

#

I tried to hard-code some values such as eg. to check if it's exactly 50% of the difficulty

#

and then it works and sometimes fails and sometimes suceeds

#

but when I try to make a general one like this

#

it always fails

umbral crow
#

do you have an idea of what groupgathering and difficulty values are?

placid wigeon
#

When you assign characters to a particular task, their individual gathering skill in that particular resource is added to the tasks's groupgathering attribute, because you can assign more then one character to a task

#

eg. Character1 has 5 in food gathering

#

Character2 has 4

#

when you assign them both to the same task their skills are added together as the groupgathering

#

so you get 9

#

and the groupgathering is compared with the difficulty to see if the expediton succeds or not

#

the succeeding part works fine

#

but the failing part doesn't

#

It shouldn't matter how small the values are since this is percentage

#

25/50 and 2/4 are both 50%

sacred trout
#

You should print all those values to see if they correspond to what you think they are ;)

placid wigeon
#

πŸ€”

#

Alright

#

They are exactly as they should be

#

(I'm using Ren'py so can't conveniently print, but can do a narrator statement)

inner torrent
#

Hey, I’d like to build a google maps like feature with my own game map where you can click on pins and it’ll give you more data about that location or the player instantly travels to that location. It would be awesome if you could zoom in and out and the pins stay the same size... is that possible with pygame? Or is there another way to do it? Do you have any suggestions as to which libraries/functions could be useful for that? Thx!!

placid wigeon
#

@sacred trout I think... I found the problem?

#

If I print the percentage, it shows up as 0

#

even though it should be 50

#

Why isn't it correctly set to what it should be?

#
if self.groupgathering > self.difficulty:
  difference = (self.groupgathering - self.difficulty) * 10
    if random.randrange(0,100) < difference:
      narrator("You received a rare item! (" + self.name + ")")
    else:
      pass
#

This is my primitive version of the rare item check

#

I do it the exact same way as the percentage code

#

and it works

#

but here the percentage always stays as 0

#

Should make it an attribute of the class?

#

and then later clear it?

#

as an attribute used temporarily, like my groupgathering?

acoustic gulch
#

does anyone have a good pygame course

inner torrent
#

Depends on what you want to do, but I quite like the YouTube channel sentdex!

acoustic gulch
#

Alright thanks

#

does he have 2d rpg?

sacred trout
#

@placid wigeon its not the same thing, in the first one you have a division and in the 2nd one a subtraction (tho if you want a percentage the first is correct). I think you're using python 2 and dividing two integers, so you have integer division (Aka 2//4=0). Try converting one of them to a float

#

Or use python 3 :p

placid wigeon
#

Yeah, the Ren'py engine still uses Python 2

placid wigeon
#

It finally works

#

❀️

#

It was all because of Python 2 division

#

Thank you! @sacred trout

slender tulip
#

Hello, wanting to make a 3D card game where 3 random numbers are generated how can I make it so lowest number drawn it teleported somewhere

frank fieldBOT
#

Hey @keen marlin!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

β€’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

β€’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

keen marlin
#

oh

#

sorry!

vestal vessel
#

Hello, wanting to make a 3D card game where 3 random numbers are generated how can I make it so lowest number drawn it teleported somewhere
@slender tulip wdym like teleported somewhere ?? u want it to be hidden ?

#

and are u using unity for htis

#

this

potent ice
#

I doubt it's Unity because this is not really the channel for that sort of thing

keen marlin
#

Oh I solved the problem myself, it’s okay!

slender tulip
#

Like to an arena

potent ice
#

@slender tulip Have you started on this project? What libraries are you using?

#

If we don't know what tools you are using we can't really answer the question

slender tulip
#

πŸ•

#

Max!

potent ice
#

The dog can just eat the cards then πŸ˜‰

vestal vessel
#

Lol

green bough
#

what is the best place to learn game-development ? anyone

raw shadow
#

alone, in front of a computer with vscode open next to pygame.com

dawn quiver
umbral crow
#

@raw shadow πŸ˜†

tranquil girder
#

I expected a Python game

acoustic gulch
#

isn't it a python game?

tranquil girder
#

No, Unity

acoustic gulch
#

oof

potent ice
#

@tranquil girder you're the Ursina guy, right?

#

Jup. Looks like it πŸ˜„

acoustic gulch
#

hello

#

we all use it

#

well most of us

#

not really

fierce wraith
#

is thre a way to build 3d games in python?
Yes, but the engine choice is quite limited. You can use something like ursina or make your own "engine" using OpenGL bindings for python

acoustic gulch
#

import pygame

pygame.init()

display_width = 800
display_height = 600

black = (0, 0, 0)
white = (255, 255, 255)

gameDisplay = pygame.display.set_mode((display_width,display_height))

pygame.display.set_caption('Program')

clock = pygame.time.Clock()

carImg = pygame.image.load("Car.png")

def car(x,y):
gameDisplay.blit(carImg,(x,y))

x = (display_width * 0.45)
y = (display_height * 0.8)

crashed = False

while not crashed:
# --all event--
for event in pygame.event.get():

    if event.type == pygame.QUIT:

        
        crashed = True

gameDisplay.fill(white)
car(x,y)
pygame.display.update()
clock.tick(60)

pygame.quit()

#

can someone please explain why thats an error

#

and how i can fix it

dense creek
#

What error do you get?

#

Exactly?

#

And use ``` marks before and after the code so that it's easy to read and the indentation can be seen properly

acoustic gulch
#

well its not an error, its suppost to put a car picture on the screen but it just stays blank

dawn quiver
#

How do I make my screen resizable in pygame?

near wedge
#

@dawn quiver Panda3D, Ursina, Pyglet, and ModernGL are all options for doing 3D games in Python.

elfin frost
#

and pygame also, all are mentions in channel description

#

also check pin messages, there can be some useful thing there

acoustic gulch
#

@near wedge whats the best one, or the most used

near wedge
#

@acoustic gulch There is no "best one." Which one you use will depend on what you're trying to do. I am personally biased toward Panda3D for most use cases.

acoustic gulch
#

Alright thanks so much

hushed lynx
#

Hey guys, all right? this link is for my github. I'm developing a minecraft-style 2D survival game in python to be run on any Windows terminal. If you want to contribute to the project, feel free!

umbral crow
#

wait, how is that terminal?

#

ooh, its curses

gentle token
#

.

dawn quiver
#

@frozen knoll thx

dawn quiver
#

@hushed lynx damn thats nice

dawn quiver
#

lol

vast widget
#

so what engines do you guys use?

olive parcel
#

I use Panda3D

fervent rose
#

Unreal Engine

hushed lynx
#

@hushed lynx damn thats nice
@dawn quiver πŸ‘ πŸ˜†

frozen knoll
potent ice
#

ModernGL, but that's not for everyone πŸ˜…

#

Also Arcade and Pyglet

#

I think Panda3D might be the only one worthy of the "engine" label. Maybe also Arcade (2D). There rest are graphics libraries.

dawn quiver
#

hello les potes

fervent rose
#

Salut

#

Rule 4 is a thing though haha

dawn quiver
#

hello

#

salut les potes

dawn quiver
#

is pygame easier than flask?

umbral crow
#

Ursina is good

radiant ibex
#

how flexible is python

#

pygame*

proper peak
#

it has some pretty big limitations

radiant ibex
#

hm ok

proper peak
#

like, the most glaringly obvious one is that pygame doesn't use the GPU for graphics

#

which means it's much less performant than anything that does.

radiant ibex
#

i'm a new dev and i'm wondering what to use

#

ok

#

thanks

#

what engine should i use

#

for an 8bit 3d side scroller

proper peak
#

panda3d, for example.

radiant ibex
#

2d*

#

i meanst 2d

proper peak
#

arcade might be a good choice.

radiant ibex
#

ok

potent ice
#

Arcade is higher level library so at least easier to start with. Can be a spring board for trying out other graphics libraries or engines.

dawn quiver
#

Does anyone have much experience with Pyglet?

potent ice
#

@dawn quiver You can just formulate your question and post it. if no one responds you can always try the pyglet server

dawn quiver
#

I don't think they have a server I did have a look.

potent ice
dawn quiver
#

@potent ice thank you so much, I searched on discord and nothing came up!

#

I think Pyglet is a little out of my reach in terms of Python knowledge at the moment. I'm going to try Arcade which is built on top of it and seems to be a little more beginner friendly. I'll come back to it once I understand event dispatchers and things like decorators.

potent ice
#

Yes. It's higher level

#

You can always try pyglet later. A lot lot of the things you do in arcade is useful in pyglet as well.

#

Even pygame

dawn quiver
#

Pygame drove me nuts for some reason, took me ages to understand it because I've come from PICO-8.

#

I might give it another go, the steps to get stuff onto screen seemed to be a lot from what I remember.

#

I'm still pretty new to Python and was hoping to improve it by making games to drive my learning but a lot of stuff requires reading docs that don't seem to be in English haha

umbral crow
#

i just made a spike dodge game with arcade.
trying to figure out a way to increase a score counter +1 for every second passed

frozen knoll
#

Cool! Screenshot?

potent ice
#

@umbral crow sum up the delta time that is passed into on_update could be one way

vestal vessel
#

i didnt knew making comp display a triangle would be that hard ;-;

placid wigeon
#

Something very strange is happening with my lists

#

I have a system in my game where after the expedition there is a status report eg. (character1, character2 and character3 are now tired!)

#

This is achieved by creating a list of characters that are assigned to a specific task and then the first part is a string created with
', '.join that includes all elements of the list except the last one

#

which is then later summoned with the negative index

#

This works perfectly fine in one place, but in the other place the same code doesn't work

#

And some really strange things happen

delicate cliff
#

Well, what's the code, and what happens? @placid wigeon

placid wigeon
#

This is how this is implemented in the failure code, for example

#
            if len(self.list) > 1:
                self.result = ', '.join(self.list[:-1])
                self.characters_secondpart = self.list[-1]
            else:
                pass

        def failure(self):
            global injured_list

            self.report_generate()
            narrator("The expedition in search for " + self.name + " has failed!")
            if len(self.list) == 1:
                narrator(self.list[0] + " is now gravely tired!")
            elif len(self.list) >= 2:
                narrator(self.result + " and " + self.characters_secondpart + " are now gravely tired!")```
#

This works perfectly and just as intended

#

I have implemented a system where when an expedition fails, it's possible for characters to become injured

#

when a certain task fails and injuries occur, the characters that were assigned to it (eg. were in the list of characters assigned to a given task) are then added to a special injured_list

#

and a very similar code is in the injured() function

#

but it doesn't work as intended

#

I think it's something weird related to the .extend command?

#

For some reason, the characters from the assignment list are added to the injured_list once as elements, and then second time as a list within a list?

#

I have no idea why this happens

#
if month == "April":
                if random.randrange(0,100) < 99: #it's 100% probability for testing purposes
                    injured_list.extend(self.list)
                else:
                    pass```
#

this is the code responsible for adding the elements from a task list to the injured_list

#

extend should add the elements as actual elements, right?

#

Why does it do that and then adds the entire list again, but as a list?

#

I have no idea why this happens

delicate cliff
#

It says on line 18 in "injured" that you're making the call narrator(injured_list). But shouldn't that argument be a string, not a list?

#

@placid wigeon

placid wigeon
#

Yes yes, I did this just to show you the error message and the weird string in full

#

This is how it looks like in game

tired fjord
#

is unity good for developing in python?

placid wigeon
#

the list contains the elements of the other lists and then contains the same elements as a list within a list at the end

#

I have absolutely no idea why

#

@tired fjord Unity doesn't support Python

tired fjord
#

there is a way to use python in unity though

placid wigeon
#

@delicate cliff If I do this with two characters assigned instead of three, this happens

#

Something very weird is going on

#

I don't get why the list gets duplicated

#

the only code that modifies/adds something to it is the .extend command

#

otherwise it is empty

delicate cliff
#

If that injured_list.extend(self.list) is the only thing that modifies the injured_list, then you need to look further into self.list. Since .extend just puts the elements of self.list into injured_list, then self.list must at some point have a list as an element @placid wigeon

placid wigeon
#

But that's impossible, since when identical code is used to generate the general status report using only the self.list, it works just fine

#

With self.list it works perfectly

#

but with the extended injured_list the elements are somehow added twice

#

Maybe I should just try deleting the last element?

#

I don't know where it comes from but I can maybe just delete it?

#

Doesn't work

#

it deletes the last real element

#

but the duplicate is still created and can't be removed

#

What is going on here

last moon
#

there is a way to use python in unity though
@tired fjord not that I’m aware of, there are some libraries that use hooks to c(++) graphics stuff but nothing with unity/ue

placid wigeon
#

Maybe I can just try using the penultimate element instead of the last one?

#

It works if I use the penultimate element instead of the last one

#

I have no idea why this weird duplication happens but at least I can work around it

old vessel
#

can anyone help me with how to make my bullet go to the right in pygame(im clueless)

dawn quiver
#

Hein

#

Download a picture on internet

#

A png image

#

And change it with photoShop for example

#

It s that i do

old vessel
#

no

#

@dawn quiver i mean whats the code for it to go to the right

umbral crow
#

which library are you using? @old vessel

old vessel
#

im using pycharm and importing pygame

#

@umbral crow im trying to make it go to the right but i goes straight down

dawn quiver
#

do u have any example of basic game dev command ? or something like that

old vessel
#

?

proper peak
#

@old vessel sounds like you messed up the x and y axes, or something.

old vessel
#

ye

#

and i cant figure out what i have done

#

my bullet code

proper peak
#

don't compare stuff with is

#

you should have seen a warning about it, in fact

old vessel
#

with ==?

proper peak
#

!e

print(1001 is (1000+1))
frank fieldBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

proper peak
#

yes, with ==.

old vessel
#

ok

#

thanks

#

but still dont get why my ninja star is going straight down

#

:/

proper peak
#

because ammoX is actually getting passed as the y coordinate to draw ammo at, lol

old vessel
#

so what should i do?

#

:/

#

@proper peak

proper peak
#

not do that, presumably

umbral crow
#

πŸ’

old vessel
#

idk what to change, can you show me, would be appreciated ^^

umbral crow
#

so you want the bullet to shoot from player location?

old vessel
#

yh

umbral crow
#

is it already doing that?

#

but its going down

old vessel
#

ye but from the top of the screen

proper peak
umbral crow
#

maybe you should put playerY there

proper peak
#

uhh, probably it should be ammoX,ammoY

old vessel
#

on the bottom?

proper peak
#

and ammoY can just be playerY if it's constant.

umbral crow
#

i mean in fire_ammo(playerX, ammoX) change ammoX to playerY
so that it spawns there

old vessel
#

ok done that

#

it spawns on him now

#

but doesnt move

#

what im i doing wrong that its no moving to the right

proper peak
#

uhh, probably it should be ammoX,ammoY

teal oyster
#

hi so im making a game and i want it to split out in too directions can someone help me with that

umbral crow
#

@teal oyster what do you mean?
edit: do you mean like 2 story paths?

teal oyster
#

yes

#

@umbral crow

#
    d1a = input ("\u001b[31mHe has no idea what will happen to him if he eats that he'll be ours.\n\u001b[37mSorry about that, heres your BLT, enjoy\n A)Ask your waitress what she was talking about\n B) Say thank you: ")
umbral crow
#

a whole lotta if else statements - yanderedev

teal oyster
#

?

umbral crow
#

not an expert but something like

if d1a == "A":
    print("Outcome 1")
elif d1a == "B":
    print("Outcome 2")
else:
    print("invalid choice")

not sure if you can use Try/Except here either

teal oyster
#

what about making different paths

umbral crow
#

maybe you can also assign diff values with the choices
ex
you define some variable with a bool
BLT = False
if the player took the BLT, you would make the variable True and if they didnt then you leave it at False
then you can check on the value and execute the right path

teal oyster
#

im kinda new at this could you put it into the code?

dawn quiver
#
walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R7.png'), pygame.image.load('R8.png'), pygame.image.load('R9.png')]
walkLeft = [pygame.image.load('L1.png'), pygame.image.load('L2.png'), pygame.image.load('L3.png'), pygame.image.load('L4.png'), pygame.image.load('L5.png'), pygame.image.load('L6.png'), pygame.image.load('L7.png'), pygame.image.load('L8.png'), pygame.image.load('L9.png')]
bg = pygame.image.load('bg.jpg')
char = pygame.image.load('standing.png')
``` isnt working for me, all the pics are in the same folder as my file
#

nvm fixed

valid trellis
#

Hello There, i Hope you all are good, i have a question and i need peple who have been programing for a while... The thing is that i want to make game-development, and i have been learning python for 1-2 months... making web pages with html and css but now i want game-dev so ΒΏshould i stay at python or should i change to another leanguage more game-dev friendly...?

frank fieldBOT
#

Hey @odd kelp!

It looks like you tried to attach file type(s) that we do not allow (.zip). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg, .webm, .webp, .m4a.

Feel free to ask in #community-meta if you think this is a mistake.

odd kelp
#

ah

supple lichen
#

Which libraries can you suggest for making games

#

?

fervent rose
#

arcade for sure lemon_pleased

potent ice
#

Depends what kind of game and how experienced you are

dawn quiver
#

what is best game engine for python

sinful vine
#

That depends on what you want to do, @dawn quiver

#

RenPy is a very nicely made engine for visual novels, and is very extensible and customizable if you're experienced with python

#

Right now I'm working on an RPG in it

#

pygame is a common choice for games with more real time interactivity, although I have next to zero experience with it personally

#

There is a 3D game engine for python as well, Ursina

#

There is a 3D game engine for python as well, Ursina

#

Although again, I have very little experience with it

#

(python-specific game engines generally don't compare to more modern game engines such as Godot or Unity)

fierce wraith
#

If you already know OpenGL or want to get into it there are great wrappers and libs for it, such as moderngl

sinful vine
#

Cool, I'll make note of that next time I have time to play around

dawn quiver
#

thanks

spare phoenix
#

whats a good module to go along with pygame for better gui

low lagoon
#

Been making a game using tkinter (I know, don't ask) and this code is in charge of binding the keys to movement

    Game.bind("<KeyPress-a>", lambda *args: getaxis(-1))
    Game.bind("<KeyPress-Right>", lambda *args: getaxis(1))
    Game.bind("<KeyPress-d>", lambda *args: getaxis(1))
    Game.bind("<KeyPress-Up>", lambda *args: Jump(-7))
    Game.bind("<KeyPress-w>", lambda *args: Jump(-7))
    Game.bind("<KeyRelease-Left>", lambda *args: getaxis(0))
    Game.bind("<KeyRelease-a>", lambda *args: getaxis(0))
    Game.bind("<KeyRelease-Right>", lambda *args: getaxis(0))
    Game.bind("<KeyRelease-d>", lambda *args: getaxis(0))```
but changing directions quickly just makes the character stay still. Is there a fix, like Unity's Input.getaxis?
pale falcon
#

Is there a way to do a full workflow test on an online game using Python?

dawn quiver
#

What game developer use

low lagoon
sacred trout
#

Wow nice work! ☺

low lagoon
#

thanks!

vapid path
#

I can do better:

System.out.println ("Hello world")

#

jk it's really nice

limpid gyro
#

making a drag racing game is hard for me

#

I can do better:

System.out.println ("Hello world")
@vapid path is there a java module that looks like pygame

summer timber
#

woah you make me wanna learn python

#

like seriously this is good

graceful marsh
#

!tempban 697772507142291456 14d I don't know what made you think you could repeat the offense 1 minute after you were told by an admin not, but it seems you're here just to advertise. If you want to be part of the community, make sure to read our rules before coming back

frank fieldBOT
#

:incoming_envelope: :ok_hand: applied ban to @vapid canopy until 2020-09-22 21:08 (13 days and 23 hours).

idle salmon
#

The rules around here seem very complicated

icy quartz
#

Is it possible to make games with just Microsoft Visual Studio 2019?

dawn quiver
#

i think so

dawn quiver
#

ye with unity I did for 2+ years

teal ember
#

where to get started with game dev with python

dawn quiver
#

Sinse when can you make games with python c# with unity sounds more easy comparing to python

inland berry
#

You can technically but a lot of the popular modules related to it aren't that peformant and great, like pygame

dawn quiver
#

So would you have to code every block? Like back with how they made original super Mario

near wedge
#

@dawn quiver I'd start by seeing if any of the libraries in the channel topic meet your needs.

#

Oops, wrong user

#

@teal ember ^

teal ember
#

ok

vestal vessel
#

freak trying to make a game engine urself as a newbie feels like going against 100_000 level boss as level 1 character

#

;-;

dawn quiver
#

because it pretty much is

vestal vessel
#

atleast i learned more about opengl and creating shaders using it haha

#

equiping items to slay the 100_000 level boss

#

πŸ™ƒ

dawn quiver
#

are you making a game engine or did u already make one?

vestal vessel
#

i mean like i did plan to make one

#

but just catching with all the necessary knowledge needed for it

#

in rust πŸ˜„

sacred trout
#

Oh yeah rust 🀘

old vessel
#

hey can some one explain this to me?

#

for b in range(len(ammo)):
ammo[b][0] += 10 # change this to change speed and direction

for bullet in ammo[:]:
    if bullet[0] < 0:
        bullets.remove(bullet)

for bullet in ammo:
    screen.blit(ammoimg, pygame.Rect(bullet[0], bullet[1], 0, 0))
umbral crow
#

in screen blit, pygame.rect is storing the x and y values of bullet
so in the first for loop, each bullet's X in the list ammo, is being updated += 10
the 2nd for loop is just removing the bullets if their X is less than 0 or maybe offscreen

old vessel
#

how did it make my code work?

umbral crow
#

i have no idea, its a miracle

old vessel
#

do you actually not know?

umbral crow
#

yes

old vessel
#

oh

#

why is it ammo[b]

sacred trout
#

You'll getter better help with more specific questions like "why is it ammo[b]" πŸ˜‰

#

why is it ammo[b]
@old vessel ammo apears to be a lis of bullets

old vessel
#

but why the b

sacred trout
#

so to get each bullet you do ammo[b]

#

the b is an index

#

It would be cleaner to do for bullet in ammo and then replace the ammo[b] by bullet

old vessel
#

what about the range

sacred trout
#

I suggest that you do help(range) in a python intepreter. Looking at the docs is a good way to understand what things do

old vessel
#

docs?

sacred trout
#

documentation ^^

old vessel
#

where

sacred trout
old vessel
#

what do you suggest the easiest way of learning pygame is?

sacred trout
#

I have the feelingthat you don't know much python, so a good thing you to learn a bit of python first, by doing simpler things than pygame, and once you are more confident with python, learn pygame and have a whole new range of challenges

#

A lot of people suggest Automate the boring stuff with python to learn the langage, but really pick any tutorial and try to have fun and make things that you like

blazing heart
#

piggybacking off of that... i do have moderate experience with python. how would I lean to use Pygame?

#

Maybe not moderate, but midweight

sacred trout
#

Depends on how you like to learn though

low lagoon
#

what's the point in making my game when no-one plays it anyway?

cold storm
#

grind son

#

grind.

#

the good tree grows around all obstacles @low lagoon

#

@blazing heart check out upbge fork of blender

#

it's pretty powerful too

low lagoon
#

I'm not a t r e e

umbral crow
#

how is this tree typing in chat?

hallow agate
vestal vessel
#

How long do u reckon creating one 3d character after u got all the drawing done ?

#

Would take?

dawn quiver
#

depends on your experience

#

if you have no experience probably a day or two

vestal vessel
#

hmmm

#

im a newbie

fervent rose
#

Depends on the style

#

If you want a good high poly character based on a drawing, assuming you’re a complete beginner, quite some time

#

I’d say a week at 5-6h a day

vestal vessel
#

hmmm i c πŸ˜„ thnx guys

#

to be exact something like this

#

its high poly lol

dawn quiver
#

you drew that?

fervent rose
#

Okay, unnhhh, may I raise that to a month at 8h a day? πŸ˜„

vestal vessel
#

No lol I wish but in future I will.. Oh well thnx for info akπŸ™ƒ

fervent rose
#

Have you followed any blender tutorial yet, like the donut tutorial? lemon_pleased

vestal vessel
#

No

#

Not yet

#

I'm making house atm

#

Haha

#

But making donut is ez

#

Just chuck in torus

#

N it's donut

#

N learning substance designer n painter

fervent rose
#

Oh trust me, making a photorealistic donut isn’t that easy

#

You should give it a try

vestal vessel
#

the texturing, coloring, pbr, pbi can stay away atm

fervent rose
#

Eeeeehhh

#

I think it is a good idea to still know how they work

vestal vessel
#

but im going stylised pbr artstyle

fervent rose
#

For example, it is easier to unwrap your model before applying any clothe sim

vestal vessel
#

hmmm

#

k now that sounds tempting

fervent rose
#

3d modelling is very much about planning, or you will end up stuck at some point

vestal vessel
#

i will keep that in mind thnx heaps for ur valuable insight

#

added that to list of tuts

#

now lol

#

rip tuts hell

fickle maple
#

Started 2 game developement codes

#

and many basic level codes

#

\

dawn quiver
#

does anyone know the code for the snake game in python idle

shrewd phoenix
#

hi, i tried to use pygame and it doesn't work but in the idle it does (im using pycharm)

potent ice
#

They are probably using different python versions?

shrewd phoenix
#

i only have installed python 3.8, ive checked and pycharm uses the same version

proper peak
#

@shrewd phoenix PyCharm uses a virtual environment for each project by default. Did you install the package into the venv as well?

shrewd phoenix
#

im pretty sure i did

potent ice
#

Then please describe what "it doesn't work" actually means πŸ™‚

sacred trout
#

But what is the error that you get ?

shrewd phoenix
proper peak
#

Uhh, do you have errors when launching, or does PyCharm just say you will?

shrewd phoenix
#

i dont have any errors when launching pycharn

proper peak
#

So what are these lines that you show?

shrewd phoenix
#

warnings from the python file

proper peak
#

...so, do you have errors when running the program or not?

shrewd phoenix
#

when i try to run the program it just opens and closes

frozen knoll
#

@shrewd phoenix Make sure you don't have a file named pygame.py in your project.

#

It'll import from that instead of the pygame package if you do, and cause similar errors.

shrewd phoenix
#

hmm okay

#

thank you for explaining my stupidity in such easy to understand way

supple rune
#

I need help making a dice game

#

but it doesn;t let me paste my code

frozen knoll
#

Not stupidity, no way to know that "magically".

supple rune
#

anyone help me with why my hash is going wrong

#

and anyway to fix and improve my little dice game

sacred trout
#

You can use a pasting service to share your code

pale falcon
#

hey everyone, do you guys know a way to test a full workflow of a python online game

valid trellis
#

Hello there... Im thinking to get into python Game Dev... And i would like to know the capacity of python to game dev... So would some of you guys show me the best game you have made? It will be very usefull

molten niche
#

this what i got so far

dreamy swan
#

Nice!

umbral crow
#

@valid trellis just look at pyweek games

dreamy swan
#

I might be being a noob, but is there a tutorial for snake using turtle?

#

Nvm

dawn meadow
#

lol

rustic eagle
#

I use unity

#

to develop my game

dawn quiver
#

I'm trying to make a game with pygame, i tried the examples to download/test pygame and they don't work. I don't know if pygame is installed or not but my python version is 3.7.8

any solutions?

sacred trout
#

What errors do you get ?

#

If you can't import pygame in a console, then pygame is not installed

dreamy swan
#

ok, so I am using a tutorial to make snake in python, but the keys are not working at all...

#

there are no errors

molten niche
#

hey im trying to make snake using python and turtle can anybody help me make the tail vanish after it

dreamy swan
#

how did you get the input to register?

#

I am having trouble with that haha

molten niche
#

i use a library called keyboard

dreamy swan
#

ah

molten niche
#

u have to install it

#

this its an if statement:

if keyboard.is_pressed('F'):
print("F off")

dreamy swan
#

so close to what I have
so pip install keyboard in my console?

molten niche
#

i have to do it like
py -m pip install keyboard

dreamy swan
#

so ya

molten niche
#

i am using turtle for the graphics bc i have some experience in it

dreamy swan
#

still having the same issue... ugh
it is refusing to take my inputs

paper lodge
#

So i normally use unity but want to do a text based mmo with some minor graphical elements in python. What are some packages youd suggest i look at to accomplish this.

dreamy swan
#

Turtle will work, as will pygame, arcade

molten niche
#

alright so snake didn't work out because turtle bad

dawn quiver
#

Dont use turtle

#

Use pygame is better

#

Turtle is for the kids :)

dreamy swan
#

But pygame isn’t as good for visualizing scientific models...

jade kettle
#

Hey there, can anyone tell me how I can make a gif move threw my screen?

spiral holly
#

Gaming dev library's besides pygame and arcade??

somber bramble
#

guys, anything about resource-based strategy games? for browser?

near wedge
#

@spiral holly If you check the channel topic, you'll see Kivy, Panda3D, and Pyglet listed. In addition to that (depending on your needs) there is also Ursina and ModernGL.

lilac spruce
#

How do i make the coordinates 0 0 the center of the screen in pygame?

#

nevermind. apparently pygame doesnt have this function

viscid nexus
#

Yup, you need to basically use your own coordinate system and translate when Pygame needs it. Can whip up an example if you're interested.

#

Gaming dev library's besides pygame and arcade??
@spiral holly

There's a lot. https://pythongaming.rocks/ My co-maintainer on ppb built this. If anyone knows more about any of these libraries than us, please contribute.

dawn quiver
#

Sry

#

I AM si bad

#

With panda

#

So*

#

I can send a tutorial

#

I cant help u more

jade kettle
#

Hey there, does anyone how I can make a gif move across my window?

dawn quiver
#

Can u say more precisions

#

Do u want moove with the keys

jade kettle
#

I want to have a gif move around randomly on the window

dawn quiver
#

Use random

#

Randiny

#

Y

#

T

#

It s ez

#

On the coordinates put random randint

jade kettle
#

wont that teleport it to those coords?

dawn quiver
#

Yes ?

#

I dont understand what u want To do

#

Do

jade kettle
#

I cant really give you an example

dawn quiver
#

Try

#

I AM good in pygame

jade kettle
#

I dont want it to teleport, I want to go from its origin point to the random point

dawn quiver
#

Write the origin point and do the same except u take place of the original coordinates and u put the random s coordinates

#

Sry my english is bad

jade kettle
#

no problem, I just havent worked with pygame

dawn quiver
#

Okay

#

U understand

#

I can reexplain

#

With trad

#

I can put the text in my original langauage and translate with google trad

#

F u want

#

I just want to help u

#

Bc i like

jade kettle
#

you dont have too, Im just gonna read the docs on pygame to learn the basics

dawn quiver
#

Good idea

#

Me i took lessons

#

Bro if u want i can do a program and i send him

#

A program about ur problem

#

U choose

#

U are the guest

spare phoenix
#

hey

#

im new to oop

#

and i have made some games before using pygame

#

but i would like to make pong again using oop and classes

#

can someone help me with this

dawn quiver
#

Hi

spare phoenix
#

hi

dawn quiver
#

How can I help u

spare phoenix
#

import random
import pygame
import time
import os

class player(object):
black = (0, 0 , 0)
white = (255, 255, 255)

def __init__(self):
    pygame.init()
    self.screen = pygame.display.set_mode((1500, 800))
 

    
def draw(self):
    self.screen.fill(player.black)
    pygame.display.update()
    


    pygame.display.update()

    

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

        self.draw()

player().game()
pygame.quit()

#

i have this so far

#

and i would like to create a rectangle

#

but when i call the class i have to give an argument

dawn quiver
#

I am not really good with self

spare phoenix
#

Have you used pygame?

dawn quiver
#

I rarely use it

#

Yes I used

#

I am good in pygame

spare phoenix
#

i am trying to learn classes and things as i heard it helps when making larger games

#

do you use classes or work without them

dawn quiver
#

It is good to work with

spare phoenix
#

if possible can you send one of your pygame projects

dawn quiver
#

Or just functions it's same

#

I am in my car and I have a problem with my computer

#

I can not

spare phoenix
#

oh

#

its ok

dawn quiver
#

And I didn't really do good projects

#

I just use it for bc it's fun

#

But I am not bad with pygame

spare phoenix
#

i am also trying to create a gui to select a game mode(single player or 2 player)

#

can i do this with pygame

#

or will i have to use something like tkinter

dawn quiver
#

Tssss

#

Me too I don't know how do it but it's sure it's exist

#

Try to search on internet

spare phoenix
#

ok

dawn quiver
#

I will do the same

#

Now

spare phoenix
#

ok thx

dawn quiver
#

But it's can be a good idea to use tkinter

spare phoenix
#

oh ok

dawn quiver
#

I have an idea

#

Y

spare phoenix
#

yeah

#

what is it?

violet dragon
#

hey man i am new so what to do

#

any help

#

?

spare phoenix
#

new to python or game-dev

violet dragon
#

new to phython

#

sry

#

python

spare phoenix
#

i am not that advanced either

#

but i recommend youtube

#

watch tech with tim

violet dragon
#

k so what to focus on

#

k

spare phoenix
#

first learn the basic syntax

#

such as if statements

#

functions

#

variables

violet dragon
#

that i know a bit nesting etc

spare phoenix
#

this video can get you through all basic syntax

#

dont need to watch full thing

dawn quiver
#

U can use a picture for a button

spare phoenix
#

wdym?

dawn quiver
#

It's good

#

U just must define the coordinates

#

It's good

wild root
#

here is some info on rectangles from pygame's docs

#

not sure if this helps or not

viscid nexus
#

Re moving objects over time, you're looking for the concept of integrations, I have a handful of samples among talks I've given, but not in a position to explain it all right this second. If you're still trying to move objects around when I'm at a computer, will gladly write up something.

lofty mountain
#
  File "F:\Snake\snake.py", line 73
    for y in range(0, int(GRID_HEIGHT))
                                      ^
SyntaxError: invalid syntax```
tranquil girder
#

You're missing the :

jade kettle
#

any reason why?
code used for the image: screen.blit(Navi, pygame.Rect(Ox, Oy, 60, 60))

#

Ox and Oy are coords

#

it happens with every image I used, they all get a pinkish outline

sacred trout
#

you probably have trasparent pink around your image

#

try to .convert_alpha()

jade kettle
#

ok so I converted tha Navi variable but nothing changed

#

like so

#
Navi = Navi.convert_alpha()```
#

the only thing I think its important besides that is the fact that my window is transparent

viscid nexus
#

What's the filename for the navi image?

jade kettle
#

Resources

#

why?

#

ohh wait

#

Its Navi.png

#

lol

#

thought you wanted the folder for some reason

viscid nexus
#

I'm trying to remember if I've seen this before. I feel like I have. Is navi partially transparent?

jade kettle
#

kinda

viscid nexus
#

My guess is if you open that in a pixel art program that band of pink has a slightly different color value than the rest.

jade kettle
#

whats a pixel art program? does photoshop work?

viscid nexus
#

Photo shop should be able to check it.

jade kettle
viscid nexus
#

Oh that's definitely not color keyed which is what I was looking for.

Hmm...

jade kettle
#

life is hard

spare phoenix
#

anyone here good with oop

molten niche
#

are there any good libraries that allow you to import assets?

viscid nexus
#

Combine os.walk with whatever game library loader you've got?

molten niche
#

i use pygame

#

i have barely started learning pygame tho

viscid nexus
#

So, what are you looking for an asset loader to do?

molten niche
#

custom assets

#

like textures for use in my game

viscid nexus
molten niche
#

maybe

viscid nexus
#

Mostly was asking in case you wanted more magic.

molten niche
#

i just need images

#

and animations

viscid nexus
#

Yeah, than image.load is probably what you want. Give it a file path and it'll give you a Surface you can pass to Surface.blit.

molten niche
#

ok

viscid nexus
#

Every game library uses a slightly different method.

jade kettle
#

but then your image gets a weird pinkish outline

molten niche
#

rlly?

jade kettle
#

it happened to me

#

but it doesnt usually happen

molten niche
#

ok

viscid nexus
#

Yeah, any chance you have that code on github? I can grab some of the images and see if I can poke through it.

jade kettle
#

I never used github

viscid nexus
#

Ah. Any other place you could upload the file?

jade kettle
#

mediafire?

#

actually cant I just send the file here?

viscid nexus
#

Might work.

#

I'm just going to play with it a bit to see if I can dupe/fix.

frank fieldBOT
jade kettle
#

well then

#

tnks bot

#

there you go

viscid nexus
#

Um, I'll need the image file, too.

jade kettle
viscid nexus
#

Where are you getting win32api?

jade kettle
#

idk, the base code was given to me

viscid nexus
#

I mean, you installed it into your environment?

jade kettle
#

ohh I assume so

#

wouldnt it cause an error if it wasnt installed?

#

yeah if its just the pywin32 lib then I have it installed

#

and if by environment you mean the place I program in then its just the Python's IDLE
Im a sheltered programmer, I dont normally interact with others so idk how stuff is called

viscid nexus
#

Uh, when I say "environment" I mostly mean the python site packages. Could be a virtual environment, or a system python, or whatever. I just need to make sure I have the right packages to run the code.

jade kettle
#

this?

sacred trout
#

The reason is given in the first comment of the SO that you posted πŸ˜‰

molten niche
#

does anybody know what surface means for pygame

#

dead chat be like

sacred trout
#

It's an image or an array of pixels

molten niche
#

ok

jade kettle
#

@sacred trout Piper said the image isnt key colored

#

and I also dont understand anything of what the first comment is saying

sacred trout
#

Apparently the way transparent windows work on windows is by making transparent every pixel that is exactly pure pink. The windows itself is actually keyvolored

#

But if you blit someone with transparency, you get something that is not pure pink at the edge, because et blends the ping with your semi transparent border

#

So the resultant color is not pink and so is not made transparent by the system and thus is fully opaque

#

That's why you get the pink. To get rid of it, you need to use sprites with a sharp edge, and no transparency between 0 and 1

jade kettle
#

so I went to photoshop and pressed Sharpen Edges

sacred trout
#

This pink is caused by semi transparent pixels

#

You need to remove them entirely

#

Actually the best thing to do would probably to use colorkeyd surfaces

jade kettle
#

So I tried this

Navi = Navi.convert()
Navi.set_colorkey(fuchsia)```
#

while there is no pink

#

the image didnt make it

#

new problem

sacred trout
#

πŸ˜‚

jade kettle
#

it looked liked it worked

sacred trout
#

I meant using colorkeyd image when drawing them like in photoshop

#

Thing is, you don't want per pixel alpha in your image

jade kettle
#

I dont know what that means

#

per pixel alpha
u are saying that in my image, every single pixel has a different transparency?

spare phoenix
#

hey

#

does anyone know how to make a bot that can play as a second player in a game

#

or any videos that can help me with that

proper peak
#

You'd need to either hardcode the logic in, or use some actual machine learning, and the latter is pretty complicated.

viscid nexus
#

You're basically looking for game AI which is an awful name for it. There's a bunch of ways to design it, so my first question is what kind of game are you making so I can point you at resources more likely to be what you want?

#

u are saying that in my image, every single pixel has a different transparency?
@jade kettle

so when we're talking about transparency in rendering, there's two big methods for handling it: color keys and per pixel alpha.

If you've ever seen a sprite sheet where the images are on a garish background, usually magenta, those are color keyed. If you tell pygame the color value of that background, it knows how to filter out the color key and leave only the image.

Per-pixel alpha is talking about a color definition known as RGBA. The alpha channel determines how much opacity that pixel has. So a maximum value in the fourth value in the color tuple (usually 0-1 or 0-255) is fully opaque, and a 0 is invisible. Everything in the middle would show up as translucent.

spare phoenix
#

@viscid nexus im making a basketball game where there and two players on opposide sides trying to shoot on each others nets

#

for single player

#

i want to make the computer contoll the opponent

viscid nexus
#

Okay, what kind of mechanics do you have? Can the players move around? Steal? Or is it more like a game of horse where both sides take turns?

spare phoenix
#

players can move around and steal

#

i havent started the game yet but i got an idea of what i would like to do

#

i jus need to learn game ai so i can start

#

so how can i go about this and what should i search online to do so

viscid nexus
#

Behavior trees are probably the best tool for that. After I'm done eating I'll find a couple of the articles I read about it.

viscid nexus
stray ember
#

ha ha triple thread go brr

round obsidian
#

@viscid nexus ping

#

BTW, this was the game I was working on. I got a little distracted, though, but I plan to return to it as soon as I get some other stuff in my life cleared up.

viscid nexus
#

. . . Okay, I'm going to actually play with that later because I'm a big fan of twin stick shooters and that's a clever way to gen the enemy spawn.

round obsidian
#

Awesome! :D

#

It's still only a PoC/prototype, but it's playable

viscid nexus
#

.> I need to actually make a full scale graphic for that game, but here's the stuff I've been working on that are real games.

#

I'm literally working on a talk today about the tool chain I use.

round obsidian
#

The Conway's Life aspect of the game is Cython, the rest is pure Python using Pyglet

viscid nexus
#

Very cool.

#

Blinks whole thing is just experimentation with steering behaviors.

#

Smuggler's Run was done for the GMTK game jam because well, I could write a Python game for a 48 hour game jam.

round obsidian
viscid nexus
#

And Shooter was actually my first proof of concept that ppb can be used for complex games.

#

It's funny, technically 2084 is before my time, but one of my pre-software jobs had a cabinet in the break room and I played so much.

round obsidian
#

I went from cloning the game to doing something inspired by the mechanics, which seems like a good step :D

viscid nexus
#

Definitely! I'm very much always tryign to duplicate mechanics in little proofs of concept, then I use that library of knowledge to design my games.

#

(Not that I make many anymore, spend a lot of my game dev time working on ppb so other people can make cool games.)

round obsidian
#

Right now I'm neck-deep in both rewriting my blog software and polishing a tool I wrote to help me with my fiction writing, but as soon as both of those things reach a semblance of stability I'll dive back into this game again.

#

(Those two count as "web" projects)

viscid nexus
#

Yeah, did that not that long ago.

bold lava
#

someone help me?

#

i want to develop a game

#

i dont know where to start

wanton igloo
#

its best to start off with a text adventure, like im doin now

dawn quiver
#

Same!

#

But I'm making a hangman too

viscid nexus
#

https://youtu.be/bbKED0o3uVU

Here, this talk is mostly focused on the concepts via my library ppb, but it's kind of an overview of the mechanics of 2d games.

I can pull up a tutorial from pyohio and a 2016 pygotham talk that has the absolutely worst recording that covers the high level theory if you're interested.

Piper Thunstrom

https://www.pytexas.org/2019/talk/U2Vzc2lvbk5vZGU6OTA=

Python and video games are both used independently to learn software engineering, so Python game frameworks have an important role in the software development space. Come learn how to make games in Python...

β–Ά Play video
lusty oyster
#

I have to click in the corner not on the sprite for htis to wokr

#
bear = pygame.image.load("Bear.png")
#
if event.type == pygame.MOUSEBUTTONDOWN:
    mouse_pos = pygame.mouse.get_pos()
    if bear.get_rect().collidepoint(mouse_pos): print("Clicked")
covert ermine
#

how to make tic tac toe ?

lusty oyster
#

nvm fixed

fervent rose
#

!reosurces we have a list of resources right here, you should check it out πŸ™‚

#

!resources

frank fieldBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

fervent rose
#

lemon_pleased Any time!

naive prairie
#

What is the code of mousebutton in pygame?

torpid gull
#

hello so im working on a platformer and i want to add a background image to my game

#

but it wont appear

#


bg = pygame.image.load("bg.png")
while True: # game loop
    display.fill((146, 244, 255))  # clear screen by filling it with blue

    screen.blit(bg, (0, 0))
#

also there are no errors

#

and it wont crash

#

pls help

naive prairie
#

You've to update also
Type pygame.display.update()

torpid gull
#

Oh ok I'll try

#

hmm it worked but its bugging out

naive prairie
#

Send the complete code

torpid gull
#

shall i DM it?

naive prairie
#

Yeah

torpid gull
#

Alright

spare phoenix
#

hey

#

anyone know how i can move a shape in pygame when key is held down

viscid nexus
#

In the update section, check the state of the key, then move the rect (pick any point, I like center, but you might work with topleft) a little bit based on which key was pressed.

If you are using sprites you'd do it in your update function.

spare phoenix
#

whats the state of the key and the update section lol

#

sorry bit of a noob

#

'''def paddlemove():
global paddle_x, paddle_y, paddle2_x, paddle2_y
keys = pygame.key.get_pressed()
if keys[pygame.K_UP] and paddle2_y >= 0:
paddle2_y -= vel
if keys[pygame.K_DOWN] and paddle2_y + 120 <= 800:
paddle2_y += vel
if keys[pygame.K_w] and paddle_y >= 0:
paddle_y -= vel
if keys[pygame.K_s] and paddle_y <= 800:
paddle_y += vel'''

#

thats my code

torpid gull
#

How do i make background tiles in pygame?

quartz cedar
#

when to use opengl vs directX vs vulkan?

near wedge
#

OpenGL and Direct3D (before 12) are good if you want a higher-level graphics API. Vulkan is if you really want to get low level.

#

Vulkan is a ton of extra work.

olive parcel
#

@quartz cedar if you never need to support anything other than Windows, then Direct3D 11 is simpler to use. Otherwise, OpenGL. If you need to ask, I'd recommend against Vulkan or Direct3D 12.

formal seal
#

I’ve heard that Vulkan takes a ton of code just to get running

#

So unless you really need the performance, OpenGL sounds like the best route

quartz cedar
#

so for windows direct X and for multiplatform opengl?

#

and vulkan for performance?

dawn quiver
#

i have a simple game for you guys

#

just decode what i've wrote

#
z = "CIA...? am i dumb to you ! lmo i\'ve forget to cook the dinner bye"
t = (z[0] + z[21] + z[-16:-15] + z[8] + z[7] + z[16] + z[27] + z[21] + z[8] + z[18])
t += " dG8gcnVzc2lhbiA" #base64
print (t)
spare phoenix
#

need help with some game ai

molten niche
#

dead chat

potent ice
#

@molten niche Patience will pay off when asking questions. You were given an answer on the pygame server, but you left the server.

maiden thunder
#

is it possible to make a game in pycharm

#

or do you need pygame

#

?

potent ice
#

@maiden thunder You need som game or graphics library. Pygame is one option.

maiden thunder
#

but i can create it in pycharm right

#

i have to download some library or something right?

potent ice
#

Yes. I think pycharm will ask you to install it once you add an import

lusty oyster
#

amyone need help

dawn quiver
#

No

warm cradle
remote turret
#

I want to get into AI development so that I can make a game

#

I'm new, but I want to get on the level where I can make AI for a basic civilization-esq game

spare phoenix
#

@warm cradle

#

try pygame.draw.rect()

#

in the brackets you need the following infor

warm cradle
#

alright

spare phoenix
#

(the surface the shape will be drawn on, the colour, the x cordinate, the y cordinate, width, height)

#

and make the width and height the same since you want a square

warm cradle
#

thanks it worked! @spare phoenix

spare phoenix
#

@warm cradle no problem

#

how can i move a charcter with key held down

#

in pygame

molten niche
#

i left the pygame server beacause there was absolutely no order

#

for nothing

#

no rules no roles no orginization

#

a few text channels slapped together in 5 minutes andi left

potent ice
#

It's a server with some helpful people at least. You could have suggested improvements to the server.

#

There are lots of very interesting conversations there in general. I haven't even thought about the layout of the server.

#

I think they don't list separate roles because they want to have a flat structure. There server is not really big enough to care about these details.

#

Your question was even answered within a short period of time πŸ™‚

spare phoenix
#

Can someone plx answer my question

potent ice
#

First hit when searching on "pygame move character". I would post some code example if I had time, but at least this is something.

dawn quiver
#

have someone make ai chess application
i just wanna know what do i need to make this game

dawn quiver
#

Pygame

void tusk
#

self.screen.fill((0,0,0), (50,250,650,50))
I understand the first tuple that are the RGBs but what is the last tuple for?

dreamy swan
#

Alpha I think

fervent rose
#

@void tusk the first two are the top left corner of the screen, the last two the bottom right corner, I think

kindred fox
#

It’s a rect

#

fill(color, rect=None, special_flags=0)

#

From the docs

#

@void tusk

#

Sorry I’m kinda late to the party

dawn quiver
#

where can i download pygame

warm cradle
#

@dawn quiver what ide are you using?

limpid gyro
#

pip install pygame

#

its ez like sleeping

#

its a shame ive done a mistake on the acronym but ig its alright

warm cradle
#

I need help adding sprites to my game

spare phoenix
#

you mean images?

#

@warm cradle

warm cradle
#

@spare phoenix yes