Skip to content

Instantly share code, notes, and snippets.

@stepheng
stepheng / Canvas.gd
Last active August 12, 2023 21:09
Sierpinski Triangle - Godot
extends Node2D
#var axiom = "F++F++F++"
var axiom = "A"
var angle_step = deg_to_rad(60)
var iteration = 1
var step_length: float = 64
var frame = Rect2(0, 0, 0, 0)
var rules = {
@stepheng
stepheng / canvas.gd
Created August 11, 2023 21:13
Godot L-System Koch Snowflake
extends Node2D
var axiom = "F++F++F++"
var angle_step = deg_to_rad(60)
var iteration = 1
var step_length: float = 64
var rules = {
"F": "F-F++F-F"
}
let tileString = "0100100000" +
"0111100110" +
"0111101010" +
"0001001000" +
"0011000100" +
"0011100010" +
"0011110010" +
"0011110010" +
"0001110010" +
"0011111100"
private func dashedLineNode(start: CGPoint, end: CGPoint, pattern: [CGFloat] = [10, 10]) -> SKNode {
let bezierPath = CGMutablePath()
bezierPath.move(to: start)
bezierPath.addLine(to: end)
let dashed = bezierPath.copy(dashingWithPhase: pattern[0] / 2, lengths: pattern)
return SKShapeNode(path: dashed)
}
import UIKit
enum StoryboardIdentifier: String {
case splashViewController
case mainMenuViewController
case levelSelectViewController
case optionsViewController
case gameViewController
}
//
// CameraViewController.swift
// Camera
//
// Created by Stephen Gurnett on 03/01/2016.
// Copyright © 2016 Stephen Gurnett. All rights reserved.
//
import UIKit
import MobileCoreServices
@stepheng
stepheng / gist:11e605f27307795f61eb
Last active August 29, 2015 14:10
PlayMaker - GuiButtonSetStringValue
using UnityEngine;
using System.Collections.Generic;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.GUI)]
[Tooltip("GUI button. Sends an Event when pressed. Optionally store the button state in a Bool Variable. Set a String var")]
public class GUIButtonSetStringValue : GUIButton
{
[RequiredField]
@stepheng
stepheng / gist:3532821
Created August 30, 2012 16:45
Groovy Drag and Drop
swing.edt {
frame( id: 'mainFrame',
title: 'title',
defaultCloseOperation: JFrame.EXIT_ON_CLOSE,
show: true,
size: [300, 300]) {
textLabel = label(text:"Drag file here", constraints:BL.NORTH)
mainFrame.dropTarget = [
drop: { dtde ->
def t = dtde.transferable