#module "example_physics" #import "kryon.h" #import "kryon_example_font.h" app "Kryon Physics" { size 640 420 fps 60 font examples theme THEME_SKY 0 scene main } #enum { GROUND_X = 320 GROUND_Y = 380 BOX_X = 320 BOX_Y = 60 } scene main { ScenePhysicsCreate(scene, 0.0, 980.0) ground := NodeCreate(scene, 0, NODE_BODY2D, "ground") NodeSetProps(scene, ground, KryBody2DPropsAlloc(KRY_BODY2D_STATIC)) NodeSetPosition(scene, ground, GROUND_X, GROUND_Y) ground_shape := NodeCreate(scene, ground, NODE_COLLISION_SHAPE2D, "ground_shape") NodeSetProps(scene, ground_shape, KryCollisionShape2DPropsAlloc(KRY_SHAPE2D_BOX, 400.0, 32.0)) box := NodeCreate(scene, 0, NODE_BODY2D, "box") NodeSetProps(scene, box, KryBody2DPropsAlloc(KRY_BODY2D_DYNAMIC)) NodeSetPosition(scene, box, BOX_X, BOX_Y) box_shape := NodeCreate(scene, box, NODE_COLLISION_SHAPE2D, "box_shape") NodeSetProps(scene, box_shape, KryCollisionShape2DPropsAlloc(KRY_SHAPE2D_BOX, 48.0, 48.0)) }