This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Translated from EgoMoose tutorial of deriving formula for Unity | |
## https://youtu.be/FZekwtIO0I4 | |
## https://gist.github.com/EgoMoose/777ed827e89b69d479ea407e79261b97 | |
class_name SpringMath | |
extends Node | |
## zeta = damping ratio | |
## omega = angular frequency | |
static func vec1(value:float, target:float, velocity:float, delta:float, zeta:float = 0.3, omega:float = 20.0)->Array[float]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://youtu.be/IOe1aGY6hXA | |
extends KinematicBody2D | |
export var move_speed = 200.0 | |
var velocity := Vector2.ZERO | |
export var jump_height : float | |
export var jump_time_to_peak : float | |
export var jump_time_to_descent : float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original - https://github.com/DaniDevy/FPS_Movement_Rigidbody | |
extends RigidBody | |
var x:float | |
var y:float | |
var moveSpeed: = 4500 | |
var maxSpeed: = 20.0 | |
var slideCounterMovement: = 0.2 | |
var threshold: = 0.01 | |
onready var body: = $Body #child node used for rotation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Springs - can be used as trap to throw at spike. | |
Dissapearing block - block that dissapears after landing on it or oscilates over time. | |
Abyss/ lava - mario abyss or static "floor is lava". | |
Air fan - constant speed added to the player (horizontal, vertical). | |
Spikes - visible and trap like. | |
Saw blades - static and moving. | |
Falling stuff - falling rocks or thing when player is under it. | |
Moving floor - factory assembly line floor. | |
Air current - lifting player up to certain height. | |
Raising lava - climbing floor of lava. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Collection of all possible enemies to make easier on designing enemies | |
//Open for suggestions for entries or categories | |
walker | |
critter - just walking | |
Proximity runner | |
X proximity - ex: NES Batman 1st stage | |
Y proximity | |
guardian - object or position | |
patrolling | |
chaser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tool | |
extends AudioStreamPlayer #exactly the same code should work for extending 2D and 3D versions | |
class_name RoundRobinPlayer | |
export(int, "sequence", "random", "shuffle") var queue_mode = 0 | |
export(Array, AudioStream) var playlist = [] setget _set_playlist, _get_playlist | |
export(bool) var round_robin_playing = false setget _set_playing, _is_playing # can't override properties so use this for animations | |
var playlist_index = -1 # current position in the playlist | |
var shuffled_indices = [] # Array<int> of shuffled playlist indices |