Changeset 6212 for 2015/26


Ignore:
Timestamp:
2015-06-23 21:28:35 (4 years ago)
Author:
empaheik
Message:

Halpoja savuja.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs

    r6211 r6212  
    3535    } 
    3636 
    37     public HillBilly(double leveys, double korkeus, HillbillyRun game) 
     37 
     38 
     39    public HillBilly(double leveys, double korkeus) 
    3840        : base(leveys, korkeus) 
    3941    { 
     
    244246        flame.Animation.Start(); 
    245247        Add(flame); 
     248 
     249        Smoke savu = new Smoke(); 
     250        savu.Position = flame.Position; 
     251        Add(savu); 
    246252    } 
    247253 
     
    259265        milk.Image = milkImage; 
    260266        milk.Position = position; 
     267        milk.Tag = "milk"; 
    261268        Add(milk); 
    262269    } 
     
    336343    void CreatePlayer(Vector position, double width, double height) 
    337344    { 
    338         HillBilly player = new HillBilly(width, height * 2, this); 
     345        HillBilly player = new HillBilly(width, height * 2); 
    339346        player.Shape = Shape.Rectangle; 
    340347        player.Position = position + new Vector(0, height * 0.5); 
     
    347354            HillBilly billy = p as HillBilly; 
    348355            billy.Life.Value--; 
     356 
    349357        } 
    350358        ); 
    351359 
    352         player.Life.LowerLimit += delegate { players.Remove(player); player.Destroy(); }; 
     360        player.Life.LowerLimit += delegate  
     361        {  
     362            players.Remove(player); player.Destroy(); 
     363            if (players.Count < 1) 
     364            { 
     365                Loss(); 
     366            } 
     367        }; 
    353368    } 
    354369 
     
    380395    } 
    381396 
    382     void CreateGround(Vector position, double width, double height) //TODO: Fiksataan se, että pelihahmot tietysti luiskahtavat tästä läpi, mikäli pääsevät sen sivustaan. Muitakin korjaustapoja tietty on, kuin tässä aliohjelmassa operoiminen. 
    383     { 
    384         GameObject ground = new GameObject(width, height); 
     397    void CreateGround(Vector position, double width, double height)  
     398    { 
     399        PhysicsObject ground = PhysicsObject.CreateStaticObject(width, height); 
    385400        ground.Image = groundTopImages[levelNumber]; 
    386401        ground.Position = position; 
     
    402417        Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Show help"); 
    403418        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Exit game"); 
     419    } 
     420 
     421    void Loss() 
     422    { 
     423        //TODO: Sumthin' flashy for our fallen friends. 
     424        Exit(); 
    404425    } 
    405426 
Note: See TracChangeset for help on using the changeset viewer.