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
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
// 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
// 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
win = am.window{title = "Touch", | |
clear_color = vec4(1)} | |
face_img = [[ | |
........BBBBBBBBBB................. | |
.....BBBBBBBBBBBBBBBBBBB........... | |
...BBBBBBBBBBBBBBBBBBBBBBBBB....... | |
..BBBBBBBBBBBBBBBBBBBBBBBBBBB...... | |
.BBBBBBBBBBBBBBBBBBBBBBBBBBBBB..... | |
.BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB.... |
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
-- Sprite Editor | |
-- Paste any sized sprite into this block to edit it. | |
-- After drawing, copy the text from the console. | |
img = [[ | |
...cc.ccc. | |
.cccccccc. | |
.cYYcYYYc. | |
YYgWYYgWcY | |
YYYYYYYYYY |
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
// This adds a simple text area for you to add comments | |
// to your GameObjects in the Unity inspector. | |
// Comments are saved with your scene, just like any other | |
// component on a GameObject. | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif |
OlderNewer