Skip to content

rafaelgdp/godot-acceleration-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple project to understand how Godot acceleration works in KinematicBodies

@author Rafael G. de Pontes

Notes:

  • Distance is measured in pixels
  • Time is in seconds

There are 3 bodies, with initial velocity = 1 pixel/second towards the right (+x axis):

  1. Constant velocity of 1 pixel/second
  2. Increased by 1.0 pixel/physics_frame (every _physics_process call)
  3. Increased by 1.0 * delta pixel/physics_frame (every _physics_process call)

Conclusion: if you want to properly accelerate a KinematicBody2D, you have to multiply acceleration by delta every _physics_process call before adding to the KB2D velocity.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published