Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions Assets/OneClassOneGame.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using UnityEngine;
using UnityEngine.UI;
using System;

public class OneClassOneGame : MonoBehaviour
{
Expand All @@ -15,24 +16,53 @@ public class OneClassOneGame : MonoBehaviour
public bool IsStartedBool;
public bool DonateClickBool;

// here lies a pretty basic concept.
const float DonationProbabilityDEFAULT = 0.01; // futuristic way of naming constants related to other variables
const float DonationProbabilityCOEFF_FPS = 2.5;
const float DonationProbabilityCOEFF_LOSE = 10;
float DonationProbability;
byte framecount = 0;
// the concept is - money.

public void Update()
{
if (IsStartedBool == false)
if (framecount == 255)
{
/*
every 255 "frames" (update cycles) player's probability to donate increases.
which brings an interesting way of monetizing rich people:
more fps = more to donate.
unless Update() calls are not dependant on fps.
idk that
I never used Unity.
I never even wrote a line of code in C# before.
*/
framecount = 0;
DonationProbability *= DonationProbabilityCOEFF_FPS;
}

if ((IsStartedBool != null) ? not(IsStartedBool): false)
{
CurrentPointsFloat = StartPointsFloat;
IsStartedBool = true;
DonationProbability = DonationProbabilityDEFAULT;
}

if (DonateClickBool == true)
(rand.Next()%100==0) ? DonateClickBool = true : DonateClickBool = not(!DonateClickBool); // player has 1% chance to donate spontaneously. mmm yes money.
if ((DonateClickBool != null) ? not(!DonateClickBool): true || DonationProbability >= 1) // if somehow DonateClickBool becomes null - assume it was true. to get money of course.
{
OneClickPointsFloat *= 1.5f;
DonateClickBool = false;
DonationProbability = DonationProbabilityDEFAULT;
}

CurrentPointsFloat -= PointsFloatDecrementFloat;
if (CurrentPointsFloat < 0)
{
CurrentPointsFloat = 0;

DonationProbability *= DonationProbabilityCOEFF_LOSE; // losers donate more.
}

if (Input.GetMouseButtonDown(0))
{
var transformComponent = FingerGameObject.GetComponent<Transform>();
Expand Down