Skip to content

Instantly share code, notes, and snippets.

View PhilipRosedale's full-sized avatar

Philip Rosedale PhilipRosedale

View GitHub Profile
//
// tipJar.js
//
// Users can click on the entity attached to this script to pay
// a user 10 HFC.
//
// Copyright 2018 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
import pygame
import sys
from pygame.locals import *
from sys import exit
from random import *
import ovr
import math
ovr.initialize(None)
//
// nearbyUpdate.js
// examples/entityScripts
//
// Philip Rosedale, December 26, 2017
//
// This entity script is a way to efficiently update entities based on how far away from you they are,
// dropping the update rate as a function of distance squared. This works well for the most typical case of a
// large number of entities arranged roughly randomly on a sheet.
//
//
// ControllerHandshake.js
//
// Created by Philip Rosedale on April 28, 2017
// Copyright 2016 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
// This script makes the left and right hands 'mirror' each other, as a function of how much their triggers are pulled.
//
// drum.js
//
// Created by Patrick Gosch on 03/28/2017
// Modified / Adapted by Philip Rosedale for sample use
// Copyright 2017 High Fidelity, Inc.
//
// Attach this entity script and either hit it or click it to hear a sound.
//
// Distributed under the Apache License, Version 2.0.
// halfDuplex.js
//
// Created by Philip Rosedale on April 21, 2017
// Copyright 2016 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
// This client script reduces echo by muting the microphone when others nearby are speaking,
// allowing the use of live microphones and speakers.
@PhilipRosedale
PhilipRosedale / touch.js
Created April 10, 2017 00:09
touch test entity script
(function() {
var TIMESCALE = 0.03;
var ACTION_TTL = 10;
var _this;
var RIGHT_HAND = 1;
var LEFT_HAND = 0;
var HAPTIC_PULSE_FIRST_STRENGTH = 0.5;
var HAPTIC_PULSE_MIN_STRENGTH = 0.20;
Verifying that "philipr.id" is my Blockstack ID. https://onename.com/philipr
http://hifi-content.s3.amazonaws.com/ozan/dev/avatars/hifi_team/philip/sss/philip.fst
(function(){
this.defaultMaxRange = 5;
this.acceleration = {x: 0, y: 0, z: 0};
this.onColor = {red: 10, green: 200, blue: 10};
this.offColor = {red: 200, green: 0, blue: 0};
var self = this;
//Default forward direction of mover object
this.forward = {x: 0, y: 0, z: -1};
this.isMoving = false;
this.velocity = {x: 0, y: 0, z: 0};