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
# requires https://github.com/you-win/spout-gd | |
extends TextureRect | |
@export var receiver_name: String = "" : set = update_receiver_name | |
@export var sender_name: String = "GodotSprout" : set = update_sender_name | |
var spout: Spout | |
# receiving image buffer |
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
#!/usr/bin/env bash | |
# godot-package helper | |
# @author Erodozer <[email protected]> | |
# | |
# Simple Bach Script that fetches and merges standard godot addon repositories from github | |
# to your project. You can use this instead of Godot's Asset Library if you wish to | |
# include dependencies in your projects while developing, but not include them in your git. | |
# | |
# Run this from the root directory of your project |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<meta name='viewport' content='width=device-width, user-scalable=no' /> | |
<title>fb-instant-godot</title> | |
</head> | |
<body> | |
<canvas id='canvas'></canvas> | |
<script src="https://connect.facebook.net/en_US/fbinstant.7.0.js"></script> |
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
import { fromEventPattern } from 'rxjs'; | |
module.exports = { | |
fromEvent(instance, target, signal) { | |
return fromEventPattern( | |
handler => { | |
target.connect(signal, instance, handler); | |
}, | |
handler => { | |
target.disconnect(signal, instance, handler); |
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
/** | |
* Create a one-time use Promise invoked by an event emitter | |
* Allows for awaiting an event | |
*/ | |
const asyncEvent = (eventEmitter, eventName) => | |
new Promise(resolve => { | |
const resolveFn = (...args) => { | |
// remove the listener so the promise is never resolved multiple times | |
eventEmitter.removeListener(eventName, resolveFn); | |
resolve(args); |
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 | |
onready var player = get_tree().get_nodes_in_group("player")[0] | |
func estimate_damage(attacker: Combatant, opponent: Combatant, limb: Limb) -> int: | |
return attacker.attack(opponent, limb) | |
func estimate_accuracy(attacker: Combatant, opponent: Combatant, limb: Limb) -> float: | |
return attacker.chance(opponent, limb) |
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 | |
""" | |
@author nhydock | |
Global Event Bus allows for registration and fan-out signal like | |
message passing between arbitrary objects. Add this as a singleton | |
to your project for easy usage. | |
In actuality is a super generic signal register. |
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 "res://maps/NPC.gd" | |
func interact(): | |
dialog.prepare() | |
dialog.show() | |
if GameState.Flags.get('talked_to_guilford'): | |
dialog.line( | |
""" | |
#Guilford | |
Don't worry, I'll have your equipment ready for ya soon. Lemme just finish this drink. |
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 | |
onready var anim = $Fader/AnimationPlayer | |
func change_scene(next_scene, params=[]): | |
""" | |
Changes scene with a transition. | |
You can hold the fade back in transition if desired until | |
the next scene is in a state that is considered ready | |
""" |
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
shader_type canvas_item; | |
render_mode blend_mix; | |
uniform float transition: hint_range(0, 1); | |
float val(vec3 color) { | |
return max(max(color.r, color.g), color.b); | |
} | |
void fragment() { |
NewerOlder