Skip to content

Instantly share code, notes, and snippets.

func login_with_email(email:String, password_hashed:String):
var data = {}
data["Email"] = email
data["Password"] = str(password_hashed)
data["TitleId"] = title_id
var http_request = HTTPRequest.new()
http_request.name = "LoginWithEmail"
http_request.connect("request_completed", self, "_login_with_email_completed", [http_request])
add_child(http_request)
extends Node
onready var tools = load("res://lib/tools.gd").new(self)
var debug_prints = true
# Settings
export(float) var animation_speed = 1.0
# State
extends Control
# Settings
var arrow_body_sprites_amount = 15
var scale_change = 0.03
# Nodes
onready var path_2d = $Path2D
onready var arrow_head = $Path2D/Head
extends Node
enum Enums {
ENUM_1,
ENUM_2
}
export(Enums) var enum1 = ENUM_1
export var test_int = 1
func get_nodes_in_group_under_node(node, group_name): # Recursive search. Result is [[nodes_in_group], node]
var result = _get_nodes_in_group_under_node(group_name, [[], node])
return result[0]
static func _get_nodes_in_group_under_node(group_name, result):
for N in result[1].get_children():
if N.is_in_group(group_name): result[0].append(N)
result[0] += _get_nodes_in_group_under_node(group_name, [[], N])[0]
return result
func _derive():
# Get script
var selected_node = get_editor_interface().get_selection().get_selected_nodes()[0]
var script = selected_node.get_script()
# Check script
if script != null and script.resource_local_to_scene != true and script.resource_path != null and script.resource_name != null: pass
else:
print("No saved script to derive from")
return
using Godot;
using System;
using System.Runtime;
using System.Threading;
using System.Threading.Tasks;
using PlayFab;
using PlayFab.ClientModels;
public class Main : Node
{
shader_type spatial;
uniform vec4 tint : hint_color = vec4(1, 1, 1, 1);
uniform float specularity = 0;
uniform float metallic = 0;
uniform float roughness = 0;
uniform vec4 transmission : hint_color;
uniform sampler2D texture_1 : hint_albedo;
uniform float tex_1_opacity = 1;
uniform float tex_1_hue = 1;
@PLyczkowski
PLyczkowski / graph_keyboard_navigation.gd
Created March 11, 2018 10:57
Parts of code relevant to my GraphEdit keyboard navigation
func _input(event):
if self.has_focus() and self.visible and not event.is_echo() and event.is_pressed():
if event.is_action("ui_up"):
accept_event()
select_graph_node_up()
elif event.is_action("ui_left"):
accept_event()
select_graph_node_left()
elif event.is_action("ui_right"):
accept_event()
@PLyczkowski
PLyczkowski / endless_db.gd
Last active February 24, 2018 20:17
GDScript Database
extends Node
# Can store and save node trees, and lists of objects
# Each object added receives a unique id, stored here and using set_meta("id", id)
# When saving a node tree, the tree's hierarchy is saved as a nested dict of node id's
onready var tools = load("res://lib/tools.gd").new(self)
const discarded_properties = ["_import_path", "pause_mode", "editor/display_folded", "script", "Node", "Pause", "Script Variables", "object"]