pite-core 0.4.0

Node tree, handles, props and lifecycle dispatch for Pite.
Documentation
// SPDX-License-Identifier: MIT OR Apache-2.0
//! CharacterBody2D: kinematic physics body driven by `move_and_slide()`.
//! `collision_layer`/`collision_mask` and `friction`/`restitution` are
//! inherited from `PhysicsBody2D`.

use crate::schema::{DefaultPropVal, NodeTypeSchema, PropHint, PropSchema};

pub static SCHEMA: NodeTypeSchema = NodeTypeSchema {
    type_name: "CharacterBody2D",
    description: "Kinematic body driven by script via `move_and_slide()`. Slides along obstacles, ignores sensors.",
    inherits: Some("PhysicsBody2D"),
    abstract_class: false,
    props: PROPS,
};

pub static PROPS: &[PropSchema] = &[PropSchema {
    key: "velocity",
    label: "Velocity",
    doc: "Desired velocity in world units per second. `move_and_slide()` consumes and updates it.",
    default_value: DefaultPropVal::Vec2(0.0, 0.0),
    hint: PropHint::Vec2 { speed: 1.0 },
    read_only: false,
}];