Changeset 5860 for 2015/23


Ignore:
Timestamp:
2015-06-03 09:43:38 (4 years ago)
Author:
jotapoti
Message:

Aliohjelmalle voi viedä parametreja. Luodaan pitkulaisia ellipsejä ja yksi iso punainen pallo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2015/23/JouniP/HienoPallopeli/HienoPallopeli/HienoPallopeli/HienoPallopeli.cs

    r5857 r5860  
    1515        for (int i = 0; i < 40; i++) 
    1616        { 
    17             LisaaPallo(); 
     17            LisaaPallo(50.0, 120.0, RandomGen.NextColor()); 
    1818        } 
     19        LisaaPallo(200.0, 200.0, Color.Red); 
    1920 
    2021        Camera.ZoomToAllObjects(); 
     
    2223    } 
    2324 
    24     public void LisaaPallo() 
     25    public void LisaaPallo(double leveys, double korkeus, Color haluttuVari) 
    2526    { 
    26         PhysicsObject pallo = new PhysicsObject(50, 50); 
     27        PhysicsObject pallo = new PhysicsObject(leveys, korkeus); 
    2728        pallo.Shape = Shape.Circle; 
    2829        pallo.Position = RandomGen.NextVector(Level.Left, Level.Bottom, Level.Right, Level.Top); 
    29         pallo.Color = RandomGen.NextColor(); 
     30        pallo.Color = haluttuVari; 
    3031        pallo.Tag = "ympyra"; 
    3132        pallo.Restitution = 1.0; 
Note: See TracChangeset for help on using the changeset viewer.