What do you do when you pass a level?

If you find a bug or you have a feature request, post here!
Post Reply
jmobijo
Posts: 7
Joined: Wed Mar 03, 2010 12:37 am

What do you do when you pass a level?

Post by jmobijo » Wed Mar 10, 2010 1:04 pm

I passed a level, but now what?

zander
Site Admin
Posts: 7
Joined: Tue Mar 02, 2010 6:58 pm

Re: What do you do when you pass a level?

Post by zander » Wed Mar 10, 2010 4:43 pm

This is perfect! From a developer's point of view, it seems obvious to click on your stats button to distribute your level up point :roll:
I guess I assumed you could read my mind!
I'll find a way to make it obvious what you have to do. (either a dialog box to pop up, or a have the stats button flash for a few seconds...)

zander
Site Admin
Posts: 7
Joined: Tue Mar 02, 2010 6:58 pm

Re: What do you do when you pass a level?

Post by zander » Thu Mar 11, 2010 1:17 am

I fixed it by having your stats button blink after you a pass a level, similar to when your Journal button blinks when getting a quest.
If you're curious, here's the code that I cooked up to make it work:

Code: Select all

using System;
using System.Collections.Generic;
using System.Text;

public class BlinkButtonManager
{
    // List containing all blinking buttons:
    private List<BlinkData> m_BlinkingButtons = new List<BlinkData>();
    public void BlinkButton(string buttonName)
    {
        BlinkData blinkData = new BlinkData(buttonName);
        this.m_BlinkingButtons.Add(blinkData);
    }
    // Every frame, this function will be called to update any blinking buttons:
    public void Update(float elapsedTime)
    {
        // I count backwards because I'm modifying the size of list while iterating:
        for (int i = this.m_BlinkingButtons.Count - 1; i >= 0; i--)
        {
            if (this.m_BlinkingButtons[i].m_IsJournalBlinking)
            {
                this.m_BlinkingButtons[i].m_JournalElapsedTime += elapsedTime;
                this.m_BlinkingButtons[i].m_JournalElapsedTimeIncrement += elapsedTime;
                if (this.m_BlinkingButtons[i].m_JournalElapsedTime > 1.5)
                {
                    this.m_BlinkingButtons[i].m_IsJournalBlinking = false;
                }
                if (this.m_BlinkingButtons[i].m_JournalElapsedTimeIncrement > .15)
                {
                    this.m_BlinkingButtons[i].m_JournalElapsedTimeIncrement = 0.0f;
                    if (TerraAegrus.Buttons[this.m_BlinkingButtons[i].m_ButtonName].ButtonState == GenericButton.STATE.IsRollOver)
                    {
                        TerraAegrus.Buttons[this.m_BlinkingButtons[i].m_ButtonName].ButtonState = GenericButton.STATE.IsPressed;
                    }
                    else
                    {
                        TerraAegrus.Buttons[this.m_BlinkingButtons[i].m_ButtonName].ButtonState = GenericButton.STATE.IsRollOver;
                    }
                }
            }
            else
            {
                TerraAegrus.Buttons[this.m_BlinkingButtons[i].m_ButtonName].ButtonState = GenericButton.STATE.IsUnpressed;
                this.m_BlinkingButtons.RemoveAt(i);
            }
        }
    }
    // Private data class containing information on a blinking button:
    private class BlinkData
    {
        public bool m_IsJournalBlinking = false;
        public float m_JournalElapsedTime = 0.0f;
        public float m_JournalElapsedTimeIncrement = 0.0f;
        public string m_ButtonName;
        public BlinkData(string buttonToBlink)
        {
            this.m_IsJournalBlinking = true;
            this.m_JournalElapsedTime = 0.0f;
            this.m_JournalElapsedTimeIncrement = 0.0f;
            this.m_ButtonName = buttonToBlink;
            // I don't like doing this, but it works:
            TerraAegrus.Buttons[buttonToBlink].ButtonState = GenericButton.STATE.IsRollOver;
        }
    };
}
 

jmobijo
Posts: 7
Joined: Wed Mar 03, 2010 12:37 am

Re: What do you do when you pass a level?

Post by jmobijo » Fri Mar 12, 2010 1:12 pm

Thanks for the fix, but the button has to blink longer.
I passed a level killing that skeleton guy, and it went immediately to that cut screen, and I didn't know to press the stats button when I passed a level. :cry:

zander
Site Admin
Posts: 7
Joined: Tue Mar 02, 2010 6:58 pm

Re: What do you do when you pass a level?

Post by zander » Sat Mar 13, 2010 10:08 pm

Ah. I see what you mean. I fixed it.

Post Reply