Log In  

Cart #52460 | 2018-05-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

As a temporary side project, I hastily ported Randy Gaul ImpulseEngine to pico-8/LUA.


Requires a mouse

  • left mouse button: create a random shape at mouse cursor or drag shapes
  • right mouse button: show/hide world or body options
  • button c: show/hide debug information

Dev Log

The physic engine is a direct port from Randy Gaul's work, detailled in a series of articles:
How to Create a Custom 2D Physics Engine

My contribution is mostly on a clean 2d vector and 2x2 matrix object oriented library.
It makes vector/matrix math very concise to work (and easy to port from C++ code!):

local v1,v2=vec(3,4),vec(5,6)
local v3=v1+v2
-- rotation matrix
local m=mat:make_r(0.4)
local r=m*v3

Note: I don't plan to expand the library beyond this demo, feel free to make a game out of it!

The cart now include a context menu that could be fairly easily reused for other carts.

Missing Features:

  • Optimisation pass (currently supports ~4/5 objects max)

Change Log


  • initial revision


  • added: support for circles


  • fixed: force reset
  • changed: left click now creates a new body
  • added: right click menu to control world or object settings
P#52222 2018-05-01 08:32 ( Edited 2018-05-06 16:44)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-12-05 01:19:13 | 0.009s | Q:14