Hello guys, i’m new here, and i trying learn SDL2 for make my own games.
Long short history. I have two years code on pygame, is fun but is not power enough. On python i have, maybe, three years on experience… Not much, but i trying my best to learn.
I never code on c/c++. On the past three month’s i trying figure out how c++ works, and how sdl2 too.
I’m on basic’s. I have some class’s, for the player and etc.
My question is,
I have this code: (is just a test)
And move the player on the x axis, when the destination rect X make the screen boundaries, i want the player move back, and when make 0 move forward.
The problem is, when the player make 640 he stuck. Won’t move back at all. I look on Aaron’s tutorial’s, on Lazy Foo’, on reddit, google. I search for bounce ball, but i can’t figure out how make this simple movement.
PS: If needed, the player inherits from base_sprite, all my code is on github.