Page 2 of 2

Re: Platformer 2D Opengl

Posted: Sat Jan 24, 2026 3:32 pm
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

Re: Platformer 2D Opengl

Posted: Sun Jan 25, 2026 11:35 am
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.