Ignore:
Timestamp:
2010-07-28 14:56:29 (13 years ago)
Author:
alsiseoi
Message:

Vihollinen on tappava ja liikkuu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2010/30/alsiseoi/WorldOfBallcraft/Peli.cs

    r1370 r1385  
    4040        Level.BackgroundColor = new Color (62, 102, 55); 
    4141 
    42         Player1 = LuoPelaaja(300, 200, 40, Color.Blue); 
     42        Player1 = LuoPelaaja(300, 100, 40, Color.Blue); 
    4343 
    44         Player2 = LuoPelaaja(300, 300, 40, Color.Red); 
     44        Player2 = LuoPelaaja(300, 200, 40, Color.Red); 
    4545         
    4646        Camera.ZoomToLevel(); 
     
    4848 
    4949        VasenReuna = Level.CreateLeftBorder(); 
    50         VasenReuna.Restitution = 1.0; 
     50        VasenReuna.Restitution = 0.0; 
    5151        VasenReuna.IsVisible = true; 
    5252 
    5353        OikeaReuna = Level.CreateRightBorder(); 
    54         OikeaReuna.Restitution = 1.0; 
     54        OikeaReuna.Restitution = 0.0; 
    5555        OikeaReuna.IsVisible = true; 
    5656 
    5757        YlaReuna = Level.CreateTopBorder(); 
    58         YlaReuna.Restitution = 1.0; 
     58        YlaReuna.Restitution = 0.0; 
    5959        YlaReuna.IsVisible = true; 
    6060 
    6161        AlaReuna = Level.CreateBottomBorder(); 
    62         AlaReuna.Restitution = 1.0; 
     62        AlaReuna.Restitution = 0.0; 
    6363        AlaReuna.IsVisible = true; 
    6464 
    65         PhysicsObject keppi = new PhysicsObject(20.0, 20.0); 
    66         keppi.Tag = "kepakko"; 
    67         Add(keppi); 
     65        PhysicsObject Vihollinen = new PhysicsObject(30.0, 20.0); 
     66        Vihollinen.Color = Color.GreenYellow; 
     67        Vihollinen.X = 100; 
     68        Vihollinen.Y = 150; 
     69        Vihollinen.Tag = "Osuma"; 
     70        Add(Vihollinen); 
    6871 
    69         Brain aivot = new Brain(); 
     72        RandomMoverBrain satunnaisAivot = new RandomMoverBrain(); 
     73        Vihollinen.Brain = satunnaisAivot; 
    7074 
    7175    } 
     
    105109        if (pelaaja == Player1) 
    106110        { 
    107             if (kohde.Tag.ToString() == "kepakko") 
    108             {  
    109                 kohde.Color = Color.Blue;  
     111            if (kohde.Tag.ToString() == "Osuma") 
     112            { 
     113                Player1.Destroy(); 
    110114            } 
    111115        } 
    112116 
     117        if (pelaaja == Player2) 
     118        { 
     119            if (kohde.Tag.ToString() == "Osuma") 
     120            { 
     121                Player2.Destroy(); 
     122            } 
     123        } 
    113124    } 
     125 
    114126} 
    115127 
Note: See TracChangeset for help on using the changeset viewer.