Skip to content

Instantly share code, notes, and snippets.

@eihigh
eihigh / example.go
Last active April 1, 2024 07:59
Experimental 2D Graphics API
package main
import "g2d"
func main() {
buf := g2d.Upload(g2d.Uniform(g2d.Transparent, g2d.Vec2{64, 64}))
tex := g2d.Upload(someImg)
buf.Draw(tex, g2d.Shifts(16, 16).Rotate(g2d.Tau/9))
d := g2d.Drawer{Dst: buf, Sampler: g2d.Linear, Frag: g2d.BlendAdd}
@eihigh
eihigh / sands.ahk
Created March 2, 2024 06:01
SandS (shift and space) in ahk v2
#Requires AutoHotkey v2.0
press := 0 ; スペースキーを押しているかどうか。
shifted := 0 ; スペースキー押下中に何かの印字可能文字を押したかどうか。
pressedAt := 0 ; スペースキーを押した時間(msec)。
timeout := 300 ; pressedAt からこの時間が経過したら、もはや離したときにもスペースを発射しない。
hook := InputHook() ; スペースキー押下中に何かの印字可能文字を押したかどうか捕捉するフック。
$*Space:: {
@eihigh
eihigh / vdom.js
Created September 18, 2021 02:02
vdom
var SSR_NODE = 1,
TEXT_NODE = 3,
EMPTY_OBJ = {},
EMPTY_ARR = [],
SVG_NS = "http://www.w3.org/2000/svg";
var listener = function (event) {
this.events[event.type](event);
};
@eihigh
eihigh / plan.md
Last active August 7, 2021 17:41
東方ゲームジャムで作るやつ

ジャンル

高速アクショントレーディングカードマネーゲーム!

概要

チャートを見ながらアビリティカード※を購入し、売りさばいて儲けよう! チャートは物凄い勢いで変動し、さらに複数の銘柄もといカードがあるので、悩んでいる暇はないぞ! 目指せ最速のトレーダー!!

※アビリティカード:東方虹龍洞に登場するアイテム。さまざまな東方キャラの魔力が込められている不思議なカード。天狗の大将はこれを流通させて金儲けを目論んだ、というのが虹龍洞の大まかなストーリー。

こんな雰囲気のゲームだよ

  • 本格的な経営ゲームを作るのは難しかったので シンプルな売買を繰り返してお金を増やすシンプルなゲーム。じっくり考えるより反射神経が大事なゲーム。
@eihigh
eihigh / tsuika-file.md
Last active January 3, 2020 04:01
ゆるくつかう GitHub Gist

複数のファイルを追加することもできる。

@eihigh
eihigh / hoge.js
Last active January 3, 2020 03:42
aaaa
a;kkkkkkkkkkkkk;
a;b;c;
@eihigh
eihigh / ファイル名.js
Last active January 3, 2020 03:35
簡単な説明
console.log('sayonara world');
console.log('hoge');
@eihigh
eihigh / vm.ts
Last active January 3, 2020 03:38
// counterデモをgoban式で実現
const Counter = {
view: () => [
m("button", { onclick: aco.send(vm.x + 1, "msg") }, `val: ${vm.x}`),
m("button", { onclick: aco.send({}, "reset") }, "reset"),
m(Todos)
]
} as m.Component;
@eihigh
eihigh / aco.ts
Created September 17, 2019 03:52
// aco -- Async COmmunication system
export interface Action {
event: Event;
value: any;
tag?: string;
}
let tmp: Action | null = null;
export const send = (value: any, tag?: string) => (event: Event) => {