#game-development

1 messages · Page 58 of 1

umbral fulcrum
#

Do you wanna scale the window manually, by hand; or in the code?

#

If you need to do it in your code, you can simply use pygame.transform.scale to your root display object and then create a new display object. But it may require to close the current window for a sec

#

I haven't tried that before, I'll check it out

burnt stump
#

@umbral fulcrum yes, that's what I've been pondering about

#

Do I have to create a new window copy every time the window is rescaled?

#

There's this, but I don't quite get it:

umbral fulcrum
#

I didn't even know that we can create a resible window in pygame

#

pygame.display.set_mode((width, hegiht), pygame.RESIZABLE)

burnt stump
#

You can, but it won't keep the aspect ratio

umbral fulcrum
#

And every time you resize the window, you get an pygame.VIDEORESIZE event

#

Yes, I'm coming to you problem

burnt stump
#

Sure

#

What I don't understand is: why do I specifically have to put a window within another window? That's a bit clumsy

umbral fulcrum
#

You don't have to

#

Give me five minutes

#

I'm a little bit confused

burnt stump
#

@umbral fulcrum sure

thick forge
#

Hey, I am a little confused with this LOVE2D function, just started learning the basics. How do you implement or use the function love.graphics.setDefaultFilter()?? Because whenever i try i seem to get the arguements in the function wrong??

burnt stump
#

@umbral fulcrum still there?

umbral fulcrum
#

I'll let you know when i manage to do that

#

I couldn't spare my time yet

serene flame
#

Hi, When i want to develop a game when should i consider Tkinter over Pygame? is that even makes sense ?

umbral fulcrum
#

Tkinter is a GUI library. If you want libraries/frameworks that are developed for creating games, you can try Pygame. There are also many other libraries like Pygame

#

Arcade, for example

dawn quiver
#

develop a game?

#

pygame and frameworks are better used for small prototypes

#

a full, released game will be harder to do

umbral fulcrum
#

Python is not the true language for game development, but yeah, you can have fun

#

imo, it's much better than starting with Unity or any other game engines

#

It forces you to understand how the actual game engines work

random frigate
#

but for getting started with Unity I have to learn C++ or C# am i right?

umbral fulcrum
#

Yes, C#

dawn quiver
#

Imagine if you can use Unity with python

hot crest
#

use ue4

random frigate
#

like I wanna build a game where you can have fights and these stuff there's no need to be 3d game...but Im a bit afraid of have some problems that I cant do with pygame

dawn quiver
#

Does Unreal support python?

#

I thought it didn't

hot crest
#

it does support it but not everything is possible

umbral fulcrum
#

@random frigate start with simple stuff, see what you can do, that might expand you imagination for the game you want to create

dawn quiver
#

Ooooooh this could be good

#

Does it support some of the basic libraries?

umbral fulcrum
#

If ue4 engine supports python at some fields, you should be able to use any library you want

hot crest
random frigate
#

@umbral fulcrum yup I will try to spend some more time with it and see what I can do with it, also I just started with pygame, thanks for the advice.

umbral fulcrum
#

You're welcome, good luck

random frigate
#

u 2 (:

dawn quiver
umbral fulcrum
#

Dude, that looks terrific

#

I love pixel graphic based games, and basicly pixel art

#

The 'PX' at the end of my name actually abbreviation for pixel :))

burnt stump
#

@umbral fulcrum I tried to copy the window to a new variable and then do a transform operation

#

But I think I'm missing something, because the graphics are not showing

umbral fulcrum
#

I got that

burnt stump
#
elif event.type == pygame.VIDEORESIZE:
            if event.w < 600:
                event.w = 600
                
            if event.h < 480:
                event.h = 480
            
            console.scaled_screen = console.screen.copy()
            console.screen = pygame.transform.scale(console.scaled_screen, (event.w, event.h))
            pygame.display.set_mode((event.w, event.h), pygame.RESIZABLE | pygame.HWSURFACE | pygame.DOUBLEBUF, 8)
            
            console.refresh()
            pygame.display.flip()
umbral fulcrum
#

Somehow i cannot open pastebin site, unfortunetly i gotta paste the code here

#
import pygame
from copy import deepcopy
pygame.init()

current_width = default_width = 350
current_height = default_heigth = 250

root = pygame.display.set_mode((default_width, default_heigth), pygame.RESIZABLE) 

main_surface = pygame.Surface((default_width,default_heigth))

main = True
while main:
    main_surface = pygame.transform.scale(main_surface, (default_width, default_heigth))
    
    main_surface.fill((255,255,255))
    pygame.draw.circle(main_surface, (0,255,0), (100, 100), 50, 12)

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            main = False
        elif event.type == pygame.VIDEORESIZE:
            root = pygame.display.set_mode((event.w, event.h), pygame.RESIZABLE)
            current_width, current_height = event.w, event.h

    main_surface = pygame.transform.scale(main_surface, (current_width, current_height))
    root.blit(main_surface, (0, 0))
    pygame.display.update()
#

Basicly: at the beginning you're choosing your default window size. If we resize the window, the current size will change. But we want to draw things according to our normal size, than scale them to the current size

#

the first line in the while loop scales the surface to our orriginal size

#

After that, you can do everything you want

#

At the end, it scales the surface to current size

#

and somehow, i couln't use the original 'root' surface that we define at the beginning

#

So i decided to create another surface, use it as a core surface and blit it to my 'root' surface's (0, 0) coordinates

#

I hope you understand

burnt stump
#

Sorta

#

Here is what I tried to do

#

Whenever there is a resize event, just copy the contents of the original screen to a copy screen, then make the original screen take a transformed copy, then update

#

Would that also work?

umbral fulcrum
#

It does the scaling part every frame

burnt stump
#

Oh, no

#

I'm working on a console-type application

#

so, there are no complex animations

#

@umbral fulcrum my code is not working at all though

#

I just get a blank screen

#

Can you help me understand what am I doing wrong?

dawn quiver
#

How’s does game development work in python because I’m not sure really about the graphics and stuff like what type of games are we talking about here

#

The graphics you do with game engines and graphics modules, like every other language...

#

And you can make any type of game you want

#

But how

#

I have never seen a python game with graphics that use stuff like vulka

#

Vulkan*

burnt stump
#

@dawn quiver You use libraries, which is a way you can "borrow" code from somebody else.

dawn quiver
#

Do you know any?

burnt stump
#

One example is the library we are discussing right now, Pygame

#

Which is actually an SDL library wrapper

dawn quiver
#

SDL?

#

pygame, simplegui

burnt stump
#

@dawn quiver it's a library for drawing into the screen

#

And also for accessing a computer's sound system

dawn quiver
#

But is there anyway to make it use graphics

#

Like a game that has some nice looking OpenGL graphics

burnt stump
#

Sure

#

It depends on the library you are using

#

You have functions to say "load this image at window X, position X, Y"

dawn quiver
#

But if I get it right python isn’t for complex games like counter strike because they use a lot of graphics rendering and requires a lot of attention building and either way doesn’t run as smooth and that is why every good game (almost) uses cpp

umbral fulcrum
#

'good game' expression is very subjective, but yeah, c++ runs pretty much faster than python

#

It's because python is not developed for that purpose

burnt stump
#

@dawn quiver there's no such thing as what you say. Python can be compiled with tools such as PyPy or Cython

#

you can also use inline assembly

#

By the way

#

This is a pure Python Gameboy emulator

#

it uses Cython, I believe

dawn quiver
#

What is Cython?

burnt stump
#

Python translated to C

umbral fulcrum
#

I'm not really sure about what I'll say, but i guess python compile itself right before it runs, also it uses dynamic variables, these some things that make python slow

burnt stump
#

And then compiled

umbral fulcrum
#

Yes, there is PyPy for the first one

burnt stump
#

@umbral fulcrum not necessarily

#

I mean, Python doesn't necessarily compile itself before it runs

#

BUT you can make it do it

umbral fulcrum
#

Every language needs to be compiled before it runs

burnt stump
#

Not necessarily. I mean, not directly

#

I'm writing something that doesn't directly need to be compiled

#

It's based on Applesoft BASIC

umbral fulcrum
#

My knowledge about this topic was pretty wrong

#

But i also couldn't understand what exactly happens when you run a python script

#

I just read this

#
def hey(x):
  print(undefined_variable)
#

Even though there is an undefined variable, when you run this, it won't give you any error

#

But I'm a little bit confused about what that proves

next steeple
#

python is compiled interpreted

#
Python is a “COMPILED INTERPRETED” language. Means when Python program is run, First Python checks for program syntax. Compiles and converts it to bytecode and directly bytecode is loaded in system memory.
burnt stump
#

@umbral fulcrum can you help me understand something?

fiery magnet
#

Which graphics library should I use?

#

Arcade, pygame, or something else?

potent ice
#

Just start somewhere. Arcade is easy to start with at least. What you do with arcade will translate to other libraries anyway

#

This is assuming you are mainly doing 2D stuff

burnt stump
#

@potent ice hey, mate

#

do you use Pygame?

potent ice
#

Sometimes

burnt stump
#

Do you understand how keeping aspect ratio works?

#

I'm trying to use Pygame.transform.scale, and the best I can get is this:

#

This is supposed to be a cursor

#

@potent ice What am I doing wrong?

#

I'm trying to obtain height and width from the VIDEORESIZE event, but apparently, if you try to obtain current height from event.w, this causes a loop

potent ice
#

I know the new dev10 release have a new scaled mode that is supposed to be faster

burnt stump
#

I just tried it

#

but it's buggy

#

It introduces a few bugs in my code, e.g, the cursor stops blinking, and there's no repeated typing while pressing down

potent ice
#

hmm. No idea. I normally use pygame in combination with opengl so all scaling is done in opengl

burnt stump
#

How?

foggy python
#

@burnt stump so you want your stuff to scale upon VIDEORESIZE while maintaining the same aspect ratio of your images? This means you'll be showing different amounts of content depending on the aspect ratio of the window. It becomes more of a math thing than a Pygame thing. You may want to bind certain elements of your project to certain sides of the screen (using math). For the rest, just pick an axis and stretch the surface you're rendering onto to fit the axis you chose. For the other axis, you'll have to add content (depends on what you're doing) as it expands. As a side note, if you're resizing images you're rending, you'll need to keep in mind that Pygame doesn't blur with resizes, so things will look weird if you aren't careful.

burnt stump
#

@foggy python that’s exactly what I want

#

There are no images, just text

#

The problem is that trying to modify or access event.w and event.h is triggering a loop

#

Pygame 2.0-dev 6 has the behavior I want, but it’s very buggy

foggy python
#

what do you mean by triggering a loop?

burnt stump
#

@foggy python I mean the event resize loop gets called several times

#

In some cases, “eternally”

foggy python
#

I don’t have that issue and I’m on 2.dev6

#

which is odd

#

you might be doing something wrong

serene flame
#

@umbral fulcrum
I was able to develop downloadable Blackjack game and then I realized so many functionalities are easier with PyGame..
So i kinda felt like I

#

... waste my time with the Tkinter lol

umbral fulcrum
#

There aren't any UI elements in Pygame, that's why it was easier to me to create that game in Tkinter. It took me a couple of hours back then, shouldn't be hard.

#

Is that GIF from one of your games @foggy python ?

potent ice
#

@foggy python Tested dev10?

burnt stump
#

Hi

#

@potent ice Do you use Pygame?

foggy python
#

@umbral fulcrum yes

#

@potent ice dev6 has been pretty stable and I’ve heard of a ton of issues on the newer releases, so I’m sticking with 6 for now.

burnt stump
#

@foggy python hey, mate

#

sup

foggy python
#

Hi?

burnt stump
#

@foggy python I can't really understand how pygame.transform.scale works

#

I can figure out it rescales something to a target resolution

#

but for some reason, I can't use it properly

#

For example

#
elif event.type == pygame.VIDEORESIZE:
            if event.w < 600:
                event.w = 600
                
            if event.h < 480:
                event.h = 480
                
            console.scaled_screen = console.screen.copy()
                
            console.width = event.w
            console.height = event.h
            
            pygame.transform.scale(console.screen, (console.width, console.height))
            console.screen.blit(console.scaled_screen, (0,0))
            
            
            '''console.refresh()'''
            pygame.display.update()
#

This doesn't work

#

(it has no effect)

foggy python
#

Are you trying to resize your main rendering surface?

#

Just redefine it with new dimensions.

burnt stump
#

@foggy python I'm trying to scale it

dawn quiver
#

elif event.type == pygame.VIDEORESIZE:
if event.w <600:
event.w = 600

        if event.h <480:
            event.h = 480
            
        console.scaled_screen = console.screen.copy ()
            
        console.width = event.w
        console.height = event.h
        
        pygame.transform.scale (console.screen, (console.width, console.height))
        console.screen.blit (console.scaled_screen, (0,0))
        
        
        '' 'console.refresh ()' ''
        pygame.display.update ()

I do not understand
c to do what?

burnt stump
#

Sorry, what?

foggy python
#

I did a video on window resizing. I’m busy atm tho so I can’t link it.

#

You can google for it tho

burnt stump
#

What should I Google for?

foggy python
#

DaFluffyPotato

#

It’s on my YT

burnt stump
#

@foggy python I managed to scale the screen. The command prompt is upscaled, but when drawing the cursor, it still draws to the old size.

#

because It's a separate event.

foggy python
#

So your issue is that you’re only scaling some of your stuff?

burnt stump
#

@foggy python I think so. Trying to draw to a main window and then upscaling fixed some of them, but not all.

#

Instead, I have this now:

foggy python
#

That looks like you aren’t clearing your screen every frame and you scaled the display once

burnt stump
#

Do I need to clear it every frame?

#

(Isn't that slow?)

formal seal
#

in games, you have to clear every frame otherwise everything will be drawn on top of each other

foggy python
#

You also need to scale what you’re rendering

#

Normally I render onto an intermediary surface and scale that before blitting to the main surface

burnt stump
#

I just tried to do that

#

But the prompt is not upscaling

#

Do you mind if I show you the source code?

burnt stump
#

Ooooh... no wonder it wasn't working

#

Apparently, Pygame scale images and fonts differently

formal seal
#

just for future info: most engines or libs for game dev will scale images and fonts differently

burnt stump
#

It would be much easier if Pygame scaled this automatically from the beginning.
I know version 2.0 has a SCALED argument, but it breaks a lot of stuff in my code

#

and it doesn't seem to work properly for some reason

#

(e.g, only works sometimes)

random frigate
#

whats up guys, if any of you make 2d game chracater can you tell me what programs you used for that,because Im looking for a simple one for a beginner (me) ?

formal seal
#

a game engine?

random frigate
#

@formal seal Im using pygame

forest pebble
#

you guys are so smart. lol. i have no idea whats happening.

#

@random frigate if your doing a pixel art game, aseprite is amazing, its 20 dollars.

burnt stump
#

Does pygame have a quick way to convert a font to an image?

random frigate
#

@forest pebble thanks I will check it out,also do you know any free other programs?

frozen knoll
#

@burnt stump Arcade includes scaling and rotation. You can also set a viewport to scale the whole window. Works at the hardware level so it is pretty fast.

forest pebble
#

@random frigate Gimp, GraphicsGale, Piskel, Lospec, Krita, and Paint.net are all free

random frigate
#

@forest pebble thanks I downloaded GraphicsGale hope it will be good

dawn quiver
#

why don't people created games where you can earn money in the actual game?

#

maybe like for every other player you defeat you get $0.0001

#

Or will the developer be giving away a lot of money

frozen knoll
#

Why don't you pay someone else for defeating monsters in a game? You could start it. Just need a pile of money and some legal stuff.

burnt stump
#

@frozen knoll Arcade?

formal seal
#

it's a lib

burnt stump
#

Oooooh

formal seal
#

for programming 2d graphics for python I think

burnt stump
#

Dude, I was reading some Applesoft documentation, written in the 80s

#

It's so ridiculously clear it makes me cry

formal seal
#

that sucks

burnt stump
#

I just keep comparing it to today's documentation, and I keep thinking

#

"What happened?"

formal seal
#

I don't know, there's good documentation out there

burnt stump
#

Yeah, but the best you have today is e.g, Microsoft's

#

Let me show you what I mean

formal seal
#

eh, I've seen better than Microsoft's docs

#

but I can't argue since I have to focus on programming right now

burnt stump
#

Here's how Applesoft documentation looks like

formal seal
#

those aren't docs

#

thats a guide

burnt stump
#

Or even this

formal seal
#

docs are just refrence

#

while guides teach you to do something

burnt stump
#

@formal seal the point though is that it's very well-written

formal seal
#

I am not deniying that it's just that you can't compare that with documentation because it's a guide

burnt stump
#

I don't even see many guides like that today

#

How many guides do you have that teach Pygame in a clearer way?

formal seal
#

I don't use pygame so I don't have any guides for it

burnt stump
#

This is Applesoft's BASIC reference manual, btw

#

That's what it calls itself, at least

#

This is a quick reference guide:

formal seal
#

see the difference?

burnt stump
#

But even here, it's still veeeery clear

formal seal
#

yes it is

burnt stump
#

Applesoft is what you now know as Apple, btw

#

But they kinda lost that... touch

formal seal
#

makes sense

frozen knoll
#

And that Applesoft manual was one of the books that taught me programming. What a trip back.

dawn quiver
#

hello

burnt stump
#

Hey, everyone

#

@frozen knoll sup, mate

torpid pewter
#

is there any way in pygame to rotate a sprite image around a specific point?

young topaz
exotic fern
#

hello

jagged plume
#

Is python actually a good language for game dev

exotic fern
#

how would i smoothen the edges?

#

while raytracing

#

i read that one can apply anti-aliasing and some post-processing after the raytracing is done

#

but how exactly?

fervent rose
#

Anti-aliasing seems like the way to go here

#

I don't exactly remember how that work, but basically you do some additional samples between pixels, and use the median value for your actual pixel

#

Although, you should also increase your render size or sampling

fierce wraith
#

@exotic fern do you have a slightly higher res version of that?

#

something around 640x480

dawn quiver
#

Hey everyone, for a school exam i need a python bot for a simple game can be anything and analyze it does anyone have a game bot in python that he/she can give me (can be any game, browser or etc etc)

fierce wraith
#

this is a 3x3 blur kernel on the edges of the img, using 35% alpha blend

#

right now the edges get quite a bit darker because your background is just black.

#

if you make it transparent, it will look better

#

and it will also look a lot better if you use a slightly higher render resolution, because there is only so much you can get out of a 320x200 image 😉

#

so first we find the edges, and then we blur them to get this

#

thats our mask for blurring the main image

#

but because just blurring the image in those areas looks very blurry, we combine the blurred areas with the non blurry image by alpha blending them

#

that way you can control how visibly blurry the edges are

#

and by changing the kernel size you can decide how broad the blur should be

#
def anti_alias(img, kernel_size=(3, 3), alpha_blend=0.35):
    """
    perform post processing anti-aliasing on the given image
    :param img: input image
    :param kernel_size: size of blur kernel
    :param alpha_blend: [0-1] alpha weight of blurred image
    :return: anti-aliased image
    """
    beta = 1.0 - alpha_blend

    # find the edges and blur the image
    # 100 and 200 are threshold values.
    # Feel free to play with them if you aren't happy with the edge detection. (widen for more edges, narrow for less)
    edges = cv2.GaussianBlur(cv2.Canny(img, 100, 200), kernel_size, cv2.BORDER_DEFAULT)
    blurred_main_image = cv2.GaussianBlur(img, kernel_size, cv2.BORDER_DEFAULT)

    # if you want to take a look at the detected edges
    # cv2.imwrite("edges.png", edges)

    # weight the images based on alpha
    blurred_main_image[np.where(edges != 0)] = (
        blurred_main_image[np.where(edges != 0)] * alpha_blend
    )
    img[np.where(edges != 0)] = img[np.where(edges != 0)] * beta
    # combine them
    img[np.where(edges != 0)] += blurred_main_image[np.where(edges != 0)]

    return img
rancid inlet
#

im trying to write a class where a function takes input from the init function as an argument

#

can someone help me with that?

umbral fulcrum
#

@torpid pewter you can use a little bit of math

#

Rotate the image, then rotate the position of your image due to the other point's position

fierce wraith
#

hm?

#

whats this about?

umbral fulcrum
#

Wrong ping, sorry

fervent rose
#

Welcome to the @fierce wraith CG classes, sit tight and listen carefully haha

fierce wraith
#

hehe

#

its really a super simple algo using tools already out there

#

i think fxaa does some other fancy stuff, but this is just what i could come up with real quick

fierce wraith
#

with a transparent background

proud shadow
#

Hey so even though I'm still rather new to Python, would it be a good idea to pick up a game dev library while I'm still learning?

fierce wraith
#

arcade is pretty cool! and friendly for beginners

proud shadow
#

Nice because I was looking at that one too

#

Thanks

merry echo
#

What are you using for raytracing?

long rain
#

I can't install pygame 😭

proud holly
#

I don't know if this is technically considered game development but Im making a simple turtle hangman game in shell and I am encountering some small issues. If someone could help that would be great

merry echo
#

!ask

frank fieldBOT
#

Asking good questions will yield a much higher chance of a quick response:

• Don't ask to ask your question, just go ahead and tell us your problem.
• Don't ask if anyone is knowledgeable in some area, filtering serves no purpose.
• Try to solve the problem on your own first, we're not going to write code for you.
• Show us the code you've tried and any errors or unexpected results it's giving.
• Be patient while we're helping you.

You can find a much more detailed explanation on our website.

fierce wraith
#

@merry echo i didnt do the actual raytracing, that was @exotic fern i just had some fun with post processing Anti-Aliasing

proud holly
#

This loop seems to bug out the turtle graphics, whenever I type any letter it bugs out even if it a correct choice. This is for a simple hangman program

pliant dust
#

@proud holly this is just a guess, but it might be because the if statements should be changed to else if. That may be causing confusion for the computer. (First section is if with elif, and number of guesses is a seperate if/elif section)

dawn quiver
#

Is python actually a good language for game dev
@jagged plume Depends

#

The general answer is no

#

It's not

lunar dawn
#

The general answer is no
@dawn quiver
Maybe C#, since Python is for beginners? I'm just guessing here

dawn quiver
#

There is no such thing as "for beginners" unless you are talking about scratch level programming

#

Python is relatively "beginner friendly" that doesn't mean it's for beginners

#

Python is just not integrated into some of the bigger game engines

lunar dawn
#

Ah I see, but is C# still the go-to option in most cases?

dawn quiver
#

C# is what unity uses

#

Unreal use C++ I believe

#

Unreal also supports a bunch of other stuff like Javascript and python

lunar dawn
#

Interesting

#

C# is what unity uses
@dawn quiver
I might stick to both python and unity

#

After all, I've only learnt python for like 2 days

proud holly
#

@pliant dust it turns out it was because I put it in a weird section that was making it be called every refresh tic in the while loop. It made like 30 or 40 bodies in a second and it was too much for my crappy computer. I just moved it so it was under the else statement and it seemed to work

exotic fern
#

this is a 3x3 blur kernel on the edges of the img, using 35% alpha blend
@fierce wraith wow thanks for this.

#

is there anything i can do to improve the quality during rendering?

#

and how do you make the background transparent?

#

right now what i do is if the ray does not hit any object just colour it black

#

also do you know how we can model a material like glass?

fierce wraith
#

Just set the alpha channel to be Transparent

#

Instead of black

#

Check the refraction section on that article

#

It explains the math pretty well

#

If you need any help figuring out ping me

#

Yeah during rendering you can just sample more @exotic fern

#

You can do msaa ssaa and many others

exotic fern
#

pYeah during rendering you can just sample more
@fierce wraith what is meant by sampling?

fierce wraith
#

Ah more rays

exotic fern
#

Just set the alpha channel to be Transparent
@fierce wraith and what do you mean by alpha channel?

fierce wraith
#

More is better!

#

So pictures are RGB but they can also be RGBA

#

With the last channel being alpha

#

How transparent something is

exotic fern
#

Ah more rays
@fierce wraith i have a question, like how do i make more rays? right now i am projecting one ray so i project multiple rays?

#

So pictures are RGB but they can also be RGBA
@fierce wraith ah okay got it

#

so it means that my image will ahve 4 channels?

fierce wraith
#

You mean you you are projecting one ray per pixel?

exotic fern
#

how does projecting multiple rays help?

#

You mean you you are projecting one ray per pixel?
@fierce wraith yes

fierce wraith
#

Yeah, 4channels

#

So either you initially set the image size to 4x what you want, project one ray per pixel and then scale the image back down

#

Or you just send 4 rays per pixel with offsets from the center of the pixel and average them

#

The second option has a bunch of different options for where in the pixels the rays are

#

Like random, just spaced evenly, blue noise, white noise, random offsets from certain points, different patterns of fix points

exotic fern
#

Or you just send 4 rays per pixel with offsets from the center of the pixel and average them
@fierce wraith so i would average the 'color' got from the 4 pixels is that right?

#

So either you initially set the image size to 4x what you want, project one ray per pixel and then scale the image back down
@fierce wraith does this method have a name?

fierce wraith
#

Or you can go as far as to try adaptive superpersampling where you decide how many rays per pixel based on some criteria

exotic fern
#

thanks!

fierce wraith
#

So one ray per pixel and sacling down later vs multiple rays per pixel and averaging is exactly the same thing

#

Just some slight mem savings on the second one I guess

#

Is called multisampling or supersampling

#

They are all very similar

#

I'd just give them a quick google

#

All of this raytracing talk is making me want to get back into it!

exotic fern
#

its really interesting!!

#

i might look into some machine learnign approaches for ray tracing as well

#

it seems like a good place to apply that

fierce wraith
#

Now you're just making me jealous ;)

exotic fern
#

😄

fierce wraith
#

Usually you go up to like 128+ samples per pixel to get nice and smooth results...

#

Raytracing on the CPU is pretty slow

visual bobcat
#

hi does somebody know of an alternative way to open an .png file in pygame, i have tried pygame.image.load() but it prints out an err.?

#
pygame.error: Couldn't open maze.png```
frozen knoll
#

That would normally happen when your image is not in the same directory as your python file.

#

Or you are hiding file extensions and your image is really maze.png.png

visual bobcat
#

it is in the same file an i just checked the extension and it looks good

#

i tried to import os and giving it a directory to run but with no success

#

and its wierd because it worked just fine yasterday

pliant dust
#

@visual bobcat you might try explicitly stating the path of the image from the root. I don’t know if that would work, but it’s worth a try.

visual bobcat
#

you mean with ./ ?

#

nope still doesn't work

#

.jpg format doesn't work either

smoky marsh
#

hey im getting into this and using a pygame tutorial, im on the first page and its already acting up

#

i put a basic red surface on the screen and it doesnt show up except when i drag the window so part of it is out of my monitor

umbral fulcrum
#

Can you paste your code

#

!paste

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.pydis.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.

smoky marsh
#

ok

#
init()
screen=display.set_mode((500,500))
background = Surface((500,500))
background.fill((255,0,0))
background=background.convert()
screen.blit(background,(0,250))```
#

just what was on the tutorial i was looking at

umbral fulcrum
#

Is that your entire code?

smoky marsh
#

yes

#

im just starting

umbral fulcrum
#

And, are you getting any error?

smoky marsh
#

let me get a screenshot of what's happening

#

it's weird

umbral fulcrum
#

First of all, using * importing isn't healty at so many cases, use import pygame instead

smoky marsh
#

ill try that

umbral fulcrum
#

Then you gotta replace most of the classes/variables with pygame. at the beginning

#

So your new code will be like this:

import pygame
pygame.init()
screen = pygame.display.set_mode((500,500))
background = pygame.Surface((500,500))
background.fill((255,0,0))
background = background.convert()
screen.blit(background,(0,250))
smoky marsh
#

i still have the same problem

umbral fulcrum
#

And i didn't quite understand why are you converting the background

smoky marsh
#

because it said so in the tutorial i looked at

#

and when i got rid of that it still happened

umbral fulcrum
#

Yes, you're creating your window so far, but because there is no other action, the window will close right after it opens

#

I think you should keep watching/reading that tutorial

#

This is just the beginning

smoky marsh
#

i just get a blank window and when i drag the window so it is off the monitor then the section that was off the monitor renders correctly

umbral fulcrum
#

It's not off the monitor, the window is closed

smoky marsh
#

if it's closed then why can i see it persist until i kill the program

umbral fulcrum
#

I'm running the same code you pasted, this is what i see:

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
[Finished in 1.4s]
#

Let me give you a basic example

#
import pygame

pygame.init()
root = pygame.display.set_mode((500,500))
clock = pygame.time.Clock()

main = True
while main:

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

    root.fill((128,0,0))
    pygame.display.update()
    clock.tick(120)

pygame.quit()
#

The very basic structure of pygame looks like this

#

You need a mainloop first. Then pygame.time.Clock object to prevent your script run million times a second, pygame.display.update() is for update everything you have and changed, and also, there must be a way out of our mainloop, otherwise your program will crash without any action. So collect all the events and look if we decided to close our window, if we did so, then set main to false - which will break the loop - and quit

#

As i said, you should learn everything step by step, you can continue the tutorial you started

#

Also, pygame's documentation is very user friendly, you can check that too

smoky marsh
#

thanks, that fixed it

umbral fulcrum
#

You're welcome

fierce trench
#

How can I add music to my pygame?

mint zenith
#

Use pygame.mixer.Sound

#

I think it only supports WAV files, so keep that in mind.

minor mortar
#

it should support ogg also
and whatever SDL mixer supports

trim bluff
#

I think it only supports WAV files, so keep that in mind.
@mint zenith You could export it to some DAW and then export it back as a WAV

vast marten
#

How can I add music to my pygame?
@fierce trench pygame.mixer.music

random frigate
#

guys I wanna create a game but im actually afraid of drawing things(even though the game is 2d and kinda pixel art) but I don't know much about drawing and stuff like these can you give me any advices for how I can learn it faster or be good at it?

tardy marsh
#

How to release tkinter application after development

#

I have developed a tkinter application in pycharm

#

How to convert it to exe file

dawn quiver
#

trace stuff @random frigate

#

As in existing things

#

Or u could buy them

#

if tracing stuff just add a few extra things to avoid copyright

random frigate
#

@dawn quiver you mean by trace like draw stuff?

nimble tide
#

@tardy marsh use pyinstaller

fierce wraith
#

@exotic fern did you get glass working?

exotic fern
#

@exotic fern did you get glass working?
@fierce wraith not yet, i was busy with some other stuff, i will tag you if i get around to completing it!

dusk bronze
dawn quiver
#

i want to make a game in pygame thats like doom 1993 what would get me started?

exotic fern
#

@fierce wraith btw that thing about RGBA channels

#

i am encoding my image in a PPM format right now

#

does it support RGBA?

#

i dont think so

dawn quiver
#

Can someone help me make a snake console game ```
import time
import keyboard as kb
import random as rand
gameOver = False
score = 0
direction = 0
xpos = 0
ypos = 0
fypos = 0
fxpos = 0
if gameOver:
print("You died.")
print("Your score was:", score)
time.sleep(20)
quit()
def framerate(fps=1):
while not gameOver:
time.sleep(fps)
map()
snake()
def map(wide=20, tall=20):
for t in range(tall):
for w in range(wide):
if (t==0 or t==(tall-1) or (w==0 or w==(wide-1))):
print(end="#")
else:
print(end=" ")
print()
key = input("Enter Key: ")
def snake(head="@", body="=", mass=0, dead=False, y_pos=0, x_pos=0, dir=0):
snake_size = head + (body * mass)
while not dead:
print(snake_size) #dir 0 = UP, dir 1 = LEFT, dir 2 = DOWN, dir 3 = RIGHT
if y_pos == 20:
dead = True
elif x_pos == 20:
dead = True
score = mass
if dead:
gameOver = True
def food(style="*", efood=False):
x = rand.randrange(1, 18)
y = rand.randrange(1, 18)
if efood == True:
x = rand.randrange(1, 18)
y = rand.randrange(1, 18)
print(style)
efood = False
if (xpos == fxpos and ypos == fypos):
efood = True
#Game starts here:
framerate()

candid sandal
#

Can someone help me make a snake console game ```
import time
import keyboard as kb
import random as rand
gameOver = False
score = 0
direction = 0
xpos = 0
ypos = 0
fypos = 0
fxpos = 0
if gameOver:
print("You died.")
print("Your score was:", score)
time.sleep(20)
quit()
def framerate(fps=1):
while not gameOver:
time.sleep(fps)
map()
snake()
def map(wide=20, tall=20):
for t in range(tall):
for w in range(wide):
if (t==0 or t==(tall-1) or (w==0 or w==(wide-1))):
print(end="#")
else:
print(end=" ")
print()
key = input("Enter Key: ")
def snake(head="@", body="=", mass=0, dead=False, y_pos=0, x_pos=0, dir=0):
snake_size = head + (body * mass)
while not dead:
print(snake_size) #dir 0 = UP, dir 1 = LEFT, dir 2 = DOWN, dir 3 = RIGHT
if y_pos == 20:
dead = True
elif x_pos == 20:
dead = True
score = mass
if dead:
gameOver = True
def food(style="*", efood=False):
x = rand.randrange(1, 18)
y = rand.randrange(1, 18)
if efood == True:
x = rand.randrange(1, 18)
y = rand.randrange(1, 18)
print(style)
efood = False
if (xpos == fxpos and ypos == fypos):
efood = True
#Game starts here:
framerate()

@dawn quiver just a tip but start to use Object Oriented Programming aka oop

fierce wraith
#

@exotic fern im not sure, but i suggest you use the imageio lib, it handles a bunch of formats, but is super lightweight

#

it has two functions, imwrite and imread (self explanatory)

#

you can pass a numpy array to imwrite

#

probably even a python list, not sure about that though

#

no, needs to be a np array, but thats not to hard to get 😉

#

i used to use either ppm or something like pillow to read/write images, but it really doesnt get any simpler/lightweight than imageio

oak python
#

Is there any tools that will enable me to make maps for pygame?

#

(In game terrain/map)

random frigate
#

Guys how to make player stand in a block so like when the player jump if he fall at a block he stand at it and don't fall all the way down?

#

with pygame do I have to add some kind of a hitbox if this make any sense?

frozen knoll
#

@oak python Check out the "tiled map editor"

broken sequoia
#

how would you guys get a movement system in a terminal rpg?

dawn quiver
#

@random frigate as in put a paper that's thin over an existing image and trace over it if u want and then add some changes to it free style

#

or just use stickmen idk

vernal terrace
#

Hey guys, does anyone know if when I'm going to create a game to sell at Discord (I mean by paying for the dev licence and having store channels in my server) I have to first create an app and create based on that, or I can just link the game with the application later? If so, how?

dawn quiver
#

how to make 3d game in python

fervent rose
#

You mainly don't haha, but if you are really motivated (and like boilerplate code) you can take a look at pandas3d

knotty slate
#

Hi, I'm having a little bit of an issue with Pygame. Whenever I try and run my program, I get a TypeError, stating that I can't pickle font objects. When I comment out all of my text related code, it then says that it can't pickle Surface objects.

#

Is pygame known to have issues with pickling in certain scenarios? My code doesn't use pickling, and the only major changes I've made since last time I ran the code were organisational.

#

I get as far as rendering a scene, and then I click on play, call another set of rendering methods and it all crashes.

fierce wraith
#

are you using multiprocessing somehow?

knotty slate
#

No, just the one thread

fierce wraith
#

hm. weird

knotty slate
#

I'm gonna start placing breakpoints to see exactly where it all falls apart but I really don't know what the root issue could be.

#

Are there any alternatives to copying an instance like this?

fierce wraith
#

well do you actually need a deepcopy?

knotty slate
#

I don't remember the distinctions between the different types of copies

#

I wrote this a while ago 😅

#

I'll look it up quickly

#

Actually, wait, I don't need a copy at all

#

I've reworked this part of the code.

#

No longer having a pickling issue. Thanks for pointing it out! lol

#

I guess pygame objects dont like being copied at all, makes sense.

olive knoll
#

@knotty slate with what program are you coding it ?

knotty slate
#

I'm using Pygame and Python

olive knoll
#

Python as a coding language or the program ?

knotty slate
#

Python as the language. I'm using VSC to write it.

#

Misunderstood the question, sorry

olive knoll
#

No problem thanks.

rancid inlet
#

I am going to be working on my chess engine. if anyone would like to join a voice call and discuss it with me let me know

dawn quiver
#

anybody have tips for me a beginning coder? (im learning as of this minute)

rancid inlet
#

codecademy

#

also many tutorials on youtube

#

socratica is a great channel

#

also sentdex

#

Tech with Tim

#

@dawn quiver

tall pewter
#

@dawn quiver Good luck on your trip btw

random frigate
#

@dawn quiver also there's a channel called kidscancode I heard a good stuff about it,there's pygame tutroial there

frozen knoll
dawn quiver
#

lol so many pings but tysm

random frigate
#

np, guys do I need to use ML with making enimes attack the player?

umbral fulcrum
#

You can create a simple ai, you don't have to use machine learning for a simple 'find and shoot' enemy. But of course, I don't know what are you dealing with

random frigate
#

@umbral fulcrum I want to create a game where a bot can fight a player ,but I want to make it hard to defeat it. Do it need ML is this situation?

buoyant swallow
#

It depends on what the game is. For example if it's a shooting-like game you could just program the bot yourself and give it very high stats like accuracy and agility

random frigate
#

@buoyant swallow most of the fights in game will meele wepons and some body movments its about naruto anime if you know it

dawn quiver
#

hello!

#

i really need help

carmine abyss
#

Ok!

#

Lol

oak python
#

@frozen knoll It's available on ubuntu i hope? sorry for the ping

grand imp
#

If you expect to provide multiple frontends to a game (curses, a graphical GUI), would it be bad form to make a single repo host multiple python packages?

#

For example, assume the curses frontend is the built-in default, but there's also a non-curses one. Would it be acceptable to have a a git structure as below?

git_root
  game_module
  game_graphical_frontend
#

the pypi packages would then all have the same homepage

#

There might be other front-ends for other graphical systems as well eventually

remote sand
#

how would you scale the whole window according to hidpi settings in arcade?

grand imp
#

im not sure that it exposes that functionality directly at the moment

#

i may have asked about it in the arcade server though

split aspen
#

I hope its the right section for this, and my question is bearable but What are the pros and cons of kivy and Pygame?

grand imp
#

Kivy is very good if you want to run on mobile, but it has some strange issues on OS X that likely aren't going to be resolved any time soon

#

pygame is an old framework that seems to be fairly stable and unlikely to change

#

you can use it with GL wrappers, but that may not be the best idea right now as opengl might be getting deprecated sometime soon on mac

#

If you're a beginner, imo arcade is a much better library

#

you lose some fine grained control with it, but it's very easy to get your project going

#

I think all of the libraries may have some issues on OS X actually

#

but 90% of users won't run into them

#

@split aspen what do you want to build, and how much experience do you have?

split aspen
#

With python i have less than 3 Months experience of coding

grand imp
#

do you want playable results fast?

split aspen
#

I'm just trying to learn an Additional language

grand imp
#

Kivy is very powerful but it can be very confusing, and requires you to effectively learn 1 and a half new languages that aren't useful anywhere else

#

Arcade will let you get a game up fast, but it doesn't yet have a good UI framework built in

#

also i don't think arcade has ways of building for mobile right now

split aspen
#

Hmm interesting, Thank you. @grand imp

grand imp
#

Going the other direction from arcade, Kivy can be argued to be a UI framework

#

but also a framework for doing other things

#

It also has a builtin framework for settings panels, but it is extremely mobile oriented

#

i don't recommend that for beginners

#

Why do you want to try a new language now?

#

3 months isn't really that much time as far as getting to know python and programming in general, especially if it's your first language.

split aspen
#

It's not my first

#

I'm just trying to add a secondary language since It seems pretty effective (Less typing, More results)

grand imp
#

ah

#

what have you used before?

split aspen
#

Oh i was using c#

grand imp
#

lol

split aspen
#

guido The amounts of ";" ive missed are bigger than human sins combined

grand imp
#

what IDE are you using?

split aspen
#

VS

grand imp
#

hm, i though it would help with that

split aspen
#

its perfect

remote sand
#

may i ask, what's the arcade support server's link?

#

wait

#

this is the one?

#

i joined and it's animal crossing...

leaden lynx
remote sand
#

ah thanks

mint plaza
#

...

neon hinge
#

wrong link, sorry

#

someone posted that and it was removed

remote sand
#

i posted that

#

🙃

leaden lynx
#

You could also ask any questions here

remote sand
#

how would you scale the whole window according to hidpi settings in arcade?
arcade does not seem to have a builtin support for that

#

pygame has it in the latest beta/alpha versions iirc

dawn quiver
#

Right now im reading the pygame docs and it's looking kinda THICC and with that I mean old so it doesn't make a nice documentation like discord.py 😦

#

Do they have a readthedocs page?

remote sand
#

Unfortunately the official pygame docs is like that

#

Though there are other resources

random frigate
undone depot
#

I got a question

#

What are the best colleges in the US for game development or just to major in computer science in general?

dawn quiver
#
first=int(input('Who Is The Coolest?'))
print(first)

help?

#

@dawn quiver im new but i think you forgot the " inwho is coolest cause now its not a string

#

no you can use ' ' but thanks

#

ok

random frigate
#

@dawn quiver so where's the error?

dawn quiver
#

ive fixed it

random frigate
#

Oh ok nice

dawn quiver
#

lol i suck

tall pewter
#

Guys btw rotating an image is not working in pygame

#

I have a variable player which is :

player = {
  "x": 10,
  "y": 10,
  "img": pygame.image.load("player.png")
}
dense bone
#

oke so, i got this question as i don't seem to find anything related to in on youtube. I want to make a 3d character respond by with animation to this type of code. My question is what should i be doing in order to have it move?

frozen knoll
#

Rotation works in Pygame, it just isn't super-easy. Nor is it hardware accelerated. (It is pretty easy in Arcade though. cough cough)

tall pewter
#

And when I try to do :

for event in pygame.event.get():
  if event.type == MOUSMOTION:
    player["img"] = pygame.transform.rotate(player["img"],int(angle))
#

It doesn't rotate

#

It just gets bigger when my mouse gets near it

#

And if you are curious , my angle variable is :

angle = (180 / math.pi) * -math.atan2(rel_y, rel_x)
#

And rel_y is mouse positon y - player y and rel_x is mouse position x - player x

#

I just wanted to make a top down shooter

frozen knoll
tall pewter
#

I mean

#

I rather use pygame

random frigate
#

@dawn quiver np these things happen too much at the beginning its ok, also its nice from you to try to help (:

dawn quiver
#

ty

random frigate
#

np.

#

Guys how I can make the hitbox move with the pic

#

like if the resolution of the screen changed how I can deal with it?

#

like if a pic like this and I want to make an object over the things that are under the waterful if the resolution of the screen changed how I can change the place of the object also?

split aspen
#

what if you just lock it to one resolution :c

dawn quiver
#

just increase res and increase the size of the ibjects by the percent you changed the rez too

#

@random frigate

#

i think

split aspen
#

How do you put that in code@dawn quiver

dawn quiver
#

i have no idea

#

i just started but its an idea

split aspen
#

I'm asking as well, Tryna have the same vision as yours

#

Oh, I know that some video games depend more on the Aspect ratio (4:3 16:9 16:10 and Put 21:9 with 16:9)

#

I mean you have the object has certain WidthxHeight in every ratio rather than every resolution

random frigate
#

@split aspen hmm so like what I can do?

#

because if the screen get bigger or it just be lesser then how the program can know where's the x,y for the things I want?

split aspen
#

The screen gets bigger when the player Chooses the Change the resolution right?

random frigate
#

yup

split aspen
#

So just put each resolutions into categories (According to the aspect ratio) And Set Which one loads for each category

random frigate
#

oh but like this I need to hardcode a lot of things

split aspen
#

That's the only idea ive got so far honestly

#

You can just lock it to one resolution

random frigate
#

I was thinking of if there's any specific algorithm for this

#

its not going to work like this because if the player wanted to play in a full screen mode and of course(most of the time his screen resolution will be different of mine)

split aspen
#

attempting to scale from 40x40 to 30x30 for an example would ruin the looks

#

If you really want the multiple resolutions you can just make one aspect ratio?

#

720p +

random frigate
#

Oh actually what I meant when I said the resolution of the screen is its width and height

split aspen
#

pithink It's lots of work

#

if you're using pygame

random frigate
#

yup thanks mate I will check this out

split aspen
#

It might be what you're looking for

#

Still scaling stuff might ruin the quality :p

random frigate
#

hmm oh I understood you

#

but I don't know if you get my point

haughty shoal
#

im new to coding, and have no idea how to. Where can i get started?

fierce wraith
#

arcade is super fun!

random frigate
#

like when I give the things I want to make an object for something and lets say the person who's playing has a screen that is bigger or lesser than mine then how im going to deal with these objects?

fierce wraith
#

and beginner friendly

split aspen
#

im new to coding, and have no idea how to. Where can i get started?
@haughty shoal How new?

haughty shoal
#

@split aspen 0 coding experience

#

well actually a little because i had a class

#

but the teacher was jus an old geezer who hated us

split aspen
#

Start by the python course in Freecodecamp, they don't use any ads

#

Then decide what you really want to build

#

then just select a specific framework and just learn it

#

if you're really interested in actually bringing results fast

haughty shoal
#

ok

#

thank you so much

random frigate
#

I would also recommend a book called automate the boring stuff with python it cover the basics in a very good way

split aspen
#

The best thing is to know what you want to do, It's easy to get stuck in a learning hole in those fields honestly

#

i actually became more motivated when i knew i wanted to make video games, at least from the coding side

random frigate
#

what about drawing side xd

split aspen
#

I'm not really into the artistic side

#

I know a friend that does this stuff for me

random frigate
#

ya me 2 I was afraid of this at the begining

#

and still lol

#

nice

split aspen
#

Well, I'll try to get into it when i actually master the ability to break down problems into small pieces xD

#

I'm really focused in the problem solving side

random frigate
#

oh like leetcode and these stuff?

split aspen
#

No, its just like C# way

#

where most of the stuff into methods

#

and just call them in the main()

random frigate
#

ohh

split aspen
#

But in my head xD

random frigate
#

lol

#

I actually wanted to jump into ML and robots but when I was learning it I was saying like "WHAT THE HELL IS GOING ON" so I asked some people and they told me that it needs a lot of math and Im still in highschool so I didn't learn these things ,after that I stopped programming for a month maybe(doing just little things) and I came back for it now because I really want to keep up with it

split aspen
#

Yeah, you'll need to know statistics maths most of the time

#

xD

#

oh its getting out of game dev

random frigate
#

ya statistics ,calculs, linear algebra

#

oh ya lol

split aspen
#

I mean its still related a bit

#

you can make an AI that plays a certain game

#

Eh most of all its all about data xD

random frigate
#

yup ):

#

but its the future

split aspen
#

Eh, Until you have lots of NULLs in your data

#

I don't think an artificial intelligence can replace any field except security_maybe

random frigate
#

oh robots now actually replacing a lot of things you know amazon robots?

split aspen
#

It's just the basic stuff

random frigate
#

ya for now

#

but Im talking about the next 10 years

split aspen
#

😔 Pls don't take my job

#

i need my job XD

random frigate
#

lol

#

I heard that its going to replace 60 millons jobs but at the same time there will be 120millons new jobs

split aspen
#

Yeah, since the past we're just switching the kind of stresses we have

#

Oh its really getting out of game dev

#

lets stop here

random frigate
#

yup

dawn quiver
#

hello

#

i was wondering what type of programing would we need

#

for something like developing an app

split aspen
#

App that serves what?

random frigate
#

it depends on which platform you want to put it

#

ya and this also

dawn quiver
#
  1. an IOS app
#
  1. It serves in recording and tracking where users receive phone calls from
split aspen
#

"Tracking" is a really difficult thing

#

Like just the country?

#

Or the exact location

dawn quiver
#

country, i guess

#

i figured exact exact location would be hard

split aspen
#

Probably you'll need swift prog language

#

Exact location will need government permissions xD

dawn quiver
#

what about

#

just city?

split aspen
#

Even City is difficult thing

dawn quiver
#

oof

split aspen
#

You can use the trick truecaller used which is when you download the app and use your phone number

#

You're automatically giving out the identities of all your contacts

#

But, The problem is you still can't really track someone's location

dawn quiver
#

hmm another idea

#

what about an app that for example compares the prices of airline flights, so you could buy the one that saves u the most money?

split aspen
#

Actually, i remembered that phones keep your coordinates in the photos data where it was taken

#

You can usually extract it from photos taken by phones

dawn quiver
#

my second idea was a safety like app

#

where people and go on and alert other neighbors if like theirs a criminal around or dangeroutside

split aspen
#

what about an app that for example compares the prices of airline flights, so you could buy the one that saves u the most money?
@dawn quiver Sure, You can tell the app the Grab the data from a set of airline flights websites (Api) and just put it from best to worst according to the Numerical price :p

dawn quiver
#

Cool/

#

thanks for ur advice elliot

split aspen
#

The problem about your idea is how do you actually grab the data

#

You'll need a direct contact to each security agency

dawn quiver
#

Wait

#

For right idea?

split aspen
#

i mean the safety app

dawn quiver
#

ye

#

true that

#

im not gonna use that prob

#

might stick with the airlines idea and

#

maybe an app that when you subscribe to stuff or have bills, it alerts u as the payment date arrives

split aspen
#

Or, You can spread raspberry PI all across the world that captures the analogue signals and knows which one is for 911 and It just displays data on that range

dawn quiver
#

That sounds a bit complex for a beginner like me 😛

split aspen
#

It's all about grabbing data xD

#

The problem is how will you grab data

dawn quiver
#

for the safety?

split aspen
#

its usually most of the apps xD

dawn quiver
#

wait for the safety one

#

or all of them?

split aspen
#

I mean facebook app grabs its data from facebook server

#

for an example

#

right?

#

Just use this way of thinking to most of your apps

#

ideas

#

maybe you'll be creative

#

oh its still out of game_dev

dawn quiver
#

can we game dev or program it using vS?

#

visual studio

split aspen
#

pithink I'm not sure what you're asking

dawn quiver
#

so if we're gonna develop an app or something

#

can we use visual studios?

split aspen
#

Yeah, You can use any IDE that supports your language

dawn quiver
#

k

split aspen
dawn quiver
dawn quiver
#

Is there anyway to easily resize the map size with pygame

#

I have no background image or anything like that I just want to be able to zoom out

tall pewter
#

Just define a size variable

#

and like set it to 0.5 . then multiply all of your variables related to like size and stuff by that

dawn quiver
#

I thought of that

#

But that changes the math

gritty crescent
#

Hey guys how can i manage to play a vaw file in my python.exe file

tall pewter
#

Guys should I move to godot from Pygame/Cocos2d ?

severe saffron
#

@gritty crescent wav?

#

@tall pewter most likely yes if you're interested in developing more complex games

#

a more fully-fledged game engine will make it much easier

tall pewter
#

Oh I see

rich sinew
#

hello can somebody help me with my assignement

#

I was down with fever and didnt attend lessons for 1 whole week

#

and now there is a python game i gotta make by tomorrow

#

it only requires the use of if and elif

#

please let me know if you can help!

maiden shale
#

I could probably help @rich sinew

#

@tall pewter or you could use GameMaker or Unity :)

rich sinew
#

@maiden shale thanks so much!

#

cus it has 35% weightage for my programming essential module

maiden shale
#

0.o

rich sinew
#

i will dm you

gritty crescent
#

hey could someone solve why my game can't work as an .exe file pls

leaden lynx
#

If you explain the problem somebody should at least be able to take a look.

gritty crescent
#

i was waiting for someone to respond

tall pewter
#

Btw guys are there any good engines in Python (Except Godot)

#

I mean I liked Cocos2d and PyGame

#

But PyGame is kinda too beginner

frozen knoll
tall pewter
#

Is it good for complicated games?

#

Or are you kinda biased?

severe saffron
#

there aren't too many python game engines

#

if you're interested in learning python then those which are available are a good idea

#

but there are others and it can be useful to learn a new language in the framework of a game engine

tall pewter
#

I mean

#

I know C++

#

But I can't install libraries

#

Since I'm a windows user it's a pain in the a$$

#

And I don't like Unity

#

I hate it*

near wedge
#

@tall pewter if you're looking for 3D, there's Panda3D.

tall pewter
#

I mean , yeah but I don't like to make 3D games for now

#

I guess Cocos2D/Arcade is the way?

near wedge
#

Yeah, I'd probably look into Arcade for 2D.

tall pewter
#

Oh I see

#

So Cocos2d < Arcade

#

?

frozen knoll
#

I'm kinda biased, but I think arcade is great for 2d games. Once shader support is released, it will be even more powerful.

tall pewter
#

But

#

Are there any popular games made with Arcade?

merry echo
#

what do you want to create

tall pewter
#

A game for a game jam

merry echo
#

upcoming?

tall pewter
#

Probably

#

Didn't decide

merry echo
#

what platform do you want it in

tall pewter
#

Just wanted to learn a framework for gamejams and I want it for windows

#

+Linux

merry echo
#

if its in Python then you only have to choose between Arcade, pygame, cocos2d and pyglet if you want lower level access

tall pewter
#

ik but which is the best?

merry echo
#

though Arcade and cocos2d uses pyglet anyway as a dependency

tall pewter
#

So arcade and cocos2d?

#

Or pyglet?

merry echo
#

I'd go with Arcade, you could learn the others later on if you wanted to anyway

tall pewter
#

I mean , I know all except Pyglet and Arcade

#

So I guess Arcade is the way :?

merry echo
#

if you're comfortable with what you're using, i don't know why you would switch esp. for a jam

#

there really isn't a single 'way' per se

tall pewter
#

I switched from PyGame to arcade cause the rotation has problems

#

So much problems*

#

Like I wanted to make a top down shooter and it didn't work

umbral fulcrum
#

But PyGame is kinda too beginner
@tall pewter I certainly disagree, you cannot expect from a python library to help you with all cases. I'm not even sure if pygame is called a 'game engine'. But arcade is also seem like a great library. Plus, you can easily contact with the creater of arcade in here : )

calm thistle
dawn quiver
#

ik but which is the best?
@tall pewter The one you like

rich sinew
#

hello can somebody help me with my assignement
I was down with fever and didnt attend lessons for 1 whole week
and now there is a python game i gotta make by tomorrow
it only requires the use of if and elif
please let me know if you can help!

umbral fulcrum
#

@rich sinew You can ask your question in this channel, I'll try to help

tall pewter
#

Wow I see Pyglet > Arcade

merry echo
#

Arcade is built on top of pyglet though

frozen knoll
#

Kind of. Arcade has a completely different drawing and sprite implementation, only using pyglet for opengl bindings in those cases. The window/event management is pretty much pyglet.

tall pewter
#

Yeah I see

dawn quiver
#

I'm just using pygame for now

calm thistle
#
Humble Bundle

Make your video game sound and look the way you want with this bundle of 2D art, music, and sound effects!

fallen citrus
#

hey, plz can someone help me to create my proper pac-man on pygame contact me on dm

dawn quiver
#

its just
import pygame

pygame.init()

#

that is the first few lines

#

nvm, copy of the same file

wintry dirge
#

can somebody help me make a game

dawn quiver
#

I've been trying to get a custom cursor to work on Pygame that doesn't rely on the set_cursor command built into Pygame already, because I don't want to have a black-and-white bitmap cursor. Every time I try to do it, however, it leaves a trail of cursors instead of simply following wherever my cursor goes. The cursor needs to overlap other surfaces at times, so using fill() won't help. Any ideas? Should I pose this question to one of the help chats?

#

@wintry dirge What game are you trying to make?

#

I need a better library for the game I'm making, so I guess I can use my limited, acquired-today knowledge of Pygame to help someone. 😦

wintry dirge
#

I’m making a stick fight kind of game

#

I have some weapon designs

#

@dawn quiver

dawn quiver
#

What type of game is it supposed to be? A platformer, an RPG, or something else?

wintry dirge
#

Something else

dawn quiver
#

Can you explain the basic mechanics of the game?

wintry dirge
#

Do you know the game stick fight?

#

It’s kinda like that but with different weapons and maps

#

So lots of rag doll movement

#

Lots of particle crap

#

And a lot of bullets

#

So

#

I have never made a game before

dawn quiver
#

I know about that game, yeah.

#

Well... you could get started with Pygame, but I'm warning you, Pygame can be really primitive at times.

wintry dirge
#

I live in a hole anyways

#

I’ll put the designs in here later

dawn quiver
#

I think carving your code with a rock and a hammer is less primitive than Pygame, so living in a hole is perfectly acceptable.

wintry dirge
#

Actually I can put them in now

#

I gotta make more still

#

I just messed around in ms paint until I got some stuff that looks good

wintry dirge
#

It’s 3 am

#

I’m not tired

#

Somebody help

dawn quiver
#

Alright, I need a library that's good for 2D game development and is more powerful than Pygame. Which should I choose? I've looked at Pyglet and Pandas3D and can't deduce whether either of them are suitable.

#

For reference, this isn't going to be some intense platformer or anything that requires lots of motion quickly; it's going to be a 2D word game.

#

But it's a pretty technical game and requires lots of sprites and overlays on the screen at once. Are there any libraries that are particularly good at doing that?

#

This is probably a super-generic question, but any help at all would be greatly appreciated. Please PM me if you have any good suggestions, because I'm going to bed soon. Thanks, everyone.

vital rock
#

going to bed?

#

oh nvmd

fervent rose
#

@dawn quiver Pyglet is basically for directly rendering images to screen, I wouldn't recommend it to do a fully featured game if you don't want to loose your mind with boilerplate code, and Pandas3D is, well, for 3D, so it doesn't work at all for 2D, my best advice would be to use the arcade library lemon_pleased

dawn quiver
#

Arcade, huh? I tried Arcade out. Are you sure it'd be the best decision? What about it sets it apart from those other two? @fervent rose

#

Thank you for your response, by the way.

fervent rose
#

Well, the other two aren't suited to build a 2D game honestly

#

They serve different purposes

#

Oh and BTW arcade uses Pyglet behind the scene, it more or less just provide a really lire abstract interface

dawn quiver
#

My main problem with Pygame was that it had a lot of limitations. For instance, the way you need to manage surfaces and sprites is rather inefficient to me and has a lot of limitations .

#

For instance, if I wanted to create a sprite in Arcade using a pre-made picture or image, how would I go about doing that?

fervent rose
#

Yeah, I'd advise anyone to stay away from pygame as much as possible, it has a really bad API IMO

#

Hold on, I'll get you some examples :)

dawn quiver
#

I learned that the hard way...

fervent rose
dawn quiver
#

I took a brief look at it, but figured that Pygame was okay since I knew more about it. Big mistake.

#

I'll be sure to recheck that Arcade documentation out tomorrow. Thanks again, Akarys!

fervent rose
#

Anytime!

calm thistle
fervent rose
#

That's interesting

#

Oh man, OOP my old friend haha

fallen citrus
#

hey, plz can someone help me to create my proper pac-man on pygame contact me on dm

limpid pilot
#

from turtle import *
from random import randrangew
from freegames import square, vector

food = vector(0, 0)
snake = [vector(10, 0)]
aim = vector(0, -10)

def change(x, y):
"Change snake direction."
aim.x = x
aim.y = y

def inside(head):
"Return True if head inside boundaries."
return -200 < head.x < 190 and -200 < head.y < 190

def move():
"Move snake forward one segment."
head = snake[-1].copy()
head.move(aim)

if not inside(head) or head in snake:
    square(head.x, head.y, 9, 'red')
    update()
    return

snake.append(head)

if head == food:
    print('Snake:', len(snake))
    food.x = randrange(-15, 15) * 10
    food.y = randrange(-15, 15) * 10
else:
    snake.pop(0)

clear()

for body in snake:
    square(body.x, body.y, 9, 'black')

square(food.x, food.y, 9, 'green')
update()
ontimer(move, 100)

setup(420, 420, 370, 0)
hideturtle()
tracer(False)
listen()
onkey(lambda: change(10, 0), 'd')
onkey(lambda: change(-10, 0), 'a')
onkey(lambda: change(0, 10), 'w')
onkey(lambda: change(0, -10), 's')
move()
done()

#

so above is the code for a snake game that i made

tall pewter
#

So?

#

XD jk not trying to be mean

#

Nice job

#

But PyGame is a better library

#

Just saying

jolly axle
#

Creative use of the turtle library I like it a lot

#

I'm using pyscroll with pygame, and loading my map with pytmx. I want to know if there is a way to get the data for the current location the player is at. I have the players coordinates on the map (I'm pretty sure), but I want to know if there is something on the layer that all the walls are on

compact ermine
#

Hi guys. I am quite new to python and programming in general, and i just want to ask, is pygame really as bad as everyone makes it out to be?

humble flicker
#

not really

#

it's a great place to start

#

obv it's not great in it's functions or anything

#

but it's pretty good for basic and some advanced things

#

i like it

dawn quiver
#

@compact ermine Pygame is really bare-bones, and to some, it's considered less a library and more a very basic game framework. What it lacks in power, it makes up for in simplicity that is virtually unmatched by any other game development library for Python, although the simplicity of a library is largely based on perspective and what YOU think is easy to grasp.

#

The only library I can think of whose simplicity matches that of Pygame is Arcade; if you're looking for a more powerful, but easier, alternative to Pygame, try out Arcade. They have an extremely thorough tutorial on the basics of the library, so picking it up shouldn't be extremely difficult after giving that a read.

#

Since you're new to Python and programming in general, I would recommend using Arcade's official documentation. It is specifically designed for those who are new to Python and are interested in game development. Basic concepts of Python programming, such as if/else statements, for and while loops, error checking and object-oriented programming are gone over in that documentation.

#

Of course, this is just my opinion and Pygame may be far more powerful than what I portray it as; I prefer Arcade, personally, but a lot of others on this Discord and elsewhere recommend Pygame instead.

compact ermine
#

Thanks! ill check out Arcade

calm thistle
#

Pygame Is best treated as SDL bindings

dawn quiver
#

😮

#

What's it for? 2D game design?

#

I might actually use this for the game I'm trying to remake!

calm thistle
#

It's a 2D game engine

#

Look closely for the reflections in that video

dawn quiver
#

Is it more of a physics engine, or is it for any 2D games?

calm thistle
#

It's not coupled to any particular physics engine

#

Oh, that's just a graphics demo with my own physics

dawn quiver
#

Wow, this is really great! I might actually use this instead of arcade for what I'm working on.

calm thistle
#

But I recommend Pymunk

#

Also coroutines are superb for games

dawn quiver
#

Oh, I don't need a physics engine for what I'm designing; I was just wondering whether it was more designed for physics engines or if it can be used for any 2D games.

calm thistle
dawn quiver
#

Can you briefly explain what coroutines are in the context of game design and how they're used to improve Wasabi2D?

#

I apologize for the programming lesson request, but I just want to make sure that, when I use Wasabi2D, I can use it to its greatest potential.

#

I can't believe I'd actually find a decent engine for the game I'm making in Discord out of all places. Thanks a million, @calm thistle! I'll give you an update on how my tests go.

calm thistle
#

Coroutines allow one function to execute over many game frames

#

That's the simples way to describe it

dawn quiver
#

Oh! That's cool. I think I may have accidentally created a subroutine or two while working with Pygame, but not in the same way it works with Wasabi2D, I'd presume.

#

If I had a custom cursor for my game and I made it so that the custom image of the cursor followed the position of the cursor on the pop-up window that my game is on, would that be considered a coroutine?

calm thistle
#

No, currently input is not integrated with the coroutine system

#

But in principle, yes, you could write

async def follow_cursor():
    async for pos in mouse_moves():
        cursor.pos = pos
dawn quiver
#

What is the async for again?

#

And that code is, in essence, what I was looking for.

calm thistle
#

async def = "Allow this function to suspend between frames"
async for = "Allow the thing I'm iterating over to suspend me"

rich sinew
#

hello can somebody help me with my assignement
I was down with fever and didnt attend lessons for 1 whole week
and now there is a python game i gotta make and its already overdue
It has 35% weightage on my overall grade so please I can pay whatever I have but pls help
it only requires the use of if and elif
please let me know if you can help!

dawn quiver
#

!rule 5

frank fieldBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious/inappropriate or be for graded coursework/exams.

random frigate
#

Guys for some reason pygame in not opening any image inside another dir

#

so here's my code I have been stucked with this problem for like an hour now python walkRight = ["adventurer-run-00.png","adventurer-run-01.png","adventurer-run-03.png","adventurer-run-04.png","adventurer-run-05.png"] walkLeft = [] full_path = "/naruto game/player_animation/Adventurer-1.5/Individual Sprites" for index,item in enumerate(walkRight): walkRight[index] = os.path.abspath(os.path.join(full_path, item))

#
pygame.image.load(self.walkRight[(str(self.walkCount // 2))]```
#
  File "/home/mohammad/Desktop/The long journey of programing/python/pygame/naruto game/sprites.py", line 38, in draw
    win.blit(pygame.image.load(str(self.walkRight[self.walkCount // 2])),(self.x,self.y))
pygame.error: Couldn't open /naruto game/player_animation/Adventurer-1.5/Individual Sprites/adventurer-run-00.png
#

this is the error msg

dawn quiver
#

@random frigate Can you open any other PNGs within the list? If you can, it might be a problem with adventurer-run-00.png specifically. That tends to happen when the PNGs are missing or corrupted.

#

Also, in that for statement, are you checking for index, item or index.item? If you're looking for the latter, you may have a syntactical error with the comma that was added in that for statement.

random frigate
#

Can you open any other PNGs within the list? If you can, it might be a problem with adventurer-run-00.png specifically. That tends to happen when the PNGs are missing or corrupted.
@dawn quiver I just tried that out when you told me but it didn't work, also about the for loop is index, item

dawn quiver
#

Alright, so it's a tuple you're searching for over and over again, I'm presuming?

#

You might want to try using os.getcwd() and os.path.join() together to make sure you're pointing at the right files.

#

os.getcwd() returns the current directory of the .PY file you're running it from, so if you're trying to open a folder that is in the same directory as that .PY file, you can use os.path.join() with that current directory to get to the folder without having to directly specify every part of the directory.

random frigate
#

oh so im running the python file from "/naruto game"

#

do I can delete more code?

#

ohhhhh

#

It worked when I used os.getcwd()

#

@dawn quiver thanks a lot mate

dawn quiver
#

👍

potent cairn
#

Anyone know why getting .htaccess to ban certain IPs is not working with Apache / WSGI / Django?

toxic sinew
#

If I wanted to make a multiplayer card game in python what would be the best solution?

near wedge
#

@toxic sinew I'm guessing you'll be sticking to 2D then? If so, I would lean toward Arcade or Kivy.

toxic sinew
#

Yeah, I have experience with several 3D game engines on the art side but for this I'm just messing around with some code so sticking to 2D. Thanks! Is youtube a good source for tutorials using Arcade and/or Kivy?

near wedge
#

I believe Arcade has a set of tutorials. I have not actually used either.

toxic sinew
#

Awesome, thanks for the help 🙂

cold storm
#

recording gameplay to blender keyframes in blender 2.9

#

also armature actions are recorded in this to a new track - something the original bge could not do (stock)

rancid inlet
#

umm

#

wait

#

where did my text go?

#

oh nvm wrong server

random frigate
#

guys is it better to create a class for each character or there's another solution?

pastel ice
#

Class can have many objects, right?

random frigate
#

ya

pastel ice
#

So..uh..you can have different character objects for a single class

random frigate
#

Wait im not sure with my answer because im not too good with classes I will check it out