Skip to content

Instantly share code, notes, and snippets.

@icezee
icezee / chessboard.lua
Created July 9, 2018 05:21
roblox: lua script to create a chess board
function make_checkerboard(x,z)
print("make_checkerboard...")
local d = 4
for i=0,7,1 do
for j=0,7,1 do
local p = Instance.new("Part", workspace)
p.Size = Vector3.new(d,d,d)
p.Color = Color3.new(0,0,0)
p.Position = Vector3.new(x+i*d,0,z+j*d)
@icezee
icezee / ColorChangingBrick.lua
Last active July 11, 2018 01:03
A Jumping Game (Roblox)
local debounce = false
local colors = {BrickColor.Black(), BrickColor.Red(), BrickColor.White()}
local index = 0
function onTouched()
if debounce == true then return end
debounce = true
print("touched ...")
index = (index + 1) % table.getn(colors)
@icezee
icezee / MagicDice.lua
Created August 14, 2018 17:22
A Magic Dice
local dice = script.Parent
local six_cframes = {
CFrame.fromOrientation(0,0,0),
CFrame.fromOrientation(math.rad(90),0,0),
CFrame.fromOrientation(0,0,math.rad(-90)),
CFrame.fromOrientation(0,0,math.rad(90)),
CFrame.fromOrientation(math.rad(-90),0,0),
CFrame.fromOrientation(math.rad(180),0,0)
}
@icezee
icezee / make_dice_base.lua
Last active August 15, 2018 04:41
Dice Land
-- read soroblox.blogspot.com for details
-- put MagicDice, (made from previous blog), under ReplicatedStorage
function make_dice_base()
local d = 4.1
for i = -20, 20, 1 do
for j = -20, 20, 1 do
local c = game.ReplicatedStorage.MagicDice:Clone()
c.Parent = game.Workspace
c.Position = Vector3.new(i*d, 2, j*d)
@icezee
icezee / Target.py
Last active November 5, 2019 03:50
Python with Processing
def circle(x,y,R):
ellipse(x,y,R,R)
def target(x,y,d):
fill(255,255,255)
rect(x,y,d,d)
fill(255,0,0)
circle(x+d/2.0,y+d/2.0,d)
fill(255,255,255)
circle(x+d/2.0,y+d/2.0,d*2.0/3.0)
@icezee
icezee / Loop.pyde
Last active November 10, 2019 22:07
Loop
def setup():
size(960,540)
for i in range(100):
strokeWeight(i*.1)
line(i*10,540,i*10,540-i*10)
line(0,i*10,540-i*10,i*10)
save("loop.png")
@icezee
icezee / three_boilerplate.html
Last active July 9, 2020 17:09
soundspace_gist
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Three Starts Here</title>
</head>
<body>
<div id="container"></div>
<script type="module">
@icezee
icezee / soundspace_addsound.html
Created July 10, 2020 07:00
Add sound and analyze it
<script type="module">
// ...
const soundFile = './data/nocturne_01.mp3'
const fftsize = 2048
const frequencyRange = {
bass: [20, 140],
lowMid: [140, 400],
mid: [400, 2600],
highMid: [2600, 5200],
treble: [5200, 14000],
@icezee
icezee / setup_babylon.js_webpack.config.js
Created August 22, 2020 19:30
Babylon JS Project Setup (TS with webpack)
const path = require('path')
module.exports = {
mode: "development",
entry: {
app: "./src/app.ts"
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
@icezee
icezee / setup_babylon.js_tsconfig.json
Created August 23, 2020 03:59
Setup Babylon JS tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"target": "es5",
"module": "es2015",
"sourceMap": true,
"outDir": "./dist",
"types": [
"babylonjs",
"babylonjs-gui",