Bing
starchberry funklegart   El Salvador
 
 
:zero: :zero: :zero: :zero: :zero:
Artwork Showcase
Shit's gas
1 1
bocklarvara
// Nothing
using TMPro;
using UnityEngine;

⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⠟⢻⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠹⣿⣳⠖⠳⣄⡀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⡤⠒⠀⠂⡾⠉⠀⠀⠀⠀⠉⢳⡄⣄⡀⠀⠀
⠀⠀⠀⢸⡥⠀⣀⡼⢁⠀⢰⡄⠀⡄⠀⠀⣧⠀⠙⡆⠀
⠀⢀⣠⠼⠗⠚⠉⠠⠋⠀⠀⢷⣠⣧⠀⠀⠈⠳⢤⣇⠀
⠀⣾⣟⠒⠦⣄⠀⠀⠀⣠⡴⠋⠁⢈⠛⢦⣄⣠⣴⣾⣷
⢀⡟⠙⢶⣤⠬⠷⣼⡏⠉⠉⢩⡍⠹⠦⢤⣿⣤⣨⣿⠈
⡾⣡⠆⠁⠀⠀⠀⢠⡀⠀⠀⠀⢱⡀⠀⠂⠙⠎⠻⡅⠀
⢿⠁⠒⣤⠤⣤⣀⠀⢧⠀⠀⠀⣸⠃⠀⠀⠀⡶⣤⣽⠀
⠈⠳⣴⡇⠀⠀⠈⠛⢦⣄⣠⠾⢿⣄⣀⣠⠾⣡⠞⠁⠀
⠀⠀⠈⠉⠉⠉⠁⢧⢠⠟⣽⠀⢿⠀⢧⢰⡈⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠐⢫⠏⢸⠁⠀⠈⢳⠘⢧⣙⢦⠀⠀⠀


public class Nothing : MonoBehaviour
{
private enum GameState
{
NotStarted,
InProgress,
GameOver
}

private GameState currentState;

private float inactivityTime;

private float startupPeriod = 1f;

private float stateChangeTime;

public TMP_Text timerText;

private string nothingLabel = "<color=#FFFFFF>Nothing</color>";

private string somethingLabel = "<color=#000000>Something</color>";

protected bool didSomething
{
get
{
if (!Input.anyKeyDown && !Input.GetMouseButtonDown(0) && Input.touchCount <= 0 && !(Input.acceleration != Vector3.zero) && Input.GetAxis("Mouse X") == 0f)
{
return Input.GetAxis("Mouse Y") != 0f;
}
return true;
}
}

private void Start()
{
timerText.text = "Press any key to start doing " + nothingLabel + "\n";
}

private void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
Application.Quit();
}
switch (currentState)
{
case GameState.NotStarted:
if (Input.anyKeyDown)
{
currentState = GameState.InProgress;
stateChangeTime = Time.time;
}
else if (Time.time >= startupPeriod)
{
timerText.text = "Press any key to start doing " + nothingLabel + "\n";
}
break;
case GameState.InProgress:
timerText.text = "You have been doing " + nothingLabel + " for\n" + TimeTextFormatted() + "\n";
inactivityTime += Time.deltaTime;
if (Time.time - stateChangeTime >= 1f && didSomething)
{
stateChangeTime = Time.time;
currentState = GameState.GameOver;
}
break;
case GameState.GameOver:
timerText.text = "You did " + somethingLabel + ", you lost\n You did " + nothingLabel + " for " + TimeTextFormatted();
if (Time.time - stateChangeTime >= 1f && Input.anyKeyDown)
{
ResetGame();
}
break;
}
}

private void ResetGame()
{
currentState = GameState.NotStarted;
inactivityTime = 0f;
timerText.text = "Press any key to start doing " + nothingLabel + "\n";
stateChangeTime = Time.time;
}

private string TimeTextFormatted()
{
int num = (int)inactivityTime;
int num2 = num / 86400;
num %= 86400;
int num3 = num / 3600;
num %= 3600;
int num4 = num / 60;
num %= 60;
string text = "";
if (num2 > 0)
{
text = text + num2 + ((num2 == 1) ? " day" : " days") + ", ";
}
if (num3 > 0)
{
text = text + num3 + ((num3 == 1) ? " hour" : " hours") + ", ";
}
if (num4 > 0)
{
text = text + num4 + ((num4 == 1) ? " minute" : " minutes") + ", ";
}
return text + num + ((num == 1) ? " second" : " seconds");
}
}
NexxyWexxy Apr 25 @ 3:03am 
Type of fella to re-invent reese's cups but instead of using peanut butter, he gonna add something like Pineapple fritters
fimbus? Mar 27 @ 11:57pm 
imagine that
Bing Jan 17, 2023 @ 4:39pm 
:(
malaiseangel Jan 17, 2023 @ 4:43am 
-rep lied about loom bands i will never trust you again:snake:
to$h Jan 14, 2023 @ 6:54pm 
:steamthis:
JudeEgg Oct 14, 2022 @ 10:47pm 
sorry didn't mean that Yusef, stay longer if you want