Changeset 7214 for 2016


Ignore:
Timestamp:
2016-06-09 13:06:11 (7 years ago)
Author:
sieerinn
Message:

Kaikenlaista pientä säätöä ja siistimistä

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Punasininen.cs

    r7213 r7214  
    1313    private const double JUMPSPEED = 1250; 
    1414    private const int TILE_SIZE = 60; 
    15     private const int MATCH_LENGTH = 30; 
     15    private const int MATCH_LENGTH = 3; 
    1616 
    1717    private Player blue; 
     
    9595        }; 
    9696 
    97         Func<double, double, Color, Label> createLabel; 
    98         createLabel = (double x, double y, Color color) => 
     97        Func<double, double, Color, Label> createLabel = (double x, double y, Color color) => 
    9998        { 
    10099            var label = new Label(); 
     
    176175    } 
    177176 
    178     void Restore(Player temp) 
    179     { 
    180         temp.Position = temp.Spawn; 
     177    void Restore(Player player) 
     178    { 
     179        player.Position = player.Spawn; 
    181180    } 
    182181 
     
    203202    } 
    204203 
    205     void Win(Player player) 
     204    void Win(Player winner) 
    206205    { 
    207206        Pause(); 
     
    209208        // Haluaisin tehdä tähän jonkinlaisen hauskan ponnahdusefektin jossain vaiheessa. Sellaisen napakan zoomin ja sitten boing. Hurdur. 
    210209         
     210        string victoryText = "Kiva homma hei"; 
     211 
    211212        // Tekstille musta tausta, jotta sen näkee lukea. 
    212         Label announcementDark = new Label("Kiva homma hei") 
    213         { 
    214             Font = largeFont,  // Vaihtoehtona smallFont myös 
    215             TextColor = Color.Black 
    216         }; 
     213        var announcementDark = new Label(victoryText) { Font = largeFont, TextColor = Color.Black }; 
    217214        Add(announcementDark); 
    218215 
    219216        // Voittoteksti. 
    220         Label announcement = new Label("Kiva homma hei") 
    221         { 
    222             Font = largeFont,  // Vaihtoehtona smallFont myös 
    223             TextColor = player.Color 
    224         }; 
     217        var announcement = new Label(victoryText) { Font = largeFont, TextColor = winner.Color }; 
    225218        Add(announcement); 
    226219 
    227  
     220        // Zoomaa voittajaan. 
    228221        double targetZoomFactor = 1.5; 
    229222        var zoomTimer = new Timer(); 
     
    231224        zoomTimer.Timeout += () => 
    232225        { 
    233             var targetPos = player.Position; 
    234             Camera.Position += (targetPos - Camera.Position) * 0.02; 
     226            Camera.Position += (winner.Position - Camera.Position) * 0.02; 
    235227            Camera.ZoomFactor += (targetZoomFactor - Camera.ZoomFactor) * 0.01; 
    236             announcement.Position = Camera.WorldToScreen(player.Position + new Vector(0, 80)); 
     228            announcement.Position = Camera.WorldToScreen(winner.Position + new Vector(0, 80)); 
    237229            announcementDark.Position = announcement.Position + new Vector(5, -5); 
    238230        }; 
    239231        zoomTimer.IgnorePause = true; 
    240232        zoomTimer.Start(); 
    241  
    242  
    243233    } 
    244234 
     
    269259        ControllerTwo.ListenAnalog(AnalogControl.LeftStick, 0.1, Move, "Liikuta pelaajaa", blue); 
    270260        ControllerTwo.Listen(Button.A, ButtonState.Pressed, Jump, "Pelaaja hyppää", blue, JUMPSPEED); 
    271         ControllerTwo.ListenAnalog(AnalogControl.RightStick, 0.1, Aim, null, blue); 
     261        ControllerTwo.ListenAnalog(AnalogControl.RightStick, 0.1, Aim, "Tähtää", blue); 
    272262        ControllerTwo.ListenAnalog(AnalogControl.RightTrigger, 0.1, Shoot, "", blue); 
    273263        ControllerTwo.ListenAnalog(AnalogControl.LeftTrigger, 0.1, Shoot, "", blue); 
Note: See TracChangeset for help on using the changeset viewer.