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
class_name TileMapEditor extends TileMap | |
enum InputState { | |
NONE, | |
PLACE, | |
REMOVE, | |
PAN | |
} | |
var input_state: InputState = InputState.NONE |
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
using Godot; | |
[Tool, GlobalClass] | |
public partial class AutoCollisionShape3D : CollisionShape3D | |
{ | |
[Export] | |
public MeshInstance3D MeshInstance; | |
[ExportGroup("Editor Auto Sync")] | |
[Export] |
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
class_name CharacterPush2D extends Node | |
@export var character: CharacterBody2D | |
@export var push_strength: float = 1000 | |
@export var pushable_body_group: String = "pushable_body" | |
@export var lock_x: bool = false | |
@export var lock_y: bool = false | |
@export var no_physics: bool = false | |
@export var disabled: bool = false |
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
using System.Linq; | |
using Godot; | |
[Tool] | |
[GlobalClass] | |
public partial class ColorCollisionShape2D : CollisionShape2D | |
{ | |
private Color _color = Colors.White; | |
[Export] |
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
<!doctype html> | |
<html> | |
<head> | |
<title>This is the title of the webpage!</title> | |
</head> | |
<body> | |
<p> | |
This is an example paragraph.<br /> | |
Anything in the <strong>body</strong> tag will appear on the page.<br /> | |
Just like this <strong>p</strong> tag and its contents. |
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
local function test() | |
end | |
typeof( (test()) ) |
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
function testNil() return nil end | |
function testNothing() end | |
print( type( (testNil()) ) ) | |
print( type( (testNothing()) ) ) | |
print( type( testNil() ) ) | |
print( type( testNothing() ) ) |
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
local COLLISION_GROUP_ATTR_NAME = "CollisionGroup" | |
local RECURSIVE_PLAYER = true | |
local RECURSIVE_NON_PLAYER = true | |
local PhysicsService = game:GetService("PhysicsService") | |
local function IsValidCollisionGroup(collisionGroup) | |
return collisionGroup and #collisionGroup > 0 | |
end |
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
local Tooltip = require(game.ReplicatedStorage.Tooltip) | |
local tooltipGui = script.Parent | |
local tooltipTextLabel = tooltipGui.Text | |
local offset = Vector2.new(16, 0) | |
local maxSize = Vector2.new(200, math.huge) | |
local tooltip = Tooltip.new(tooltipGui, tooltipTextLabel, offset, maxSize) | |
tooltip:AutoShow(script.Parent.Parent) |
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
local ContextActionService = game:GetService("ContextActionService") | |
local RunService = game:GetService("RunService") | |
local player = game.Players.LocalPlayer | |
local effect = game.ReplicatedStorage.ClickToMoveEffect | |
local heartbeatSignal = nil | |
local function OnClickToMoveTick() | |
local hit = player:GetMouse().Hit | |
if not hit then return end |