Skip to content

Instantly share code, notes, and snippets.

View Problematic's full-sized avatar

Derek Stobbe Problematic

View GitHub Profile
@sjvnnings
sjvnnings / better_jumping_character_example.gd
Last active June 25, 2024 21:37
An easy to work with jump in Godot
extends KinematicBody2D
export var move_speed = 200.0
var velocity := Vector2.ZERO
export var jump_height : float
export var jump_time_to_peak : float
export var jump_time_to_descent : float
@EricEzaM
EricEzaM / flex_grid_container.gd
Last active April 22, 2024 17:43
A responsive grid container for GD script. Updates columns as you change the width.
tool
class_name FlexGridContainer
extends Container
var columns: int = 1 setget set_columns
func _notification(p_what):
match p_what:
@munificent
munificent / generate.c
Last active May 14, 2024 05:30
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
extends Control
var pressed = false
var offset = Vector2()
#######
func _gui_input(event):
if Input.is_action_just_pressed("left_click") and is_mouse_on_title():
pressed = true
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
public static class PivotUtilities
{
[MenuItem("GameObject/Pivot/Create Pivot", false, 0)]
static void CreatePivotObject()
{
@mandarinx
mandarinx / CreateNewInspector.cs
Last active January 17, 2017 11:30
Create Inspector for a MonoBehaviour
using UnityEditor;
using UnityEngine;
using System;
using System.IO;
using System.Collections.Generic;
static public class CreateNewInspector {
[MenuItem("Assets/Create/C# Inspector", false, 82)]
static public void CreateInspector() {
@StagPoint
StagPoint / QuaternionCompression.cs
Last active May 3, 2024 22:23
C# - Use "smallest three" compression for transmitting Quaternion rotations in Unity's UNET networking, from 16 bytes to 7 bytes.
// Copyright (c) 2016 StagPoint Software
namespace StagPoint.Networking
{
using System;
using UnityEngine;
using UnityEngine.Networking;
/// <summary>
/// Provides some commonly-used functions for transferring compressed data over the network using
@btroncone
btroncone / rxjs_operators_by_example.md
Last active June 15, 2024 07:17
RxJS 5 Operators By Example
@t0chas
t0chas / CustomEditorBase.cs
Last active March 5, 2024 16:47
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session