Skip to content

Instantly share code, notes, and snippets.

View grifdail's full-sized avatar

Julien Berthou grifdail

View GitHub Profile
@grifdail
grifdail / coolsound.js
Created November 4, 2014 11:34
CouldSound
/*!
*
* welcome to wavepot
* ------------------
*
* this is a live editor. you create a function named `dsp`
* that accepts the parameter `t`, the coefficient of time,
* which you use to generate a single sample (range -1..1)
*
@grifdail
grifdail / CoolerSound.js
Created November 4, 2014 13:10
CoolerSound
/*!
*
* welcome to wavepot
* ------------------
*
* this is a live editor. you create a function named `dsp`
* that accepts the parameter `t`, the coefficient of time,
* which you use to generate a single sample (range -1..1)
*
@grifdail
grifdail / bestSound.js
Created November 4, 2014 17:54
BetterSong.js
/*!
*
* welcome to wavepot
* ------------------
*
* this is a live editor. you create a function named `dsp`
* that accepts the parameter `t`, the coefficient of time,
* which you use to generate a single sample (range -1..1)
*
{"pistes":[{"type":"sqr","notes":[{"n":0,"o":3,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":0,"o":3,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":0,"o":3,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":0,"o":3,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":9,"o":2,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":9,"o":2,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":9,"o":2,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":9,"o":2,"g":1,"type":0},{"n":9,"o":2,"g":0,"type":0},{"n":0,"o":3,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":0,"o":3,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":0,"o":3,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":0,"o":3,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":9,"o":2,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":9,"o":2,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":9,"o":2,"g":1,"type":0},{"n":0,"o":0,"g":0,"type":0},{"n":9,"o":2,"g":1,"type":0},{"n":9,"o":2,"g":0,"type":0}],"volume":0.1,"harmonic":0},{"type":"arp","notes":[{"n":9,"o":
@grifdail
grifdail / CameraControle.cs
Created February 21, 2015 13:21
Unity script to move a camera like in Black and White or almost any 3d strategie game.
using UnityEngine;
using System.Collections;
public class CameraControl : MonoBehaviour {
public float translateScale = 20;
public float rotateScale = 1;
public float zoomScale = 100;
private Vector3 _lastHitPoint;
@grifdail
grifdail / camera.js
Created April 11, 2015 21:46
Raycaster Javascript
function RayCastCamera(fov,resolution) {
this.fov = fov;
this.resolution = resolution; //How Many ray should we cast and draw;
}
RayCastCamera.prototype.render = function(map, pos, angle, walls) {
ctx.fillStyle = "black";
ctx.fillRect(0,0,width,height*0.5); //The Top of the Screen is black
ctx.fillStyle = "grey";
ctx.fillRect(0,height*0.5,width,height*0.5); // The bottom is grey
@grifdail
grifdail / robot.js
Created December 7, 2012 12:58
George washington
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(10);
@grifdail
grifdail / robot.js
Created December 7, 2012 13:40
Marvin
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
//robot.clone()
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(10);
@grifdail
grifdail / bug.js
Created December 7, 2012 15:01
bug bizare JS
Data.Building = []
Data.Building[0] = {
image: (new Image()),//.src="Assets/tree.png",
printX: 0,
printY: 32,
printW: 32,
printH: 64,
map: [1],
width: 1,
height: 1,
@grifdail
grifdail / gist:4734470
Last active December 12, 2015 07:09
Essential for the GSP
{
"data": {
"author": "",
"website": "",
"about": ".",
"title": "",
"lang": "en-US",
"version": "1",
"date": "01-01-2013",
},