This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var RED = [255, 0, 0, 255]; | |
var GREEN = [0, 255, 0, 255]; | |
var BLUE = [0, 0, 255, 255]; | |
var YELLOW = [255, 255, 0, 255]; | |
$(document).ready(function() { | |
var NUMBER_OF_POINTS = 99999; | |
var canvas = $("#canvas"); | |
var ctx = canvas[0].getContext("2d"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
// BallLife.js | |
// Ballが落下した場合にオブジェクトを削除 | |
var maxFallDistance : int = -10; | |
function Update () { | |
if (transform.position.y <= maxFallDistance) { | |
// 自分自身を削除 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
// BallSourceController.js | |
// 生成するボールオブジェクト | |
// InspectorでBallのPrefabをセットする | |
var ballObject : GameObject; | |
function Start () { | |
// 乱数シードを初期化 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
// X軸、Y軸、Z軸を中心とした1秒あたりの回転速度 | |
// Time.deltaTimeをかけること! | |
var speedX : float = 30.0; | |
var speedY : float = 40.0; | |
var speedZ : float = 50.0; | |
function Update () { | |
// 前回のUpdate()の呼び出しからの経過時間を返す |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
// Rigidbody.AddForce()のオプションの違い | |
// 参考: http://d.hatena.ne.jp/nakamura001/20120320/1332224186 | |
var bigCube : GameObject; | |
var bigCubeStartPos : Vector3; | |
var bigCubeStartRot : Quaternion; | |
var smallCube : GameObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
// CoinSource.js | |
// 生成するCoinオブジェクト | |
// InspectorでCoinのPrefabをセットする | |
var coinObject : GameObject; | |
function Start () { | |
// 乱数シードを初期化 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
// ブロック(インスペクタからセット) | |
var brickObject : GameObject; | |
function Start () { | |
// ブロックを配置して壁を作る | |
for (var y = 0; y < 10; y++) { | |
for (var x = -10; x < 10; x++) { | |
Instantiate(brickObject, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
// 砲弾に加える力 | |
var power : float = 30000; | |
// 砲弾オブジェクト(インスペクタからセット) | |
var shellObject : GameObject; | |
// 発射音(インスペクタからセット) | |
var bomb : AudioClip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf-8 | |
import numpy as np | |
import sys | |
from pylab import * | |
# M次多項式近似 | |
M = 3 | |
def y(x, wlist): | |
ret = wlist[0] | |
for i in range(1, M+1): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
var maxFallDistance : int = -10; | |
function Update () { | |
if (transform.position.y <= maxFallDistance) { | |
// 自分自身を削除 | |
Destroy(gameObject); | |
} | |
} |
OlderNewer