Edit of asset "BDC - Ballistic Deflection Calculator" Accepted

Old/Current New/Edit
Title BDC - Ballistic Deflection Calculator
Description Ballistic deflection calculator is a tool for calculating the shot vector considering speeds and accelerations for Godot.

Methods
Array[float] times_to_hit_vector2(...) static
Array[float] times_to_hit_vector3(...) static
Array[float] times_to_hit_vector4(...) static

Array[Vector2] velocities_vector2(...) static
Array[Vector3] velocities_vector3(...) static
Array[Vector4] velocities_vector4(...) static

Vector2 velocity_from_time_to_hit_vector2(...) static
Vector3 velocity_from_time_to_hit_vector3(...) static
Vector4 velocity_from_time_to_hit_vector4(...) static

Example
const BULLET_SCENE: PackedScene = preload("res://.../bullet.tscn")
var bullet_speed: float = 300

func shoot(target: CharacterBody2D) -> void:
var to_target: Vector2 = target.global_position - global_position

var bullet_velocities: Array[Vector2] = BDC.velocities_vector2(bullet_speed, to_target, target.velocity)

if bullet_velocities.size() == 0:
print("impossible to hit the target")
return

var bullet: CharacterBody2D = BULLET_SCENE.instantiate()
bullet.global_position = global_position
bullet.velocity = bullet_velocities[0]

get_parent().add_child(bullet)
Category Scripts
License MIT
Repository Provider GitHub
Repository Url https://github.com/neclor/godot-ballistic-deflection-calculator
Issues Url https://github.com/neclor/ballistic-deflection-calculator-godot/issues
Godot version Godot 4.0
Version String 2.1.1
Download Commit 8113da0864d935d1987a9fa437b72424f4b0be5b 154f30390d7ec024a4bc9dcdacd4fc368c12efb4
Download Url (Computed) https://github.com/neclor/godot-ballistic-deflection-calculator/archive/8113da0864d935d1987a9fa437b72424f4b0be5b.zip https://github.com/neclor/godot-ballistic-deflection-calculator/archive/154f30390d7ec024a4bc9dcdacd4fc368c12efb4.zip
Icon Url https://raw.githubusercontent.com/neclor/ballistic-deflection-calculator-godot/main/icon.png