Jump to content
Banner by ~ Kyoshi Frost Wolf

Ganaram Inukshuk

User
  • Posts

    471
  • Joined

  • Last visited

Everything posted by Ganaram Inukshuk

  1. No joke, but that was going through my head at one point.
  2. I just drove 200 miles today. Now I feel like I wanna sleep for 200 years.
  3. Oh my goodness, I can't believe this worked: // This is a counter whose range is [0, some_arbitrary_max] // Setting the max really high mimics a range of [0, infinity); this is also the default // This can be used for all sorts of applications, including a healthbar public class Counter { private int _count; private int _max; // Constructor with a preset max public Counter(int presetMax) { Max = presetMax; _count = 0; } // Default constructor public Counter() { _max = int.MaxValue; _count = 0; } // Increment the count by an arbitrary value; decrement using a negative value public void IncrementCount(int amt) { int newCount = _count + amt; if (newCount < 0) _count = 0; else if (newCount > _max) _count = _max; else _count = newCount; } // Additional functions for zeroing or maxing out the counter public void ZeroOutCount() { Count = 0; } public void MaxOutCount() { Count = Max; } // Increment the max by an arbitrary value; decrement using a negative value // If the max ever becomes less than the count, the count should be reassigned // to be the same as the max; this ensures the count stays within [0, max] public void IncrementMax(int amt) { if (_max + amt < 0) _count = 0; else _max += amt; if (_max <= _count) _count = _max; } // Setter-getter for the max; this can also force the count to be any value, but // will readjust the count if the max falls below the count to keep the count within // the range [0, max] public int Max { set { if (value >= 0) _max = value; if (_max < _count) _count = _max; } get { return _max; } } // Setter-getter for the count; this can also force the count to be any value public int Count { set { if (value >= 0) _count = value; } get { return _count; } } // This is the same as the regular counter but instead of having a count // within the range [0, max], there are two counts (count1 and count2) such that // 0 >= count1 >= count2 >= max; since this class encapsulates two instances of // a counter, any and all calculations are handled by the individual counters public class Bicounter { Counter _ctr2; // Effective range of [0, max] Counter _ctr1; // Effective range of [0, ctr2.Count] public Bicounter(int presetMax) { _ctr2 = new Counter(presetMax); _ctr1 = new Counter(_ctr2.Count); } public Bicounter() { _ctr2 = new Counter(); _ctr1 = new Counter(_ctr2.Count); } public void IncrementCount1(int amt) { _ctr1.IncrementCount(amt); } public void IncrementCount2(int amt) { _ctr2.IncrementCount(amt); _ctr1.Max = _ctr2.Count; } public void ZeroOutCount() { _ctr2.ZeroOutCount(); _ctr1.ZeroOutCount(); } public void MaxOutCount() { _ctr2.MaxOutCount(); _ctr1.Max = _ctr2.Max; _ctr1.MaxOutCount(); } public int Max { set { _ctr2.Max = value; } get { return _ctr2.Max; } } public int Count2 { set { _ctr2.Count = value; _ctr1.Max = _ctr2.Count; } get { return _ctr2.Count; } } public int Count1 { set { _ctr1.Count = value; } get { return _ctr1.Count; } } } I may need more tests, but this is the healthbar-inside-of-a-healthbar thing I was talking about a few weeks ago such that 0 >= count_1 >= count_2 >= max, and I achieved it by encapsulating two separate counters inside of a bicounter class. No, I'm not gonna think about making a tricounter or an ncounter; even though the code can be generalised, I don't have a use for anything beyond a bicounter. No, I have no idea how this would be done using ECS since the counter is an overly generalized healthbar. I can't justify using Unity's data oriented tech stack when I have a fairly puny project where everything would be represented by a UI. If this was a healthbar, then the counter works fine. However, I have a situation where I may need the bicounter instead; EG, instead of distinguishing between occupied buildings and unoccupied buildings, I have to distinguish between unused plots of land, plots of land with an unoccupied building, and plots of land with an occupied building. Now that I think about it, a bicounter may not be needed if a plot of land can contain more than one building; instead, it'd have to be two separate counters, one for used and unused plots of land, with a means of getting the number of individual buildings, and another for occupied and unoccupied buildings.
  4. Random idea I had for a while: Glimmy tied to a bunch of balloons and floating and trying to say hi to Sunburst.
  5. Note: Don't map Yona to "baroo-baroo".

  6. "...Hi, Sunburst." (I was literally one detail from finishing, so I finished it. No background, no problem.)
  7. I really wanna finish the pic where Glimmy hands Sunny a balloon...
  8. I've always wondered if solar panels were legal... (On the other hand, I don't have any special drawings for this event; just the one for the balloons that I still haven't completed.) Wait... SUNburst...
  9. Well, now I dreamt that all the princesses were kidnapped or something. Now where have I heard that before...?
  10. I think you said that before. Also, for no good reason, Princess Applejack. Also, Pseudo-Princess Gemmy, but she has those red and amber lights that big trucks usually have.
  11. Worse: they have to share that nickname with a sun conure also named Sunny.
  12. Little moments of silliness puts a smile on my face; perhaps Glimmy is offering some Sunny-coloured balloons over to Sunny. On the other hand, perhaps it's feasible to port my JS game over to C#, but the ultra-long-term goal is to evolve it beyond its incremental game status. On the other other hand, I found a really big Minecraft modpack.
  13. "H... hi, Sunburst." - Glimmy probably
  14. It's a random idea I had for a while; it's not so much Glimmy trying to fly but how Glimmy ended up tied to balloons. And Sunburst being involved... I also opened up Unity again...
  15. ...I actually have an idea in the back of my head for this...
  16. ...what if "Sandbar" is short for "Sandra Barbara"...?

  17. Thanks, but it's 23:00. I also wanna draw some more Gally-birb, but I located an online text generator, and let's just say it has no idea what the hell it's doing. public static int[] Reconcile(int[] hist) { int[] newHist = new int[hist.Length]; for (int i = 0; i < hist.Length; i++) newHist[i] = Math.Abs(hist[i]); /* Everything after this point was text-generated */ return newHist; } public static int[] Add(int[] hist, int[][] temp) { int[] newHist = new int[hist.Length]; int sum = 1; int sumTwoSq = new int[2](sum); int dps2 = temp + sum.Length; int max = sum + dps2 * sum; int sumFractals = new int[3](sum); int tempFractals = temp + sum.Length; int maxFractals = max + dps2 * sum.Length; int numFractals = int.Max(numFractals); float tempFractals = int.Min(numFractals); if (tempFractals > maxFractals) tempFractals = tempFractals; int numFractals++; int sumThreeSq = tempFractals / 3; int tempThreeSq = tempFractals + 3;
  18. No, I just think Gally-birb looks adorable when he looks like he needs a hug.
  19. Speaking of cat... So you know how my art style is mouthless? That breaks down once you introduce the birbs. Or Smolderp. I have a thing for Gally-birb...
  20. Yeah it didn't. Would Gallus sing like a parrot ot purr like a kitten...?
×
×
  • Create New...