This file contains hidden or 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
basic.forever(function () { | |
let light = input.lightLevel() | |
let fillAmount = Math.map(light, 0, 255, 0, 25) | |
fillAmount = Math.constrain(fillAmount, 0, 25) | |
basic.clearScreen() | |
for (let i = 0; i < fillAmount; i++) { | |
let x = i % 5 | |
let y = Math.floor(i / 5) |
This file contains hidden or 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
basic.forever(function () { | |
let roll = input.rotation(Rotation.Roll) // Left/right tilt | |
if (roll < -20) { | |
makeyMakey.typeKey(makeyMakey.KeyPress.A) | |
basic.showArrow(ArrowNames.West) | |
} else if (roll > 20) { | |
makeyMakey.typeKey(makeyMakey.KeyPress.D) | |
basic.showArrow(ArrowNames.East) |
This file contains hidden or 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
makeyMakey.sx1509Init() | |
input.onSound(DetectedSound.Loud, function () { | |
makeyMakey.typeKey(makeyMakey.KeyPress.W) | |
basic.showIcon(IconNames.Happy) | |
basic.pause(10) | |
basic.clearScreen() | |
}) |
This file contains hidden or 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
private Transform activeMap; | |
void SwapMap() | |
{ | |
if (activeMap) activeMap.gameObject.SetActive(false); | |
int chunkHash = Mathf.Abs((int)transform.position.x * 73856093 ^ (int)transform.position.y * 19349663); | |
activeMap = maps[seed.Next(chunkHash, maps.Count)]; // Directly store GameObject | |
activeMap.gameObject.SetActive(true); |
This file contains hidden or 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; | |
public class VirtualPlane : MonoBehaviour | |
{ | |
GameObject player; | |
int planeSize = 200; | |
int planeHalf = 100; |
This file contains hidden or 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; | |
using UnityEngine.UI; | |
public class CamFeed : MonoBehaviour | |
{ | |
private WebCamTexture webCamTexture; |
This file contains hidden or 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; | |
public class Spawner : MonoBehaviour | |
{ | |
public List<Transform> points = new List<Transform>(); // add 3 points in the world | |
public GameObject point;// -- can be used for spawning |
This file contains hidden or 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; | |
public class SpawnObject : MonoBehaviour | |
{ | |
public List<Transform> possiblePositions = new List<Transform>(); | |
public List<GameObject> allThings = new List<GameObject>(); |
This file contains hidden or 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; | |
public class Ripple : MonoBehaviour | |
{ | |
//preset |
This file contains hidden or 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; | |
public class Fade : MonoBehaviour | |
{ | |
CanvasGroup group; | |
float timer; | |
float fadeOutTimer; |
NewerOlder