#game-development

1 messages ยท Page 105 of 1

dull atlas
#

Hello, please don't use our server as an advertisement board. Thanks

torn jackal
#

hey guys how can i just show 2 numbers after the . with this code : TimeSurf = fond.render('Total Time : %s' %total_time, True, (255, 255, 255))

surreal orchid
#

hey all. Don't suppose anyone has experience with programming a kinematics/projectile program? I'm trying to get the output window to draw the projectile while deleting the previous iteration of the projectile, rather than drawing the whole path over and over with a slight increase in the position in the x and y direction.

proper peak
#

Are you using matplotlib or something like that?

surreal orchid
#

nothing like that no, I'm not using any sort of libraries

#

I'm trying to just use math and tkinter

#

I'm trying to find a decent example of 2d projectile motion without using pygame or matplotlib but its pretty hard to find

grand matrix
#

ah yes. Indentation. My biggest weakness. My mortal enemy. Thanks alot ig

proper peak
#

Or are you drawing manually on some kind of tkinter-provided canvas? In that case redrawing the path might be unavoidable.

surreal orchid
#

Yeah I'm using tkinter

#

And the canvas command

broken citrus
surreal orchid
#

My thought is while writing pseudo code, that I'd have to work out new new position, store that value, then have tkinter draw the circle based on those values

#

And then work out the newer values, store those, draw another projectile and delete the previous projectile

broken citrus
#

im busy rn so maybe someone will help you

surreal orchid
#

Tbh I don't think I'll get it done by tonight, so drained dealing with my father in laws passing this week.

proper peak
#

If I'm reading the docs right, tkinter's canvas is a "smart" kind of canvas in that it stores each drawn thing as an object and you can modify/delete them.

surreal orchid
proper peak
#

So all you should need is to store the handle it gives you when you draw the ball for the first time, then change its coords each frame and tkinter will redraw it.

surreal orchid
#

๐Ÿ‘

grand apex
#

Anybody know of any non linear text based games or got any ideas for one? A text based roguelike would be more interesting. Also any game that could be adapted into a text based game such as blackjack etc would be cool

odd stone
#

anyone know why my random.randint() function is only picking 3 out of 760 numbers this is my code: def ItemMovement1(item):
if item.rect.y == 0:
item.rect.x = random.randrange(20,780,5)
item.rect.y += 4
if item.rect.y == 800:
item.rect.y = 0
bar.lives -= 1
# 8 rectangles are each givin different x values but only 3 of them are showing so im guesing that the other items have the same x value
if item.rect.colliderect(bar.rect):
item.rect.y = 0
bar.points += 1

cold storm
tranquil girder
odd stone
#

Oh sorry it was where randrange was and it didnt have the 5

sinful lodge
twilit quail
#

you think scripting in godot is better than developing on pygame?

cold storm
#

geometry nodes @sinful lodge

sinful lodge
cold storm
#

it's like an ubber py environment for 3d content creation

potent ice
quick dove
#

for random events I assign a precentage to a certain event, but how do I choose which event to trigger

torn jackal
#

hey guys how can i just show 2 numbers after the . with this code : TimeSurf = fond.render('Total Time : %s' %total_time, True, (255, 255, 255))

#

Because it shows me something like that : 29.999999999

tranquil girder
torn jackal
#

Oh thanks man

#

Thats working

torn jackal
#

My game soon on PlayStore ! Tell me what you think about it !

summer parcel
#

Can you develop games with python?

tranquil girder
#

Yes

torn jackal
#

@summer parcel of course ๐Ÿ˜‚

#

And the most used library is named Pygame

elfin sun
elfin sun
torn jackal
#

Python

#

Pygame

burnt sigil
torn jackal
#

Thats true that when u begin to use Pygame un games wont be really beautiful but i can promise u that un games become really nice really fast !

#

@burnt sigil but i think that Arcade is also really good

pale wedge
#

Hi!
Been doing a simple Monopoly as training (I'm a beginner) and I really wanted to show it here
Is there any problem about that?

#

Ah crap
It's over 2k characters long
Nvm :(

agile sage
#

what is the best modules to build games on python

#

I look a recommendations

odd stone
#

pygame is pretty good

keen dew
#

^^

#

one of the best, if not

odd stone
#

How do i change the layers of Sprites in pygame. i have a rectangle and some text in the same place but the rectangle is on top and i want it on the bottom. also im using pygame

frank fieldBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

odd stone
burnt sigil
torn jackal
#

Ursina is good

elfin sun
torn jackal
#

Just have to put all my files under the apk format

#

Then I put them in aab

#

And there we go my game is on Play qtore

elfin sun
#

What about the controls,

torn jackal
#

What do u mean

elfin sun
#

Controls are different in a pc and Android, so how did you manage that for android

torn jackal
#

Oh

#

I just created arrows to move

#

U can see it on the video

elfin sun
#

Hmmm, i didn't know you could add buttons in pygame

torn jackal
#

Actually we cant

#

๐Ÿ˜…

#

But i just used the colllidepoint function

elfin sun
#

Oh

torn jackal
#

U know that ?

elfin sun
#

Heard about it but never used

torn jackal
#

Collidepoint detects when u click on a surface

elfin sun
#

Hmm yeah that can be used for it

torn jackal
#

Ye oc

#

But i did a version for the computers too

#

With using the arrows of the keyboard

elfin sun
#

And did you use tiled for the level

torn jackal
#

What is "tiled" ๐Ÿ˜…

#

Sorry fr people are bad in english

elfin sun
#

It's just a level creater which can be used in pygame

torn jackal
#

Oh no

#

I created a function to create random levels

elfin sun
torn jackal
#

I didnt know that ...

elfin sun
torn jackal
#

Yes i think so

elfin sun
torn jackal
#

Mmmh

#

Actually aab is a New format

#

So u can find videos on apk format and then put your apk in aab

#

But put your programm in aab xithout put it in apk before

#

I dont think it s possible for the moment

elfin sun
#

I'll try that if it works because my game has a ton of different files

torn jackal
#

If u want to put your programm in apk, you have to use buildozer

elfin sun
torn jackal
#

No

#

Actually i can put my game in apk

#

Even if the program is not using kivy

elfin sun
#

It would be very helpful if that's possible

#

Last time I made a game using kivy, buildozer kept raising an error at the last step

torn jackal
#

U were on Windows right

#

?

#

Bc you need to be on Linux or osx to use buildozer method

#

I know thats strange...

elfin sun
#

I was using Google colab

#

It uses Linux

torn jackal
#

Mmmmh

#

Maybe that u didnt do the good procedure

elfin sun
#

What's that

torn jackal
#

Buildozer init
Buildozer android deploy run

#

U wrote something like that?

elfin sun
#

After the first one, I ran the debug command

#

to get an apk

torn jackal
#

Yes

#

Then ...

#

U got an error

elfin sun
#

But it was different, limme see

torn jackal
#

Show me please

elfin sun
#

It was buildozer -v android debug

torn jackal
#

But what was ur error

elfin sun
#

I don't really remember, cuz i did it alomost 2 months ago

#

Maybe I can find it in my history

torn jackal
#

Was it check configuration tokens

#

Then unkown command target android

elfin sun
#

I don't know what that means

#

The error shows something like
Running cythonize failed

shell scroll
#

ROTA is out now on itch!
Rotate gravity and solve puzzles to explore this colorful world!
https://twitter.com/harmony_hunnie/status/1523063755940450304

ROTA is out now!! Link below (:

ROTA is a gravity bending puzzle platforming adventure! A new game by the creator of Tiny Crate.

Rotate gravity as you walk over the edge!
Push, pull and rotate gravity-blocks to solve puzzles.

#IndieGame #PuzzlePlatfomer #IndieDev #GameDev

โ–ถ Play video
oblique violet
#

shesssh

mortal dust
#

sus

oblique violet
#

hi im new here

#

i want to make a minecraft python but idk where to start

dawn quiver
#

!pypi ursina

frank fieldBOT
oblique violet
#

thanks

#

is there any tutorial?

dawn quiver
#

this video looks interesting

oblique violet
#

thanks

#

:D

dawn quiver
#

it's not exactly a tutorial

oblique violet
#

like tutorial for beginner

#

how to start

#

and the basics

dawn quiver
#

not sure on that, you're gonna have to go by the docs

brave elm
#

you will be surprised to know how simple ursina engine actually is

#

@oblique violet

rapid barn
#

How can I make a game multiplayer

rapid barn
#

I'm trying to make a multiplayer red light green light

#

but I don't know how to make it multiplayer

broken citrus
limpid lodge
#

Hi i'm new but good at python

#

what should I make for py

left beacon
#

Hi, I got a problem with collidepoint, I want to remove an item from a list (by index) when clicking on it, yet it removes all of them like Im turbo clicking on the same spot

#

how do I fix this?

left beacon
#

how do I make the event.type == pygame.MOUSEBUTTONDOWN be valid for only 1 frame?

left beacon
#

solved it by adding a time.sleep(0.1)

oblique violet
#

how do i install ursina without powershell
cuz my powershell is not working
can i download it with command prompt?

dawn quiver
#

It can be installed like any Python library, just like how you've installed the library for Discord bot

#

Simply have pip installed along with Python and you can install it.

oblique violet
dawn quiver
#

As the documentation says, yep

oblique violet
#

thanks

oblique violet
#

alright its working sry for the ping

#

just about to ask why is nothing loading

oblique violet
dawn quiver
#

I remember doing that

oblique violet
#
from ursina import *

app = Ursina()
test_entity = Entity(model='square',color = color.blue)

app.run()
```but i only get the grey screen
dawn quiver
#

That I can't help, never used the engine

oblique violet
oblique violet
#

np

#

i change it to circle and its working again

#

for square its call quad not square

sinful lodge
#

maybe becaude your camera isnt facing it

#

or your camera is inside of it

#

use EditorCamera() code to create an editor camera and move around the camera

oblique violet
simple belfry
#

hey so I'm working on collisions in pygame and I have a problem that for me is too weird to understand it.

class Tile(pygame.sprite.Sprite):
    def __init__(self, image):
        self.sprite = image
        self.rect = self.sprite.get_rect()

class Tilemap_set:
    def __init__(self, map:list):
        self.map = map
        self.tile_map = []

    def check_collision(self):
        global player
        
        for tile in self.tile_map:
            if player.hitbox.colliderect(tile.rect):
                player.get_hit()

here if Tile and fragment of Tile_map class. The player.get_hit method prints in terminal "wall" as you see whenever it collides with any tile. player has it's own rect defined in his class as self.hitbox. there is no errors and game runs, the tilemap is drew on to a screen, all drew tiles objects are saved to self.tilemap list, player can move etc. but when I walk into a wall, the player.get_hit method is not raising. Do you know what is wrong there?

oblique violet
#

alright new problem

#

this thing

#
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController

app = Ursina()

grass_texture = load_texture('urcraft/grass_block.png')

class Voxel(Button):
    def __init__(self, position = (0,0,0)):
        super().__init__(
            parent = scene,
            position = position,
            model = grass_texture,
            origin_y = 0.5,
            texture = 'white_cube',
            color = color.white,
            highlight_color = color.lime)

    def input(self, key):
        if self.hovered:
            if key == 'right mouse down':
                voxel = Voxel(position = self.position + mouse.normal)
            if key == 'left mouse down':
                destroy(self)

for z in range(16):
    for x in range(16):
        voxel = Voxel(position=(x,0,z))

player = FirstPersonController()

app.run()
```its pitch black when i run it
#

alright i know why

#

lemme try

tranquil girder
oblique violet
tranquil girder
#

= grass_texture

oblique violet
#

ok

tranquil girder
#

you did model=grass_texture, you want texture=grass_texture

oblique violet
#

so model = grass_texture

#

and texture also?

tranquil girder
#

no, the model can't be a texture, it has to be a model

oblique violet
#

huh

#

what about model

tranquil girder
#

or the name of one at least

oblique violet
#

model = cube?

tranquil girder
#

'cube'

oblique violet
#

ok

#

what about the colour

tranquil girder
#

or actually, probably the model you made, since you're using a cusom uv mapped cube model

oblique violet
#

can i remove it

tranquil girder
#

what color?

oblique violet
#

color = color.white

#

and the highlightcolor = ...

tranquil girder
#

no, because the default color for Button is not white, but a slightly transparent black

oblique violet
#

no wonder i got it all black

#

so what do i set it to

tranquil girder
#

It's multiplied with the texture's color, so color.white will have no visual effect

oblique violet
#

ok

#

alright

oblique violet
#

whats this

#

why is it white

tranquil girder
#

it's a bunch of white cubes

#

look at the terminal, probably says texture not found

oblique violet
#

ya

#

how do i correct that

tranquil girder
#

that's not it

oblique violet
oblique violet
#

then what is that about

tranquil girder
#

something else that doesn't really matter

oblique violet
#

lol

#

then why is it that

#

there is no error

tranquil girder
#

try loading textures the way it's described in the documentation

#

instead of following a tutorial which does it the wrong way

#

so texture='grass_block' in your case

oblique violet
#
grass_texture = load_texture('urcraft/grass_block.png')
tranquil girder
#

?

oblique violet
#

gg

tranquil girder
#

yes, because it's simple, just give it the name

oblique violet
#

?

#

what name

tranquil girder
oblique violet
#

okok

#

no need .png?

tranquil girder
#

it's optional

oblique violet
#

ok

#

missing texture

tranquil girder
#

is it in the same folder or below as your script?

tranquil girder
#

that's a no

oblique violet
#

oof

oblique violet
tranquil girder
oblique violet
#

alright

#

thanks for the info

#

what on earth is this

#

@tranquil girder

tranquil girder
#

you're not using the custom model you made/downloaded, so the uvs are wrong

tranquil girder
#

model = 'name_of_your_model'

oblique violet
#

=.=

#
class Voxel(Button):
    def __init__(self, position = (0,0,0)):
        super().__init__(
            parent = scene,
            position = position,
            model = 'cube',
            origin_y = 0.5,
            texture = 'grass_block',
            color = color.white)
```this is correct right?
tranquil girder
#

is your model named 'cube'?

oblique violet
#

i thought u told me to put it to cube

#

:/

#

so i change it to grass_block?

tranquil girder
#

and then I told you some more after, did you read that?

oblique violet
#

lemme read it again

oblique violet
#

its not a uv mapped cube model

tranquil girder
#

I don't know what your model is called, so I can't answer

oblique violet
#

its just a png i downloaded on google

#

๐Ÿคฃ

tranquil girder
#

a png is not a 3d model,. it's a flat image

oblique violet
#

maybe i need to draw it on my own

tranquil girder
#

a 3d model is something like a obj

oblique violet
#

oo

#

how do i do it

tranquil girder
#

Enjoy this free chapter from our FlippedNormals Exclusive - UV Mapping for Games https://flippednormals.com/downloads/uv-mapping-for-games/

Early Bird Special - Get the full course at 25% OFF until November 6th

โ–ถ SUBSCRIBE | http://www.youtube.com/channel/UCvd6HxqYVWvfvfaF2Ereb9Q?sub_confirmation=1

โ–ถ MARKETPLACE | https://flippednormals.com/
...

โ–ถ Play video
oblique violet
#

thanks

oblique violet
tranquil girder
#

no, sorry
I use Blender

oblique violet
#

where can i download it

tranquil girder
oblique violet
#

cuz sure i will get tons of real blender if i google it

oblique violet
oblique violet
smoky stump
#

Can smdy give me a link to a yt good tutorial for pygame

#

Plssss

elfin sun
smoky stump
#

I know him

elfin sun
#

Ooh

smoky stump
#

Yes

elfin sun
#

You didn't get anything on that channel?

smoky stump
#

I am not looking in his channel

#

I am only like know that channel

#

He explains it very crlearly

elfin sun
#

You can check out Tech with Tim, there's a good playlist of pygame in his channel

smoky stump
#

I know

elfin sun
#

Have you tried any of his tutorials

smoky stump
#

No

#

I think I will do it

elfin sun
#

Yeah sure go n check it out

smoky stump
#

Thnks

elfin sun
#

He has covered all the basics in his videos

smoky stump
#

Noice

#

Ok

#

Thnks

#

I will check it out

#

Bye

elfin sun
#

๐Ÿ‘ ๐Ÿ˜

sharp berry
#

Heyy Guys Could Anyone suggest me complete roadmap to game development

elfin sun
left jetty
#

A game SE is an all-rounder the could create the entire logic for any type of app (finance/construction/ etc.) not related to gaming , from the start but less so with networks,servers,db , true ?

frank fieldBOT
scenic dome
#

Do you need programming or testing skills? If so I would be interested potentially.

wind basalt
#

we are mainly programming in c# actually

#

because our game engine only support c#

sleek bay
#

how can start python in step by step

#

I want the road map

oblique violet
#

idk how to use blender

outer ferry
#

anyone want to talk about game design? what are some good resources? thank you in advanved and sorry for my english

oblique violet
#

python or game dev

outer ferry
#

either is fine thank you so much

#

if it is gamedev related i will want to read it. i love python

oblique violet
outer ferry
#

yes I think i know the basics of python thank you

dawn quiver
#

Not sure if anyone is interested in joining a development team but if you like to develop games and want to make games under a dev team name dm me

low horizon
dawn quiver
dawn quiver
hybrid burrow
#

Hi, I use python for a long time (two years) and I think, is it the correct option for games.

#

Im learning Panda3d

low horizon
#

ive only tried with lua

#

roblox

hybrid burrow
dawn quiver
#

Python isnt the best with games but can certainly be done

hybrid burrow
#

What about the job?

dawn quiver
dawn quiver
hybrid burrow
#

You have dev team?

dawn quiver
hybrid burrow
#

Professional or hobby?

dawn quiver
#

Not professional as of yet

dawn quiver
hybrid burrow
#

Yeap...

potent ice
#

If you are recruiting for closed source projects or some project with an unclear license you need to be very careful.

dawn quiver
#

anyone can join the discord server if they wanted to

#

i have a discord server setup for my dev team and the community

potent ice
#

You have any current projects and is the source open for everyone?

dawn quiver
#

i have no current projects with the dev team but by myself i have one available project on itch.io

potent ice
#

What will the license be for the new project you are starting?

dawn quiver
#

if by license you mean creator name it will be under Hyper Pixel

potent ice
#

Copyright / license for the source code.

#

Non-specified? MIT? GPL? BSD? Proprietary?

dawn quiver
#

im not really sure what it would be under or how to even license games

potent ice
#

When you are working with people in a team this is very important to establish from the start. Not having this sorted out is a huge red flag.

dawn quiver
#

if possible could you help me go through the necessary steps to licensing games?

potent ice
#

If the games are just for fun and learning the simplest solution is to use an open source license and work on the game in a public repository for example on github

#

For example MIT or BSD license meaning anyone can use the code

#

If no license is specified you can suddenly claim ownership of all the code and kick out the rest of the members and benefit from it commercially in the future.

#

That is actually not an uncommon scam

dawn quiver
#

well i dont want anyone who is not authorized to be able to use the code

potent ice
#

Ok. So you are basically recruiting for a private project then?

dawn quiver
#

I'm not sure

#

Honestly I just wanted a team to create games for a possibility of this becoming a job for me and the others who joined the team

potent ice
#

<@&831776746206265384> Can you look at this?

dawn quiver
#

Is it against the rules to invite people to join a dev team I created?

fading whale
#

Erm yep @dawn quiver in my opinion this counts as recruitment, so you shouldn't post it in this server without explicit permission from the admins (which is not usually granted).

potent ice
#

It would probably fall under recruitment rules here. You are recruiting people for a private project. The licenses and ownership is very unclear as well. I think it's better to just go open source

fading whale
#

This is in the interest of protecting members from scams, as well as preventing a large amount of potential recruitment spam.

#

We have to apply the rule evenly.

dawn quiver
#

I wasn't really sure where to go with the licensing honestly I just wanted to create games with other people, I'm sorry for breaking the rules...

potent ice
#

MIT / BSD licensed open source games in public repos is much better ๐Ÿ™‚

fading whale
#

If you have already established a personal relationship with other members of the server, and wish to invite them to work on something with you, that's obviously your own business. But putting out a general message about paid work counts as recruitment (even if it's a partnership).

dawn quiver
#

But since I did break this recruitment rule what are the consequences?

fading whale
dawn quiver
#

Ok got it, and you got my word on that

potent ice
#

To get you in a little less trouble in the future.. do read about licensing and discuss this with whatever team you have. You can get in a world of trouble not establishing this from the start. Who owns the code? You? Everyone? Can other members fork the project and go their own way?

dawn quiver
#

Ok I'll talk to my team abt it, there's only one member that I've made really good friends with

fading whale
dawn quiver
#

I've looked into it a little bit but don't know much abt it

grand apex
potent ice
#

Playing around with realtime video manipulation with shaders in arcade (cv2 video). Just messing around with the texture coordinates in a fragment shader to make "waves" : https://github.com/pythonarcade/arcade/blob/development/arcade/experimental/shadertoy_video_cv2.py
https://cdn.discordapp.com/attachments/716020595439173663/968653344015015956/shadertoy_video.gif

GitHub

Easy to use Python library for creating 2D arcade games. - arcade/shadertoy_video_cv2.py at development ยท pythonarcade/arcade

drowsy trellis
#

import pygame,sys
from pygame.locals import *

class Frog(pygame.sprite.Sprite):
def init(self,posX,posY):
super().init()
self.sprites = []
self.sprites.append(pygame.image.load('attack_1.png'))
self.sprites.append(pygame.image.load('attack_2.png'))
self.sprites.append(pygame.image.load('attack_3.png'))
self.sprites.append(pygame.image.load('attack_4.png'))
self.sprites.append(pygame.image.load('attack_5.png'))
self.sprites.append(pygame.image.load('attack_6.png'))
self.sprites.append(pygame.image.load('attack_7.png'))
self.sprites.append(pygame.image.load('attack_8.png'))
self.sprites.append(pygame.image.load('attack_9.png'))
self.sprites.append(pygame.image.load('attack_10.png'))
self.currentSprite = 0
self.isAnimation = True
self.frog = self.sprites[self.currentSprite]

    self.rect = self.frog.get_rect()
    self.rect.topleft = [posX,posY]

def update(self,speed):
    self.currentSprite += speed
    if int(self.currentSprite) >= len(self.sprites):
        self.currentSprite = 0
    self.frog = self.sprites[int(self.currentSprite)]

pygame.init()

width = 500
hieght = 500
screen = pygame.display.set_mode((width,hieght))
screen.fill((255,255,255))

frogGroup = pygame.sprite.Group()
frog = Frog(100,100)
frogGroup.add(frog)

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

screen.fill((0,0,0))
frogGroup.draw(screen)
pygame.display.flip()

# pygame.display.update()
#

i'm getting this error

#

can anyone tell me why i'm getting this ??

shy geyser
drowsy shoal
#

Hello guys

#

Which Python Game engine would be the best for a python Beginner

sinful lodge
burnt sigil
oblique violet
#
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController

app = Ursina()
dirt_texture = load_texture('dirt')
cobblestone_texture = load_texture('cobblestone')
oak_plank_texture = load_texture('oak_planks')
texture = dirt_texture
block_pick = 1

def update():
    global block_pick, texture

    if held_keys['left mouse'] or held_keys['right mouse']:
        hand.active()
    else:
        hand.passive()

    if held_keys['1']:
        block_pick = 1
        texture = dirt_texture
    if held_keys['2']:
        block_pick = 2
        texture = cobblestone_texture
    if held_keys['3']:
        block_pick = 3
        texture = oak_plank_texture

class Voxel(Button):
    def __init__(self, position = (0,0,0), texture = dirt_texture):
        super().__init__(
            parent = scene,
            position = position,
            model = 'cube',
            origin_y = 0.5,
            texture = texture,
            color = color.white)

    def input(self, key):
        if self.hovered:
            if key == 'right mouse down': 
                if block_pick == 1: voxel = Voxel(position=self.position + mouse.normal, texture = dirt_texture)
                if block_pick == 2: voxel = Voxel(position=self.position + mouse.normal, texture = cobblestone_texture)
                if block_pick == 3: voxel = Voxel(position=self.position + mouse.normal, texture = oak_plank_texture)

            if key == 'left mouse down':
                destroy(self)

class Hand(Entity):
    def __init__(self):
        super().__init__(
            parent = camera.ui,
            model = 'cube',
            texture = texture,
            scale = 0.2,
            rotation = Vec3(150,-10,0),
            position = Vec2(0.4,-0.5)
        )
    
    def active(self):
        self.position = Vec2(0.3,-0.4)

    def passive(self):
        self.position = Vec2(0.4, -0.5)

player = FirstPersonController()
hand = Hand()
app.run()
#

the hand's texture is not changing

#

i wanna make it like minecraft

#

u put down what is on ur hand

frail thunder
#

unity

potent ice
frail thunder
potent ice
#

channel descriptions are useful to read ๐Ÿ˜„

frail thunder
#

xd

oak flax
#

i've just started learning object orientation, does someone have any recommendation?

simple trench
#

Anybody have any isometric map building experience? Also, if you're looking into any open source repos for games consider my GnomansLand repo. I would love to get your input. link: https://github.com/grahamwaters/GnomansLand

GitHub

An open-world reinforcement learning playground for gnomes filled with dangerous peril and bountiful treasure. - GitHub - grahamwaters/GnomansLand: An open-world reinforcement learning playground f...

#

I dislike that it made my link so large...

dawn quiver
delicate root
#

If you want to see other tutorials ๐Ÿ™‚ https://www.youtube.com/watch?v=bb_Keesez0s

In this tutorial, you will be able to create a procedural dynamic kapla tower.

With a small example, you will be ready to use HarfangHighLevel in your project.

HARFANGยฎ๏ธ High Level is a set of simple functions that allow you to code faster, and to achieve results without needing to become familiar with the deeper notions of complex programming...

โ–ถ Play video
oblique violet
#
class Inventory(Entity):
    def __init__(self):
        super().__init__()



if __name__ == '__main__':
    app = Ursina()
    inventory = Inventory()
    app.run()
```what is this
#

if __name__ == '__main__':

#

@dawn quiver

#

what this does

#

@dawn quiver

#

what is __name__

dawn quiver
dawn quiver
oblique violet
#

oo ok

#

not adding it

#

๐Ÿคฃ

dawn quiver
#

and this is not the right channel

oblique violet
#

huh

#

this is about game dev

dawn quiver
#

Ayo

#

Ping

dawn quiver
#

Uh

#

Nvmd

dawn quiver
oblique violet
#

!name

frank fieldBOT
#
Did you mean ...

ยป names
ยป off-topic-names
ยป if-name-main

dawn quiver
#

plz help me with pygame

#

i cann't load img

#

Hey guys i wanted a help in a help in a program

#

how can i check if some point is present inside a circle or not? I want to use circle outline as boundaries

#

I want to make a circle like container in which there will be a particle witth some velocity

#

and i want to detect its collision with the circle boundaries

oak flax
#

is there a way to jump to a certain point in the code right at the start? for example, i run the code, the code read a json with some variables, and then it jumps to the line 50 of the code

potent ice
#

You can't jump to line numbers, but you can neatly split up your code into functions/classes etc

hot willow
#

Hey there. My Pygame framework has had a pretty annoying issue for some time now. If a game object is destroyed (removed from mem) nearly right after it is spawned, sometimes the sprite wont delete. The object is removed completely from mem, but its sprite will remain in the sprite group. I have explicit instruction to remove sprites from all the group on destruction, and yet it stays. I will post the code in 1 second

#

not the code, but here is a video of what happens. The enemy shoots his bullet on (what I believe is) the same frame the game reloads the level. Reloading the level destroys all game objects. Clicking on the sprite shows that it is not a live game object too, as I have it so all game objects print info when clicked on. I can also print all objects, and there will be no bullet

#

This is the sprite code, it is a separate class from game objects.

class Sprite(pygame.sprite.Sprite):
    def __init__(self, parent, sprite, rotation, scale, layer: AbstractGroup) -> None:
        super().__init__()
        self.parent = parent
        self.layer = layer
        self.sprite = sprite
        self.scale = scale
        self.rotation = rotation

        #Unrelated Init stuff happens here
 
        #add sprite to sprite layer
        parent.pde.display_manager.group.add(self)

    def deconstruct(self):
        self.kill()
        del self
#

This code definitely gets ran under normal circumstances, otherwise all the sprites would linger on level reset. It's specifically when a sprite gets deleted very close to object creation. It disappears after because I also have explicit instruction to restart the display manager on game reload, which deletes the sprite properly, but it also deletes all the other ones. It's too slow to run every frame or anything like that.

rapid barn
#

Hey I'm trying to a multiplayer game with sockets

#

this is the code

#

import socket
import threading
HEADER=64
PORT=1000
SERVER=socket.gethostbyname(socket.gethostname())
FORMAT='utf-8'
ADDR=(SERVER,PORT)

client=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
client.connect(ADDR)

#

but i'm running an error

#

this is the error message

#

ConnectionRefusedError: [Errno 111] Connection refused
๎บง

hot willow
#

do you have a server running?

rapid barn
#

Oh

#

Ok

dawn quiver
#

do u guys really think python can make good games?

desert umbra
#

Because most of the game libraries in python are written in C/C++ so those languages take care of all of the rendering, animations, etc

#

And those libraries just have a python API for using their lower level stuff

#

So In most game libraries C/C++ do almost all the work and python is just for ease of use withthe C api

dawn quiver
#

For now i am using pythagoras theorem to give velocity to the particle when collision happens But the behaviour of collision does not seems correct.

raven marsh
#

hello there, so i use pygame for dis, ok why when i not moving mouse or not press any button the screen freeze? (code later)

frank fieldBOT
#

Hey @raven marsh!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

raven marsh
#

bruh ok

sinful lodge
#

huh

proper peak
#

decomposing a vector like that, can be done by scalar-multiplying it by a unit vector in the right direction. So start by obtaining two unit (length of 1) vectors, one along the line from the center to the collision point and another perpendicular to that

dawn quiver
#

i don't know how to get the angle theta

proper peak
#

You shouldn't need any angles with this approach

#

only the center of the circle, the collision point, and the velocity vector of the projectile

dawn quiver
#

can u please give a direct formula to obtain new velocity?

dawn quiver
proper peak
#

Well, something along the lines of

radial_vector = (collision_point - circle_center).normalize()
new_velocity = -2*radial_vector * velocity.dot(radial_vector)
#

the idea is to subtract twice the radial component of the velocity (which is the same as flipping the sign of that component while leaving the tangential one unchanged)

dawn quiver
#

I think i have a easier idea compared to this

#

just using simple circle formulas

#

But i respect your Answer too and thanks a lot for help dude

#

How about if i just find theta using this formula

#

and find the velocity

#

They aren't working perfectly that's why i asked for help

#

but i believe i am the one who is causing mistakes in executing them

#

guys

#

how to i add tree like object this is pic

#

just tree

#

i need chopabble tree

hot willow
dawn quiver
#

idk

dawn quiver
#

i want to make survival game

hot willow
#

Just getting a tree on screen is simple, but making it fully Choppable is complex

dawn quiver
#

mhm

hot willow
#

If you want to get started by putting it on screen, first make a rect. Do this by using:

tree_rect = pygame.rect.Rect(<x>, <y>, <width>, <height>)

This will make the Collision. Make sure to replace x and y with your position, and width and height with your size

#

Don't use the <> either

dawn quiver
#

yeah but i don't know how to install pygame

hot willow
#

Ok well thats step one

#

Are you using VS code?

dawn quiver
#

visual studio

hot willow
#

Yes

dawn quiver
#

yes

#

2019

hot willow
#

So go to the terminal

#

And type "pip install pygame"

#

See what that does

dawn quiver
#

in VS?

hot willow
#

Yes, there should be a python terminal

dawn quiver
#

im new at pygame

#

where?

#

can't find it

hot willow
#

Even though it's empty, try running minesurviv.py, this may bring the terminal up at the bottom

dawn quiver
hot willow
#

At the bottom right, do you see command window?

#

Try that

dawn quiver
#

wait

#

output?

#

oh command window

#

sry

#

what now?

#

uh no more that

#

i pressed x-_-

dawn quiver
#

looking for group who do gamjam in pygame

#

someone?

snow hill
#

In this tutorial, you will be able to import 3d model, such as gltf, glb, fbx... and add it in a scene for display.
With a small example, you will be ready to use HarfangHighLevel in your project.

HARFANGยฎ๏ธ High Level is a set of simple functions that allow you to code faster, and to achieve results without needing to become familiar with the d...

โ–ถ Play video
dawn quiver
#

looking for group who doing survival games

DM ME

dawn quiver
#

@neon plume are you making game?

proper peak
#

I just wouldn't use pygame.Vector2 for this if it's annoying like this.

#

something like a namedtuple would do:

class IVec2(typing.NamedTuple):
    x: int
    y: int
MAP_SIZE = IVec2(20, 15)
#

This wouldn't have vector operations, but if you need them, you can always convert it to a pygame vector

#

An alternative which has vectorized operations (but doesn't have field access like .x) would be a numpy array.

#

No real way around it I'm afraid. It wouldn't be 70 lines though. Actually, I think I have an old implementation somewhere...]

#
@dataclass
class Point:
    x: int
    y: int

    def __add__(self, other: "Point"):
        assert isinstance(other, Point)
        return Point(x=self.x + other.x, y=self.y + other.y)

    def __sub__(self, other: "Point"):
        assert isinstance(other, Point)
        return Point(x=self.x - other.x, y=self.y - other.y)

    def __mul__(self, other: int):
        assert isinstance(other, int)
        return Point(x=self.x * other, y=self.y * other)

    def __iter__(self):
        yield self.x
        yield self.y

    def __getitem__(self, item):
        return (self.x, self.y)[item]

    def toarray(self) -> np.ndarray:
        return np.array([self.x, self.y])

this one, say

#

rename it to IVec2 or something like that and there you go

#

could have saved some methods if it was a NamedTuple, actually

#
class IVec2(NamedTuple):
    x: int
    y: int

    def __add__(self, other: "IVec2") -> "IVec2":
        assert isinstance(other, IVec2)
        return IVec2(x=self.x + other.x, y=self.y + other.y)

    def __sub__(self, other: "IVec2") -> "IVec2":
        assert isinstance(other, IVec2)
        return IVec2(x=self.x - other.x, y=self.y - other.y)

    def __mul__(self, other: int) -> "IVec2":
        assert isinstance(other, int)
        return IVec2(x=self.x * other, y=self.y * other)

    def __rmul__(self, other: int) -> "IVec2":
        assert isinstance(other, int)
        return IVec2(x=self.x * other, y=self.y * other)

    def toarray(self) -> np.ndarray:
        return np.array([self.x, self.y])

yeah, that's shorter

#

What do you mean? Type hints in general, or ones with "string" types?

#

Yeah, I need to do this here because IVec2 isn't declared yet when the methods are declared

#

so I need this to not get a nameerror. Type checkers understand what I meant here.

#

also I forgot return types...

#

there, fixed.

#

yes, it works because it's iterable.

#

any iterable can be unpacked

#

(And it's iterable because namedtuples automatically are. Compare to the old Point where I had to do __iter__ manually)

#

Not really possible, they are internally very different. Also, doesn't really make sense: this vector is only for ints after all, whereas pygame's is for floats.

#

Making it a namedtuple gives you __iter__ and __getitem__ for free:

v = IVec2(5, 10)
# iteration:
for el in v:
    print(el) # 5\n10
# iterable unpacking:
x, y = v
# indexing:
print(v[0]) # 5
#

compare to my Point, which is only a dataclass, where I had to implement both of them manually:

    def __iter__(self):
        yield self.x
        yield self.y

    def __getitem__(self, item):
        return (self.x, self.y)[item]
#

Ehh, sorta
Layer 1) Of course they are the same - it's not like @dataclass and NamedTuple are some sort of magic; they just save time on writing boilerplate compared to just classes.
Layer 2) Actually this is a lie and NamedTuple is a little bit magic. Because it also changes the class's representation in memory to be stored roughly like a tuple, which is lighter than a normal object. The docs mention it:

Named tuple instances do not have per-instance dictionaries, so they are lightweight and require no more memory than regular tuples.

#

yeah, pretty much

charred quail
#

whats the most effiecent way to save all game data to a file

potent ice
charred quail
# potent ice Depend what you are saving

im not using any library specifically i just said it in the game dev channel cuz ik game devs use some way to store all data to a file, im not using this for a game even

potent ice
charred quail
#

but like what if u have like a whole game, with a buncha classes like the player and the enemies or smthng and the world data and all, how would u save all of those for the next launch

potent ice
#

Your game will have to support loading and saving certain states.

charred quail
#

yeah but how would u save all of the game data to a file at once and easily

potent ice
#

For example the player position and various stats + other states related to the map or area the player is located?

#

If it's a lot of data you might need to design some more compact file format

oblique violet
#
def find_free_spot(self):                                                      
  taken_spots = [(int(e.x), int(e.y)) for e in self.item_parent.children]    
    for y in range(8):                                                         
      for x in range(5):                                                     
        if not (x,-y) in taken_spots:                                      
          return (x,-y)
```what does this do
potent ice
#

Looks like it's finding free spots in a 5x8 grid?

oblique violet
#

oo

#

i found a tutorial

#

it has 35 parts

#

and average is 1.5 hour

#

gg my brain

lunar venture
lunar venture
rapid barn
#

Hey, Iโ€™m having troubles making my sounds play

#

It is pygame btw

dawn quiver
plush edge
#

yo

#

any ideas for pygame

#

??

oblique violet
#

anyone has source for ursina minecraft?

#

except this one

proper peak
dawn quiver
#

if someone know a python project like street of rage but 2022 version i reallywant to see it

rapid barn
old hill
#

Hey!
I write my project with pygame
I have a rectangle and I want to push it around with the mouse courser the closer the mouse gets the faster the rectangle should get pushed away.
I have no idea how to implement this and how the math behind this should work.
I would really appreciate it if anyone could help.

unreal river
normal anvil
#

hey guys

#

i need a game developer in my team im already working on

#

the code needs to be in python

#

or better

quaint fog
#

whats better arcade or pygame

dawn quiver
# quaint fog whats better arcade or pygame

Honestly.. I'm surprised someone hasn't already linked it but there is a comparison page on the arcade website

It's pretty biased, they say PyGame doesn't support scaling or rotation, but it does! ๐Ÿ˜„
And also the "default hitbox" comparison makes it look back, but pygame.Surface.get_bounding_rect exists, and you can even do pixel perfect collision using pygame.mask.Mask.overlap

But anyways I wouldn't say either is "better" or "worse" than the other, it's up to your preference :)
Arcade enforces an object oriented paradigm, which can be a pro if you were going to use it anyways, but if not pygame is pretty flexible on the paradigm side

#

I might also be a bit biased, since I've contributed to the PyGame repository whereas I haven't to arcade's

#

They both use different frameworks and are also slightly different from each other, pygame is more of a wrapper for SDL with added functionality, whereas Arcade was made more with 2d game dev on its mind
Of course pygame was as well, but you get more from arcade right off the bat

But there are a lot of support libraries which you can use along with pygame, such as pygame_gui and pymunk which are really nice. I'm not too sure about arcade, but they probably wouldn't need them considering a lot comes with the installation

quaint fog
oblique violet
#

:D

dawn quiver
#

Ninja themed platformer ducky_dave

normal anvil
oblique violet
normal anvil
#

its ok

#

just pm me

olive geode
dawn quiver
plush edge
latent stone
sinful lodge
#

fast

#

maybe make them slower?

dawn quiver
#

Good idea, I'll slow it down a bit ๐Ÿ‘

sinful lodge
#

mhm

#

wait axis from coding den?

dawn quiver
#

What's coding den

sinful lodge
#

nevermind

#

"the coding den" the discord server

dawn quiver
#

Ah

#

Never heard of it

sinful lodge
#

oops wrong person then

dawn quiver
#

Yeah probably

old hill
latent stone
minor mortar
#

hey everyone I'm thinking about using python arcade, and I'd like to build binaries for multiple platforms. Is there an example project which shows how to package an arcade game, preferably using a CI system?

vagrant saddle
patent locust
dawn quiver
hot willow
devout nexus
#

@dawn quiveri would i actually play that if u add some kind of multiplayer or smth

#

amazing work

dawn quiver
#

Thanks!

But yeah due to the fact that it is being made in Python, my networking knowledge is exceedingly low, and I don't think I have enough of a budget nor time, I probably won't be able to work on a multiplayer implementation!

devout nexus
devout nexus
#

@dawn quiver can u add me plz i want to ask you something

dawn quiver
devout nexus
#

well its stupid af thats why i want dm xd

#

but ok

#

give me a sec ill send a ss

#

@dawn quiver

#

i want the [Username]: to appear bellow the attention

#

can u help me?

dawn quiver
#
print(Fore.YELLOW + "[ATTENTION]...")
username = input("[Username]:")
#

Would probably be better to ask in a help channel

devout nexus
#

oh true sry

potent ice
#

Recruitment here is against the rules

tawny pumice
#

Ohhh Iโ€™m Sorry

potent ice
#

Anything open source is fine usually, but when money is involved that's crossing the line.

white nova
#

hi guys

#

im new here

gentle ivy
#

I've asked this question some time ago in #python on Libera, and now I'm relaying it here.
Does anyone have an example PyGame program that has a game map of a specific size, and when the player moves (via i.e. WASD), the player is centered and the surroundings move around the player at the perspective of the viewport?

slate wharf
#

do you mean like

#

the player is on the center of the screen and when the player moves

slate wharf
slate wharf
# unreal river like a camera?

i think that they mean that the player will be always centered in the middle of the screen so when you move the world technically moves around you

slate wharf
#

i could easily make one in pygame if you so desire

slate wharf
unreal river
#

the camera is focused on the player

gentle ivy
#

That is probably what I intended, though I don't work with cameras and I'm unfamiliar with the terminology

lapis ore
#

Hey can anyone suggest my some basic games for python.

unreal river
drowsy trellis
#

can anyone tell me how to avoid shadowing of parameters ?

unreal river
dawn quiver
raven marsh
#

hello, i'm using ursina engine, and i got dis problem, i wanna make a cube with custom texture (texture is the grass.png) but it turns out that the output is kinda...... yeh, how to fix that? ty

tranquil girder
#

That's kind of an inefficient layout, but what you should do is make a custom 3d model with custom uvs. See this: https://www.youtube.com/watch?v=Yx2JNbv8Kpg&t=19s&ab_channel=FlippedNormalsMarketplace

Enjoy this free chapter from our FlippedNormals Exclusive - UV Mapping for Games https://flippednormals.com/downloads/uv-mapping-for-games/

Early Bird Special - Get the full course at 25% OFF until November 6th

โ–ถ SUBSCRIBE | http://www.youtube.com/channel/UCvd6HxqYVWvfvfaF2Ereb9Q?sub_confirmation=1

โ–ถ MARKETPLACE | https://flippednormals.com/
...

โ–ถ Play video
sudden ridge
turbid fog
#

Why is this happening>

potent ice
dim vale
#

3d games in python, is there any good imports or do i just have to make raytracing through pygame

grand imp
#

Ursina is a popular choice for 3d in Python

dim vale
#

ok ty

grand imp
#

There's also Panda3D

#

I think one is based on the other, but I forget which is which

potent ice
#

Ursina is a higher level wrapper over Panda3D

icy loom
#

or it's on PATH, even worse

brisk dawn
#

any realistic jump physics for pygame?

hot willow
rugged herald
#

I got a question, I have a final project in comp sci in vs code. I'm just wondering, if I were to code let's say pokemon. Using a database and csv file, just the og 151. Set each pokemon 4 set moves at level 100 stats and just let the user pick 2 and fight. Would it generally be somewhat easy. I feel like I'm gonna do this but I'm just wondering if anyone has tips or tricks to some of this stuff

#

I wish I could use pygame

#

I'm not allowed to install any other programs other then flask and that's not really useful unless I wanna do bootstrap and make a website

dawn quiver
dawn quiver
#

If i use ursina can I also use panda3d with it?

potent ice
#

I'd just start playing around with Ursina if you want a nicer abstraction.

dawn quiver
#

Yes but since ursina is a wrapper of panda3d

#

Can i still use panda3d with it?

potent ice
#

I don't see why not. It's an open source library you can build on if needed.

dawn quiver
#

I see great!

#

So I will use ursina abstraction and panda3d exclusive features

#

Time to check it

#

It does lack an editor but this is not a big problem

tranquil girder
#

yes, you can

dawn quiver
#

yes

tranquil girder
#

there's a level editor in the works, but you can also use blender as a level editor

#

or make your own, which is kinda fun

dawn quiver
#

Hmm

dawn quiver
#

@potent ice

potent ice
#

pokepetter would know ๐Ÿ˜„

tranquil girder
#

More like rdb would know. You don't need a vulkan renderer though

dawn quiver
dawn quiver
normal silo
#

IIRC it's still WIP, but seems like there is a good amount of effort being put into it / progress because it's widely requested.

dawn quiver
#

Yeaa

#

I came from C++ background

#

I want to give python a go

normal silo
#

Panda3D does both (it has a bindings generator in it (so it can do more than Python, I think someone recently requested Nim)).

#

Python is very nice if you don't really want to deal with project setup and just go.

#

(For these kinds of quick projects Ursina helps too)

#

(*More like non-projects)

dawn quiver
#

It would be nice if I got a game up and running fast!

#

Maybe i might even use it to visualize some stuff

normal silo
#

I use Ursina/Panda3D for data visualization (and I don't think i'm the only one doing that).

dawn quiver
#

Ohh

#

Ok im motivated

normal silo
#

*Yeah there is at least one other ML engineer that has shared that they are using Ursina for data vis.

frozen knoll
#

Arcade 2.6.14 is out:

dawn quiver
frozen knoll
potent ice
proud egret
#

has anyone made a game in a notebook?

ripe hornet
#

Hey guys! Can I programe a nice simple game with python? If yes, what library or module do you suggest me to use?

ripe hornet
#

I dont have an idea yet

#

I just think it would be fun and relaxing to make one]

potent ice
ripe hornet
#

@potent ice do you have any idea?

potent ice
#

Check tutorials and examples to get some ideas

ripe hornet
#

Idk what python is capable of when it comes to games..

dawn quiver
#

Well if it's just a nice simple game, especially if 2d, you shouldnt run into any Python faulty problems

#

Someone has made an entire terraria clone with Python, using a wrapper for SDL (pygame)

slender lark
#

hey

potent ice
white vector
#

Beginning with game development i would say terminal games first then build up to gui.
After all, that's the order on which humanity figured it out, right?

austere estuary
#

Is it against server rules to ask for help debugging this presumably simple collision problem I'm having? I thought a case of beer would help but I think it made matters worse

#

I could google it but the alcohol has made me feel social

white vector
tame patio
dawn quiver
#

You can use unity for creating grapics right for pygames? :3

grand apex
frank fieldBOT
keen phoenix
#

Ok, so I have crated a little raycaster and it has a very small, but also very bad problem. So I'm trying to render textures on walls, the problem is when a wall is near the camera, it renders fine (picture 1), but when a wall is far away from the camera, it renders in very low quality (picture 2). I know why this happens, the walls have a fixed x scale and when the textures render on far away objects they appear low quality. But I don't know the solution to this. Here's my code: https://paste.pythondiscord.com/awihewiziz. The problem appears in the full_raycast function. Ignore the ppm_loader module, it just loads a .ppm file into a 2D list.

keen phoenix
#

I am making a Wolfenstein 3d clone so textures are neccesary

torn jackal
#

hey guys, I just would like to put a file which is string in integer, there is just a simple number is the file (0) but it showsme this error : python ValueError: invalid literal for int() with base 10: ''

#

please help

#

and mention me if u can help

#

okay forget it works now ๐Ÿ™‚

grim abyss
# keen phoenix Ok, so I have crated a little raycaster and it has a very small, but also very b...

Maybe this can help you. I would guess your scaling the texture wrong... https://killerrobotics.me/2021/08/13/raycasting-game-in-python-and-pygame-part-1/comment-page-1/

I have started developing a raycasting game in Python (using PyGame) as a learning exercise and to get a better understanding of the math and techniques involved. Raycasting is a graphic technique โ€ฆ

keen phoenix
#

Ooh

#

It looks like I have done it correctly

#

But I have used a slow ray algorithm so setting the number of rays to 480 would be impossible

#

Now I'm trying to understand the DDA algorithm

#

Thank you very much!

grim abyss
#

Sure

noble sundial
#

On a 2d game, with a set of destinations, have a set (different number) of enemies to move to a destination. Each enemy should go to the closests and two enemies should not go on the same destination.

grim abyss
#

anybody know a decent site where I can get high-quality sprites/textures? I wanna mess around with arcade

regal burrow
#

hey i have a question? im making a tool for fallout four special chart that will optimize to what class you want to play but i dont know wether to send it in this channel or #tools-and-devops

true trail
#
class Char(pygame.sprite.Sprite):
    def __init__(self):
        super().__init__()
        self.counter = 0

        char_1 = pygame.image.load('assets/character/char1.png').convert_alpha()
        char_2 = pygame.image.load('assets/character/char2.png').convert_alpha()
        char_right = pygame.image.load('assets/character/char_right.png').convert_alpha()
        char_left = pygame.image.load('assets/character/char_left.png').convert_alpha()

        self.char_side = [char_1, char_2, char_right, char_left]
        self.char_index = 0

        self.image = pygame.transform.scale(self.char_side[self.char_index], (80, 80))
        self.rect = self.image.get_rect(center = (width/2, height/2))

        self.imageh = test_font.render(f'{self.counter}', False, (0,0,0))
        self.recth = self.imageh.get_rect(topleft = (730,32))

    def movement(self):
        keys = pygame.key.get_pressed()

        if keys[pygame.K_DOWN] and self.rect.bottom < height - 10:
            self.image = pygame.transform.scale(self.char_side[0], (80, 80))
            self.rect.move_ip(0, 5)

        if keys[pygame.K_UP] and self.rect.top > 10:
            self.image = pygame.transform.scale(self.char_side[1], (80, 80))
            self.rect.move_ip(0, -5)

        if keys[pygame.K_RIGHT] and self.rect.right < width - 10:
            self.image = pygame.transform.scale(self.char_side[2], (80, 80))
            self.rect.move_ip(5, 0)

        if keys[pygame.K_LEFT] and self.rect.left > 10:
            self.image = pygame.transform.scale(self.char_side[3], (80, 80))
            self.rect.move_ip(-5, 0)

    def counting(self):
        for i in money:
            if self.rect.colliderect(i):
                self.counter += 0.1
                print(self.counter)

    def drawing(self):
        screen.blit(self.imageh, self.recth)

    def update(self):
        self.movement()
        self.counting()
        self.drawing()
true trail
#

can someone tell me the reason why self.drawing doesnt work?

#

i mean if i wanna print self.counter, it increase the value

grim abyss
true trail
#

but in the window it doesnt screen the current value

true trail
#

i have one self.image and one self.imageh

#

is it possible to do?

grim abyss
#

idk dude. I'm using arcade atm. pygame is.......old, lol

grim abyss
#

!pypi arcade

frank fieldBOT
true trail
#

pyagme @_@

#

too sad

dawn quiver
#

You want to draw self.counter on the window?

#

Make a font object as a class variable,

self.font = pygame.font.Font(None, 15)

None loads the default font, 15 is the size, you can change that to whatever you want

#

And then to draw it

text_surf = self.font.render(str(self.counter), True, "white")
screen.blit(text_surf, pos)
dawn quiver
true trail
dawn quiver
#

Did you get any errors?

true trail
dawn quiver
#

Are you calling update?

true trail
#

yes

dawn quiver
#

Are you sureee

dawn quiver
#

I didn't completely understand the problem

#

Did you want the counter to appear on the screen?

true trail
dawn quiver
#

No

#

I don't use DMs

#

We can continue here

true trail
dawn quiver
#

So you do want a counter to appear on the screen? That's the problem correct?

true trail
#

but the self.counter in the self.imageh, doesnt work, i mean, display "0" but then doesnt increase when i touch "i* in money

dawn quiver
dawn quiver
#

Try this and let me know

true trail
dawn quiver
#

Just modify your existing method

true trail
#

ok, i will try in 20-25 mins because im not on the PC, but I'll go soon as i possible

#

thanks

true trail
#

really, its from my heart

dawn quiver
#

Did it work?

true trail
#

yes

true trail
dawn quiver
#

Great!

true trail
#

i have a question, is there a way to use that "self.counter" in another class?

true trail
#

this is my game, and for example i would like to add a cave that costs 1.50, and ofc i have to decrease that number, can i do from another class?

true trail
#

@dawn quiver is it possible?

gentle ivy
#

I need an example in PyGame where player movement is keyboard-controlled and the player is centered (i.e. other objects move around the player). As I am very rarely on here, please highlight me if you kindly reply. Thanks!

brittle venture
#

Can a 16 gb ram without graphic card for a laptop can game be developed on it ?

#

To get more more battery life

grim abyss
#

are you asking if you can develop a game on a laptop with an integrated gpu that has 16GB of ram?

#

if so, why yes of course...

mystic parcel
#

i want to learn pygame but is it possible on a 4 gig ram laptop?

#

like a very low spec laptop

dawn quiver
mystic parcel
#

i dont know what gen this is but its really old

#

like very old

#

now can i ask again, is it really possible?

mortal yew
# mystic parcel

I actually wrote a project using PyCharm and PyGame with 4GB of RAM.
Specs: 1.8 GHz CPU, 4 GB RAM, 2 cores.

You're probably fine if you use an editor like IDLE.

mystic parcel
#

ah thanks

#

i was doubting my laptop but this helped

true trail
dawn quiver
#

Hello

true trail
dawn quiver
true trail
#

but foo and cave are class or def?

dawn quiver
#

Sorry, my bad, I made a typo

true trail
# dawn quiver Of course, you would need to pass in the counter value from outside to wherever ...
class Char(pygame.sprite.Sprite):
    def __init__(self):
        super().__init__()
        self.counter = 0
        char_1 = pygame.image.load('assets/character/char1.png').convert_alpha()
        char_2 = pygame.image.load('assets/character/char2.png').convert_alpha()
        char_right = pygame.image.load('assets/character/char_right.png').convert_alpha()
        char_left = pygame.image.load('assets/character/char_left.png').convert_alpha()

        self.char_side = [char_1, char_2, char_right, char_left]
        self.char_index = 0

        self.image = pygame.transform.scale(self.char_side[self.char_index], (80, 80))
        self.rect = self.image.get_rect(center = (width/2, height/2))
    
        self.imageh = test_font.render(f'{self.counter}', False, (0,0,0))
        self.recth = self.imageh.get_rect(topleft = (730,32))

    def movement(self):
          ....

    def counting(self):
        for i in money:
            if self.rect.colliderect(i):
                self.counter += 0.1
                #print(self.counter)

    def drawing(self):
        self.imageh = test_font.render(f'{format(self.counter, ".2f")}', False, (255,255,255))
        screen.blit(self.imageh, self.recth) 

    def update(self):
        self.movement()
        self.counting()
        self.drawing()
#

but i want to pass the self.counter that has a value, becuase self.counter is always 0

true trail
dawn quiver
true trail
#

ok so i have to create something like this

class Cave(pygame.sprite.Sprite):
  def __init__(self):
    super().__init__()
    self image = ...
    
    self.rect = ...
  
  then how can i use the current counter of Char()
dawn quiver
#

Yes?

#

What?

true trail
#

i dont understand how can i use the self.counter of char, for example here, wait

dawn quiver
true trail
true trail
dawn quiver
#

Yes, you can now use the counter as you wanted.

true trail
#

what? how xD

dawn quiver
#

I showed you an example.

#

You just need to map the Foo and Cave I showed to what you have.

dawn quiver
#

Yes

true trail
#

its white and it doesnt work

dawn quiver
#

You arent doing anything with it

#

What do you mean by "white"

#

That's just the syntax highlighting for attributes.

dawn quiver
#

You need to use it to make it work

true trail
#

yeah, but here i'm using

dawn quiver
#

What?

#

You arent

#

Hover over counter

true trail
#

i wanna print in someway the current counter in the def is_collided_with(self)

dawn quiver
#

You should pass it into is_collided_with after creating a parameter for it, instead of using the variable from the global scope like that..

dawn quiver
#

I dont use sprite groups

gentle ivy
true trail
#

mhh

gentle ivy
#

My OS's overhead is about 280 MiB, leaving me about 700 MiB of usable RAM for PyGame ๐Ÿ™‚

true trail
dawn quiver
#

It probably could, but I'm not sure if that kill method ends the outer method, probably not

true trail
#

i think i'm making mistakes lol

dawn quiver
#

It's fine, everyone makes mistakes

true trail
#

yes, the problem is that i have no ideas

true trail
ancient tendon
#

does game development include app here

#

cuz i want to tell abt my app

true trail
grim abyss
dawn quiver
grim abyss
dawn quiver
#

Nope

grim abyss
#

sorry bud lol

dawn quiver
#

I use pygame.math.Vector2 so I'm covered ducky_regal

dawn quiver
#

hey guys im just done making a snake game and i made the file into an exe file and it gave me this msg

#

Traceback (most recent call last):
File "game.py", line 3, in <module>
ModuleNotFoundError: No module named 'freegames'

#

what did i write wrong in my code?

#

take out py import freegames

#

from freegames import square, vector

#

this is the incorrect line

#

oh

#

ok i will try

broken citrus
#

yo guys

#

what should i use to load

#

a fbx file and it's textures

#

and just render it

#

im trying to do it in pyglet but its buggin

#
 raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid value'
#
import pyglet
from pyglet.gl import *

window = pyglet.window.Window(width=720, height=480)
window.projection = pyglet.window.Projection3D()
batch = pyglet.graphics.Batch()


@window.event
def on_draw():
    window.clear()
    batch.draw()


@window.event
def on_mouse_drag(x, y, dx, dy, buttons, modifiers):
    glRotatef(1, dx, dy, 0)


def rotate(dt):
    glRotatef(0.5, dt, dt, dt)


if __name__ == "__main__":
    glEnable(GL_MULTISAMPLE_ARB)
    glEnable(GL_DEPTH_TEST)
    glEnable(GL_LIGHTING)
    glEnable(GL_LIGHT0)

    model = pyglet.model.load("SK_AR_01.obj", batch=batch)
    glTranslatef(0, 0, -3)
    pyglet.clock.schedule_interval(rotate, 1/60)
    pyglet.app.run()```
grim abyss
broken citrus
#

unity asset store

#

i solved my issue i just switched over to panda3d

#

now im just having a issue of screenshotting

grim abyss
broken citrus
#

50$

grim abyss
#

wow, lol

broken citrus
#

u get like 2000 assets

grim abyss
broken citrus
#

animations

#

human models

#

weapons

#

and scripts

grim abyss
#

damn, you have a link to this asset pkg ?

broken citrus
sleek forum
#

Hi Iโ€™m making a small mr wolf game using python matplotlib for my course the assessment is due Sunday and I canโ€™t get the code to do what I want I was wondering if I could get on a call with someone so that I can get some help ?

ancient tendon
#

do u guys use pytqt5

#

frequently

#

for app dev

hot mesa
#

@tame vale can u help me?

tame vale
broken citrus
#

how do light up the whole scene?

#

in panda3d

thin bluff
#

async def on_message(message):
role = discord.utils.get(message.guild.roles, "Awaiting on first message")
if(role in message.author.roles):
message.author.remove_roles(role)
await bot.process_commands(message)

potent ice
broken citrus
potent ice
#

Their project web pages (and probably docs) link to it

#

That's why you should read docs ๐Ÿ™‚

broken citrus
#

i dont usually look for socials in docs

#

i just come here and ask about it

#

and if there is no answer i dive into the source code

potent ice
#
broken citrus
#

yea i just joined it

potent ice
broken citrus
#

i dont use ursina but should i?

potent ice
#

Why not. So much overlap anyway

broken citrus
#

whats ur opinion on both

#

panda3d gets tidious fast and doesn't look good

potent ice
#

Then use ursina

broken citrus
vagrant saddle
vagrant saddle
#

looks like the default pipeline which is nice enough to run on almost all desktop / mobile device without expensive gpu

vagrant saddle
broken citrus
#

oh yea this guy tobspr

#

legend

vagrant saddle
normal silo
# broken citrus

You have to learn how shaders, lighting (in general), and physically based rendering works.

#

Making something look good is a complicated topic.