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
// try with and without this next block | |
if (0) { | |
ig.Entity.prototype.touches = function( other ) { | |
return !( | |
this.pos.x >= other.pos.x + other.size.x || | |
this.pos.x + this.size.x <= other.pos.x || | |
this.pos.y >= other.pos.y + other.size.y || | |
this.pos.y + this.size.y <= other.pos.y | |
); | |
}; |
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
// A* path finding algorithm for impactjs game engine | |
// adapted from http://stormhorse.com/a_star.js | |
// via http://46dogs.blogspot.com/2009/10/star-pathroute-finding-javascript-code.html | |
// impact-ified by jminor - http://pixelverse.org/ | |
/* Example: | |
this.pathFinder = new PathFinder(); | |
var start = [((this.pos.x+this.size.x/2) / tilesize).floor(), ((this.pos.y+this.size.y/2) / tilesize).floor()]; | |
var destination = [((target.pos.x+target.size.x/2) / tilesize).floor(), ((target.pos.y+target.size.y/2) / tilesize).floor()]; |
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
Here is an English translation of the PicoPicoEngine's documentation. | |
ppgame:start() | |
Call ppgame:start(fn) to change the function that the engine calls to update your game. | |
By default, the engine will call your function called "start" but you can update this at run time based on your game logic. | |
For example, you might call ppgame:start(mainmenu) and then later ppgame:start(play) and then ppgame:start(gameover). | |
The argument you pass is a lua closure. | |
ppgame:platform() |
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
# Import the modulo python library | |
import modulo | |
# Create a new Port object using the first Modulo Controller it finds. | |
port = modulo.Port() | |
# Create a Display object attached to the port | |
display = modulo.Display(port) | |
eyes=[1,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
#!/usr/bin/swift | |
import Foundation | |
var shouldPrintUsage = true | |
var shouldPrintModes = true | |
var shouldSwitchMode = false | |
var didSwitchMode = false | |
var desiredDisplayNumber: Int? = nil | |
var desiredWidth: Int? = nil |
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
// Instructions: | |
// Just attach this script to your SteamVR Controller (left or right) and then you can draw in 3D. | |
// After you attach it, a new GameObject called "Sketch Line" will be added as a child. | |
// You'll want to adjust the material and width of the line renderer to make it look nice. | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class VRSimpleSketch : MonoBehaviour { |
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
Shader "Standard-DoubleSided" | |
{ | |
Properties | |
{ | |
_Color("Color", Color) = (1,1,1,1) | |
_MainTex("Albedo", 2D) = "white" {} | |
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5 | |
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 |
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
/* | |
OSC.cs | |
Open Sound Control for Unity | |
LICENSE: | |
A large portion of this code is based on Makingthings's Make Controller OSC C# implementation: | |
https://web.archive.org/web/20121021044334/http://www.makingthings.com:80/ref/firmware/html/group___o_s_c.html |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
[ExecuteInEditMode] | |
public class OSCSyncedObject : MonoBehaviour { | |
public OSC osc; | |
public string address = "/example/obj1"; | |
public bool forceSend; |
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
win = am.window{title = "Touch", | |
clear_color = vec4(1)} | |
face_img = [[ | |
........BBBBBBBBBB................. | |
.....BBBBBBBBBBBBBBBBBBB........... | |
...BBBBBBBBBBBBBBBBBBBBBBBBB....... | |
..BBBBBBBBBBBBBBBBBBBBBBBBBBB...... | |
.BBBBBBBBBBBBBBBBBBBBBBBBBBBBB..... | |
.BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB.... |
OlderNewer