private void MainTimer_Tick(object sender, EventArgs e)
{
if (_previousColorValue < _currColorValue)
{
_maxColorValue = _currColorValue;
}
_previousColorValue = _currColorValue;
if (_deSpawnFinished)
{
mainTimer.Stop();
}
if (_isDespawing)
{
int _pathToTrace = _endY - _startY;
int _repeatCount = 2;
if (_currRepeatCount < _repeatCount)
{
if (_currLocation < _endY)
{
for (int i = 1; i < _repeatCount; i += 1)
{
_currLocation += (_height / 4) * 3;
Rectangle _main = new Rectangle(_x, _y, _width, _height);
Rectangle _shadow = new Rectangle(_x, _currLocation, _width + (_width + 0), _height + 0);
Font _mainFont = new Font("Microsoft Sans Serif", _width - 6, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
Color _selectedColor = new Color();
int _currCharIndex = getIndex();
if (_currColorValue - ((_currForm.Height / _height) * _height) > 0)
{
_currColorValue = _currColorValue - (((_currForm.Height / _height) * _height) / 2);
}
else
{
_currColorValue = 0;
}
_selectedColor = Color.FromArgb(150, 0, _currColorValue, 0);
//_myGraphics.FillRectangle(Brushes.Black, _main);
_myGraphics.FillRectangle(new SolidBrush(Color.FromArgb(new Random().Next(100, 200), 0, 0, 0)), _shadow);
//_myGraphics.DrawString(_charList[_currCharIndex].ToString(), _mainFont, new SolidBrush(Color.White), _main);
//_myGraphics.DrawString(_charList[_currCharIndex].ToString(), _mainFont,new SolidBrush(_selectedColor), _shadow);
}
_curr2 += 1;
}
else
{
_currLocation = _startY - 100;
_currRepeatCount += 1;
_curr2 = 0;
}
}
else
{
_deSpawnFinished = true;
}
}
else
{
if (_y < _maxHeightValue)//+ _height*2)
{
_y += (_height / 4) * 3;
Rectangle _main = new Rectangle(_x, _y, _width, _height);
Rectangle _shadow = new Rectangle(_x, _y - _height, _width, _height);
Font _mainFont = new Font("Microsoft Sans Serif", _width - 6, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
Color _selectedColor = new Color();
int _currCharIndex = getIndex();
if (_currColorValue - 10 > 0 && _currColorValue + 10 < 255)
{
_selectedColor = Color.FromArgb(0,
new Random().Next(_currColorValue - 10, _currColorValue + 10), 0);
}
else
{
if (_currColorValue > 100)
{
_currColorValue = 255;
}
else
{
_currColorValue = 0;
}
}
_myGraphics.FillRectangle(Brushes.Black, _main);
_myGraphics.FillRectangle(Brushes.Black, _shadow);
_myGraphics.DrawString(_charList[_currCharIndex].ToString(), _mainFont, new SolidBrush(Color.White), _main);
_myGraphics.DrawString(_charList[_currCharIndex].ToString(), _mainFont, new SolidBrush(_selectedColor), _shadow);
}
else
{
}
if (_onSpawn)
{
if (_currColorValue < _colorValue)
{
_currColorValue += _colorStepValue;
Rectangle _main = new Rectangle(_x, _y, _width, _height);
Font _mainFont = new Font("Microsoft Sans Serif", _width - 6, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
_myGraphics.FillRectangle(Brushes.Black, _main);
_myGraphics.DrawString(_theChooserChar.ToString(), _mainFont, new SolidBrush(Color.FromArgb(0, _currColorValue, 0)), _main);
}
else
{
_onSpawn = false;
//_spawned = true;
_waitTo = true;
_currWaitValue = 0;
}
}
else
{
if (_spawned)
{
if (_waitTo)
{
if (_currWaitValue < _waitValue)
{
//Console.WriteLine("Started wait to = " + _currWaitValue + " / " + _waitValue);
_currWaitValue += 1;
}
else
{
//Console.WriteLine("Finished wait to");
_waitTo = false;
_endY = _y;
_currLocation = _startY - 100;
_isDespawing = true;
mainTimer.Interval = 1;
//_onDespawn = true;
}
}
else
{
if (_onDespawn)
{
if (!(_currColorValue - _colorStepValue < 0))
{
_currColorValue -= _colorStepValue;
/*int _xVar = _currForm.Height / _height;
int _xFunc = _xVar * _height;
for (int i = 1; i < _xFunc + 1; i += 1)
{
//System.Threading.Thread.Sleep(1);
Rectangle _despawnShadow = new Rectangle(_x, _y + 100 - _height * i, _width, _height);
Font _mainFont = new Font("Microsoft Sans Serif", _width - 6, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
int _colorDespawnValue = (_maxColorValue / i);
int _currCharIndex = getIndex();
if (!((_currColorValue - _colorDespawnValue) > 0))
{
_currColorValue = 0;
}
_myGraphics.FillRectangle(Brushes.Black, _despawnShadow);
_myGraphics.DrawString(_charList[_currCharIndex].ToString(), _mainFont, new SolidBrush(Color.FromArgb(0, _currColorValue, 0)), _despawnShadow);
}*/
}
else
{
_currColorValue = 0;
_onSpawn = false;
_spawned = false;
_waitTo = false;
_onDespawn = false;
}
}
else
{
mainTimer.Stop();
}
}
}
else
{
}
}
}
}
public void _startSpawn()
{
_startY = _y;
mainTimer.Start();
}
}