#### Category : game-physics

Hello I’m making a simple break out game using SDL 2 for Switch using C++ and Homebrew sdk. I was able to implement Ball colliding with screen boundaries.But I’m unable to do ball bat collision. Here is my code.You can ignore some switch initialisation code. My idea was if ball.x == bat.x and ball.y == ..

Game Physics related problem , I made a player possessed pawn with input bindings to make it move forward and backward , i tried impleminting a gear / transmission system but to no avail , how do i do it?. Source: Windows Que..

I calculate Newtonian physics based on gravitation in my 2D game. It works exactly how it’s supposed to, when vsync is turned on (60fps), but once I turn it off and gain about 3.5k fps, the character starts to fall incredibly fast. The answer seems obvious, I just need to multiply character’s velocity by deltaTime, ..

I am currently working with a small project where I am trying to animate a ball to move from the left side to the right side of the screen. My code looks something like this: // Main-file void fpsCap(Uint32 starting_tick) { if ((1000 / FPS) > SDL_GetTicks() – starting_tick) { SDL_Delay(1000 / FPS – (SDL_GetTicks() ..

So i try to learn about game development, and i want to make my character can move its elbow.the elbow looks like this, it consist of 2 sprite, arm1 and arm2. Arm1 can rotate base on its origin, and arm2 should locate at the tip of arm1(about 60 px from arm1 origin). But i don’t ..

I am having a hard time understanding the consturctor parameters of btHeightfieldTerrainShape and how the height field data is supposed to be set up. The first two arguments heightStickField and widthStickField. What do they represent? Is it the width and height of the entire terrain so that the height field is scaled to fit inside? ..

I am trying to move an AI spaceship side to side. I would imagine using sin would solve this but I am struggling. So far this is what I have. This just moves the spaceship right forever as it is called in an update function which is called every frame. I just want the spaceship ..