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
shader_type canvas_item; | |
/** | |
Maps object texture onto a sphere and applies a spherical normal | |
based on a simulated light. | |
Adapted from | |
https://www.raywenderlich.com/2323-opengl-es-pixel-shaders-tutorial | |
and | |
https://gamedev.stackexchange.com/a/9385 |
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
# Please credit "Ghouly The Ghost" out of your kind heart! Check my gist page for a license. | |
# Includes: No slip inclines, variable angle climbing, shape agnostic implementation, slope climb up/down, smooth old school vertical collisions | |
# WARNING! IMPORTANT!: Relies on " Scene >> Projects Settings >> Physics 2D >> motion_fixed_enabled[x] __ on[x]" | |
extends KinematicBody2D | |
const floorCheckVector = Vector2( 0, 1 ) | |
const normalCheckVector = Vector2( 0, -1 ) | |
var angleThreshold = 1.39 setget set_angle_threshold | |
var slopeScale = tan( angleThreshold ) |