Platformer 2D Opengl

Advanced game related topics
threedslider
Enthusiast
Enthusiast
Posts: 618
Joined: Sat Feb 12, 2022 7:15 pm

Re: Platformer 2D Opengl

Post by threedslider »

Thanks @IceSoft for jumping :D

But for me i don't see the jump very well and it is quite fast, so my suggestion is :

Code: Select all

  If KeyboardPushed(#PB_Key_Space) And player\onGround
    player\vy = #JUMP_FORCE * 0.5
    player\onGround = #False
  EndIf

  ; -------------------
  ; PHYSIQUE
  ; -------------------
  player\vy + #GRAVITY * 0.3
  player\x + player\vx
  player\y + player\vy
User avatar
IceSoft
Addict
Addict
Posts: 1746
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: Platformer 2D Opengl

Post by IceSoft »

threedslider wrote: Sat Jan 24, 2026 3:32 pm But for me i don't see the jump very well and it is quite fast, so my suggestion is :
The reason for this is: different fast devices
The speed in the example is not scaled.
Puzzle of Mystralia (C++)
Bug Planet, Waponez III, =QONK=, PetriDish, Movie2Image
<Wrapper>4PB, PB<game>, PictureManager,...
Post Reply