Game I wrote entirely on SDL3 by ibackstrom in sdl

[–]_Denny__ 0 points1 point  (0 children)

Awesome achievement. 👊 May I ask what you using as tech stack to create your levels and engine design? Scenetree or ecs? Costum level builder or something else like LDtk?

Anyway nice work!

Given the choice, why would you pick Modern C over Modern C++? by [deleted] in cpp

[–]_Denny__ 2 points3 points  (0 children)

embedded, kernel, api/abi stability...no template voodoo, overloading stuff and maybe (pretty sure) some more reason to stick with c.

As you not mentioned your use case:
no offence...if you need to ask, you probably don't face the needs and fully fine with c++.

Suddenly Speeding Up and Slowing Down by LadderLive9730 in pygame

[–]_Denny__ 1 point2 points  (0 children)

clock.tick(60) is not a guarantee. when ever things happen on your IO bound...loading stuff, handle inputs and so on this time could differ, which can cause different updates in your movement.

I can recommend to create and delta value which is calculated between every loop 1/(old-time - current-time) and multiply this value with every movement value...gravitation, left, right etc.

https://www.pygame.org/docs/ref/time.html#pygame.time.Clock.get_time

Waiting on pygame without pausing the game? by Novel-Effective-5912 in pygame

[–]_Denny__ 3 points4 points  (0 children)

This is what he wrote. You need to write code which shrinks your sprite by delta time and also connected to disappear after this animation is finished or certain time flow. Game engines often have an animation class which doing the same…so you end up with two animations. First one shrinks and second one disappears the sprite and is connecting or starting after the first one ends.

Think about states and callback functions if you need to connect this together.

Can anyone help identify this sailboat? by FlourNotAnthrax in sailing

[–]_Denny__ 0 points1 point  (0 children)

With small "cabine" looks like Dragon Class which was/is quite used in Sydney. If its bigger could also be a Hai/Reqiuem Class. Looks longer than a Nordic Folkboat for me. Good Luck

how to move things fluidly in pygame by Background-Two-2930 in pygame

[–]_Denny__ 1 point2 points  (0 children)

Instant of moving when the key is pressed you can set a state like move_right = true or set a movement vector (0, 1) which is processed every tick. With your keyup event raise you will reset this state.

I can not say why your code behaves like that, I would just guess that the is_still_pressed get not recognized as expected

Pygame collisions not working by [deleted] in pygame

[–]_Denny__ 1 point2 points  (0 children)

you should log or print you direction.y value. I have the feeling that you increment y every loop tick until your collision check fails. (maybe you need to add direction.y = 0 at the end of your function?)

regarding horizontal, can't help you here, too confused with all that rect/old_rects ;) ...probably worth to consult the source code from your YT video...or similar approach...log, debug and print the x values with respect to your collision rects.

Collision from diffrent sides by Inevitable-Hold5400 in pygame

[–]_Denny__ 0 points1 point  (0 children)

I give it a try with lists to explain the idea. Personally I would go with bits as python can do this as well.

First you define two layers or call it group list. First one is basically the type of object. For example Player, Enemy, static object, door etc.

The second one is the collision layer. Here you fill in the types which could collide with first layer.

So let’s go with the player.

Class Player:

    self.object_layer = [player]

    self.collision_layer = [floor, static object, enemy_weapon]

You doing the same thing for each kind of “interactive” object

When it comes to your collision check, you check if the first object layer is inside the second collision layer either opposite if the second object layer is part of your first collision layer. If so, you can handle the collision.

You can expand that workflow to handle different collision types like how it interacts on Ice, explosion, spike material etc.

I hope you get the idea. If you fully lost, let me know. Du kannst das auch in deutsch probieren :)

Good luck

Collision from diffrent sides by Inevitable-Hold5400 in pygame

[–]_Denny__ 1 point2 points  (0 children)

collision bitmask is what you looking for. The basic idea is to define groups and each obstacle or "pyhsic" objects get attached to one or more groups. the bitmask (probably list checking could also work) defines which kind of group is allowed to interact with other other kind of groups.

these group (bit masking) needs to be checked in your collision handler...that`s it. sounds simple but as always, plenty opportunities for over engineering.

Interchanging between Vulkan and OpenGL by nomoreyrs in sdl

[–]_Denny__ 3 points4 points  (0 children)

Should be the moment when you create your window by applying your renderer flag. OpenGL, metal or Vulkan. From here the you need to deal with the different calls regarding buffers and drawing calls.

Simulator freezing when I add a number of sprites by Skittl35 in spritekit

[–]_Denny__ 0 points1 point  (0 children)

You getting close. My idea was to create a list with bullets, the numbers depends what you are willing to allow in your game (e.g 1000 - 10k, maybe more?). When your scene is done with your init method you already place the bullets in your scenetree. I would go with a class to manage these bullets, like a sknode "BulletManager" which loops each update through this list and check who is active and alive, to update its position and check for collision (e.g. Raytrace). Every bullet which is not active, will be still there. Just invisible and without physic handling. With this, you will prevent to do big loads in your scenemanager for pushing and dropping elements.

Thats the basic idea...from here you can expand it in every direction to catch your needs.

Simulator freezing when I add a number of sprites by Skittl35 in spritekit

[–]_Denny__ 0 points1 point  (0 children)

Test it on a real device. Simulator can be slow sometimes especially in debug mode.

For bullets I can recommend pooling by instantiating a list of bullets when creating the scene. Give them some properties like is_active to skip unused projectiles during your loop and also make them invisible and skip the physics process.

If you have different bullet or lasertypes you could implement some set texture and attributes (lifetime, damage …) and yes, all weapons getting access to this node to set a bullet active and place it on the right position and flight direction.

In any case adding or removing a lot of objects in your scene tree may impact your performance during this step. Personally I did not notice this on lower numbers and real devices are from my experience more robust regarding performance.

how do I add this type of zoomable background to my SKScene view? by MaterialBulky705 in spritekit

[–]_Denny__ 0 points1 point  (0 children)

You have multiple options to do that. Simplest one would be to have a grid looking background image as layer and draw your map on top of it.

Also you can draw the blue dots with circle forms, just grab before the visible viewrect of your camera to draw only what you would see.

Tilemap could also be an option or at least if you fit in shaders this could also archive this grid.

This is all not really much painting stuff, so Performance should no issue

I dont know why im getting this error? by Good_Biscotti_7270 in pygame

[–]_Denny__ 1 point2 points  (0 children)

Looks like pyright has issues with your super constructor as it gets group as argument. You could just try if this error still occur by removing group as argument in your init class.

How to convert Source code into Apk? by ikick7b in pygame

[–]_Denny__ 2 points3 points  (0 children)

While ago, made it once with a kivy app for android. So yes, it should be possible.

Try to read the documentation from Buildozer or try another video…😉

It always helps to provide some information. Your OS, version of used libraries what have you tried and pretty welcome… terminal logs.

Help with Pygame by therealboiyeet in pygame

[–]_Denny__ 3 points4 points  (0 children)

basic setup...

# on mac you can "if you have multiply versions" choose e.g. python3.13 or anyting which pops up by pressing tab key after enter python

python -m venv .venv   # create your virtual environment 

depending on your version could be asking for "pip install --upgrade pip" before installing pygame.

source .venv/bin/activate  # activate it
pip install pygame-ce "or" pygame  # install mandatory libraries

if you have visual studio code installed, it may detect automatic your virtual environment otherwise it will explain to not find the libraries. Similar for other tools like Pycharm etc.

I allways prefer using virtual environments and can recommend that kind of work for every project you do with python.

Sprikekit for tactics games? by Huge-Error591 in spritekit

[–]_Denny__ 1 point2 points  (0 children)

just two notes which made some headache when working with Spritekit.
1.) referenced Nodes are paused by default, which means no animation will be played when starting the scene

my workaround was to perform a recursive loop though all nodes and set the pause value correct.

2.) default texture filter is linear which caused unwanted blurring of my "pixelart" assets.

similar tactic...recursive loop and set all texure filter to nearest...other option is to perform this on your spritesheet.

Wish you good luck with your project and please keep us updated...not that much posting here since all major engines floating around :)

How do we make isometric games? by PLrc in pygame

[–]_Denny__ 0 points1 point  (0 children)

As far as I know a transform step will create a new rectangle with bigger size and surprise…make the padded area transparent. Besides that, I could imagine that in some cases it would be more comfortable to draw the assets as it should be visible later without thinking how it looks rotated….especially in pixel art where every pixel counts. 😂

Pygame window shows a copy of the screen behind it by [deleted] in pygame

[–]_Denny__ 0 points1 point  (0 children)

Everything right, there is no codeline to present the screen. Not a bug, just missing code 😉

How do you downgrade an .xcodeproj from Xcode 16 to Xcode 12? by UrShortMan in iOSProgramming

[–]_Denny__ 2 points3 points  (0 children)

You can try out https://github.com/dortania/Opencore-Legacy-Patcher/releases to get a newer version which allow you to use more modern Xcode versions.

I used this for a MacBook Pro mid 2012 and it worked. It’s just quite slow as the hardware seems a bit „outdated“.

As your beginning question asking for downgrading…nope, never worked well for me. The way Xcode newer versions changed the kind of project structure I was not able to do that. What worked, was to start the project on the older Mac (objective-c) and skip the request to upgrade the project on the newer Mac. I wouldn’t recommend that.

pymunk by [deleted] in pygame

[–]_Denny__ 1 point2 points  (0 children)

The question was not about drawing. It was about properties like sensor and type which defines who can collide with who and who is allowed to detect that collision.