This file contains hidden or 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
extends KinematicBody2D | |
var RISING_GRAVITY = 400 | |
var FALLING_GRAVITY = 1200 | |
var MAX_FLOOR_SPEED = 140 | |
var FLOOR_RUN_FORCE = 600 | |
var FLOOR_STOP_FORCE = 1600 | |
var AIR_RUN_FORCE = 100 | |
var AIR_STOP_FORCE = 160 |
This file contains hidden or 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
extends Node | |
var map = AStar.new() | |
var BOUNDS | |
var floor_cells = [] | |
# dirty cells made by blocking Objects | |
#{Vector2 cell: bool not_blocked} | |
var dirty_cells = {} |
This file contains hidden or 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
extends KinematicBody2D | |
const FLOOR_ANGLE = 0 | |
const WALL_ANGLE = 90 | |
const CEIL_ANGLE = 180 | |
var GRAVITY = 360 | |
var FALL_RATE = 3.0 |
This file contains hidden or 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
extends Node | |
# Generate the Datamap | |
func Generate( map_size=Vector2(80,70), room_count=35, room_size=Vector2(5,16), wall_id=0, floor_id=1 ): | |
# Start generation timer | |
var S = OS.get_ticks_msec() | |
# Randomize |
This file contains hidden or 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
extends Node | |
# Generate the Datamap | |
func Generate( map_size=Vector2(80,70), room_count=35, room_size=Vector2(5,16), wall_id=0, floor_id=1 ): | |
# Randomize | |
randomize() | |
This file contains hidden or 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
# Returns an array of datamap cells that lie | |
# under the from map cell to map cell | |
func get_line(from,to): | |
# setup | |
var x1 = from.x | |
var y1 = from.y | |
var x2 = to.x | |
var y2 = to.y | |
var dx = x2 - x1 |
This file contains hidden or 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
# Cast a fov line, stopping at first blocking cell | |
func cast_fov_ray(data,wall_index,from,to): | |
var cells = [] | |
var line = get_line(from,to) | |
for cell in line: | |
# Check for blocking cell | |
if not is_wall(data, wall_index, cell): | |
cells.append(cell) | |
else: | |
# include the blocking cell in the list |
This file contains hidden or 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
extends Node2D | |
var resolution = 256 | |
var radius = 512 | |
var force = 80 | |
var force_falloff = 0.08 | |
This file contains hidden or 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
extends Node | |
# HEX GRID MATH FUNCTIONS | |
# | |
# for CELL(offset odd-q vertical), AXIAL, and CUBIC coordinates | |
var CUBE_DIRECTIONS = [ | |
Cube.new(1, -1, 0), Cube.new(1, 0, -1), Cube.new( 0, 1, -1),\ | |
Cube.new(-1, 1, 0), Cube.new(-1, 0, 1), Cube.new( 0, -1, 1) | |
] |
NewerOlder