Skip to content

Instantly share code, notes, and snippets.

View moyashipan's full-sized avatar
👀

moyashipan moyashipan

👀
  • pixiv Inc.
  • Yoyogi Shibuya-ku Tokyo Japan
View GitHub Profile
@moyashipan
moyashipan / gist:5600216
Last active December 17, 2015 11:09
script for "non-gravity racing game prototype"
public var forwardSpeed:Number;
public var steerAngle:Number;
public var rotationT:float = 0.25;
function FixedUpdate () {
var x:Number = Input.GetAxis("Horizontal");
var y:Number = Input.GetAxis("Vertical");
if (HitTestWithRoad()) {
}
@moyashipan
moyashipan / PixivVendorWatcher
Last active December 14, 2015 05:29
カップ式ドリンクベンダー内の「取り出されていないカップ」を監視する。 Arduinoと距離センサを使用。
// 参考にしたソースコード:
// Prototyping Lab ―「作りながら考える」ためのArduino実践レシピ (Make:PROJECTS) [大型本] 小林 茂 (著)
// http://p.tl/RQFE
//
// 使ったArduino(本当はArduino Nano 3.1):
// Arduino Nano
// http://p.tl/1D1u
//
// 使ったセンサを含むキット:
// Prototyping Lab Kit Vol.1 スイッチサイエンス
@moyashipan
moyashipan / gist:2000483
Created March 8, 2012 11:09
Processing: Input audio and draw colorilze wave
import ddf.minim.*;
Minim minim;
AudioInput in;
float data;
int[] col = new int[8];
float angle = 0.0;
float offsetAngle = PI / 3;
@moyashipan
moyashipan / FollowGround.js
Last active March 15, 2019 20:36
Unity3D: Function to following the ground
// You should change the center of this gameObject's mesh from default value (0,0,0).
// Because this script put its point to the contact point with the ground.
// And "use gravity" must be FALSE.
// Call HitTestWithRoad() from Update()
public var distance:float = 2.0;
public var smoothRatio:float = 0.2;
function HitTestWithRoad() {