Ignore:
Timestamp:
2017-08-04 10:44:15 (23 months ago)
Author:
mianhayr
Message:

ihan nätti mutta käyttää vähän RandomGenii?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2017/30/MikkoH/Sq/Sq/Sq/Sq.cs

    r9416 r9418  
    1010    public override void Begin() 
    1111    { 
    12         Window.Height = 800; Window.Width = 800; 
     12        Window.Height = 800; Window.Width = 1200; 
    1313        Mouse.IsCursorVisible = true; Level.Background.Color = Color.Black; 
    1414 
    1515        sqs.Add(new Square(new Vector(0,0), 1, 400, 10, glrev, new Vector(-30, 30))); 
    16         sqs.Add(new Square(new Vector(0, 0), 1, 400, 10, glrev, new Vector(-30, -30))); 
    17         sqs.Add(new Square(new Vector(0, 0), 1, 400, 10, glrev, new Vector(30, -30))); 
    18         sqs.Add(new Square(new Vector(0, 0), 1, 400, 10, glrev, new Vector(30, 30))); 
    1916    }       
    2017 
     
    2724                (sqs[i].maxmag)*(glmax-glmin)) * Math.Sign(sqs[i].magc);    // and reduces current magnitude 
    2825 
    29             int d = (int)(1 + sqs[i].mag / (sqs[i].maxmag - sqs[i].minmag) * 254); 
     26            int d = (int)(1 + sqs[i].mag / (sqs[i].maxmag+glmax - sqs[i].minmag) * 254); 
    3027            c.BrushColor = new Color(d, 100, 0); // scales color change from magnitude change, TODO: something interesting 
    3128 
     
    3835                if (sqs[i].n == 0) { sqs.Remove(sqs[i]); continue; } // number of pts reached 
    3936                sqs[i].magc = -sqs[i].magc; // reverse squeeze 
    40                 sqs.Add(new Square(sqs[i].pos+sqs[i].off, sqs[i].minmag, sqs[i].maxmag * 0.9, sqs[i].n - 1, glrev = !glrev, sqs[i].off)); 
    41                 sqs.Add(new Square(sqs[i].pos + sqs[i].off, sqs[i].minmag, sqs[i].maxmag / 4, 0, glrev = !glrev, sqs[i].off/2)); 
     37                for (int k = 0; k < 2; k++) 
     38                    sqs.Add(new Square(RandomGen.NextVector(Level.Left, Level.Bottom, Level.Right, Level.Top), 
     39                                       sqs[i].minmag, sqs[i].maxmag/1.5, sqs[i].n - 1, glrev = !glrev, sqs[i].off)); 
    4240                sqs.Remove(sqs[i]); 
    4341            } else if (sqs[i].mag > sqs[i].maxmag) sqs[i].magc = -sqs[i].magc; // reverse squeeze 
Note: See TracChangeset for help on using the changeset viewer.