Skip to content

Instantly share code, notes, and snippets.

View brmenchl's full-sized avatar
🌝

Brad brmenchl

🌝
  • ClassDojo
View GitHub Profile
@brmenchl
brmenchl / ScreenWrappingRigidbody2D.cs
Created September 22, 2020 15:06
Screen wrapping for a 2d game, with physics support on edges.
using UnityEngine;
using System;
using System.Collections.Generic;
public class ScreenWrappingRigidbody2D : MonoBehaviour
{
[SerializeField] private GameObject clonePrefab;
private Dictionary<ClonePlacement, GameObject> clones = new Dictionary<ClonePlacement, GameObject>();
private Vector2 screenBounds;
@brmenchl
brmenchl / oopMarsRover.ts
Created June 18, 2020 20:14
OOP Mars Rover but typesafe
import "colors";
function assertEquals(message: string, actual: unknown, expected: unknown) {
console.log(
`[%s] ${message}`,
actual === expected ? "PASS".green : "FAIL".red
);
}
interface Direction {

Keybase proof

I hereby claim:

  • I am brmenchl on github.
  • I am bardmardle (https://keybase.io/bardmardle) on keybase.
  • I have a public key ASBH0zIXc2A9CXDC5yFO_jqOuT2tG--QxjUWbLLR_0mt0go

To claim this, I am signing this object: