Skip to content

Instantly share code, notes, and snippets.

@brismithSFHS
brismithSFHS / LightOrDense.java
Created December 13, 2022 04:28
In this program, I was trying to test out which situations in Warhammer 40k are better for troops to be in light cover, and when they are better for troops to be in dense cover. I wanted to test this so that I could decide between the Vexilla Defensor or Vexilla Magnifica for an Adeptus Custodes army.
public class LightOrDense
{
public static void main(String[] args)
{
int lightWins = 0; //Vexilla defensor - light cover: +1 to saving throws, invluns not affected
int denseWins = 0; //Vexilla magnifica - dense cover: -1 to hit
int insigLightWins = 0;
int ties = 0;
int spins = 1000000;
@brismithSFHS
brismithSFHS / PlayerController2.cs
Last active April 19, 2024 21:21
Player Controller with Ball Jump - Input System
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.InputSystem;
using TMPro;
public class PlayerController2 : MonoBehaviour
{
public float speed;
@brismithSFHS
brismithSFHS / Appear.cs
Last active April 12, 2024 18:04
A short script for making objects appear in Unity's Roll-a-Ball - works with the Input System
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Appear : MonoBehaviour
{
public GameObject ball;
public int count; // number of cubes needed to make this object appear
@brismithSFHS
brismithSFHS / TimerScript.cs
Created April 12, 2019 21:32
A simple timer for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
public class TimerScript : MonoBehaviour
{
//This script should be attached to a UI Text element
public Text timerText;
public bool keepCounting;
@brismithSFHS
brismithSFHS / CameraController_with_Rotation.cs
Created March 16, 2018 22:20
Modified Unity Tutorial scripts including: A camera controller script for Unity Roll-a-ball that lets you rotate the camera, a wall mover, and the player controller to go with them
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour {
public GameObject player;
public static int rotPosition = 0;
private Vector3 offset;
private bool rotating = false;
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
public int numCubes;
public Text countText;
public Text winText;
@brismithSFHS
brismithSFHS / BallControl_Jump.cs
Last active November 3, 2021 01:16
The finished Player Controller script for Unity Roll-a-Ball Tutorial with jumping and score keeping
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
public float jumpHeight;
public Text countText;
public Text winText;