Skip to content

Instantly share code, notes, and snippets.

View selfsame's full-sized avatar

Joseph Parker selfsame

  • Clover Food Lab
View GitHub Profile
(ns hard.core
(:import
[UnityEngine Debug Resources PrimitiveType Application]))
(defn log [x]
(UnityEngine.Debug/Log x))
;(defn math [f & more]
; (. UnityEngine.Mathf (f more)))
(ns ships.core
(:use [unity.core])
(:import
[UnityEngine Debug Resources PrimitiveType Application]))
(defprotocol IAwake
(Awake [this]))
(defprotocol IStart
(Start [this]))
@selfsame
selfsame / gist:6eb5c9c9f3c4d7aa5572
Last active August 29, 2015 14:06
hard.core unity interop
(ns hard.core
(:import
[UnityEngine Physics Debug Resources PrimitiveType Application Color Input]))
(defn log [x]
(UnityEngine.Debug/Log x))
(defn resource [s] (UnityEngine.Resources/Load s))
;is a no arg qmark fn bad style?
@selfsame
selfsame / gist:8b88db25f1abd433bfe0
Created September 25, 2014 23:00
hard.input WIP
(ns hard.input
(:import
[UnityEngine Input KeyCode Camera Physics]))
(declare mouse?)
(defn get-keycode [s]
(try (or (eval (symbol (str "KeyCode/" s))) false) (catch Exception e nil)))
(defn ^:private kcode* [k]
(ns biology.core
(:use hard.core hard.input hard.tween unity.messages)
(:require unity.core))
(defn scene-spermwhale [_]
(add [(find-name "Main Camera") :y] -3000 3 (fn [_] (load-scene "spermwhale"))))
(defn scene-options [_]
(add [(find-name "Main Camera") :x] -20 1 (fn [_] (load-scene "spermwhale"))))
(ns biology.squid
(:use hard.core hard.input hard.tween unity.messages)
(:require unity.core))
(defn squid-start [this])
(defn squid-update [this]
(let [h (get-axis :horizontal)
v (get-axis :vertical)
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBwsLQGh4hA8VEXeiENcEWQUHxSIU9BcEwDbdXYku6KOoibmrGZRx/h06bzMO5e5OtPgVAfXYPLb6SwaqrVoE4uMFxsRkweOjnyS9AUbc99VLOe89AtqZOqeXkRxx01CshmhuxoIaHfkQ9qa411zJZpTwGRB02QWogqmMtab9DoHw== rsa-key-20141020
1 #!/usr/bin/env python
2
3 def string_to_comp(s):
4 try:
5 return globals()[s]
6 except:
7 return False
8
9 class C():
1 PRINT "<!DOCTYPE html>"
2 PRINT "<html>"
3 PRINT "<head>"
4 PRINT "<style>"
5 PRINT "body{font-size: 20px; line-height: 14px; word-wrap:break-word;}"
6 PRINT "</style>"
7 PRINT "</head>"
8 PRINT "<body>"
9 PRINT "<hr>"