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

Talent toimii ja efekti työn alla.

File:
1 edited

Legend:

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

    r1395 r1411  
    99    PhysicsObject Player1; 
    1010    PhysicsObject Player2; 
    11      
     11 
     12    PhysicsObject Vihollinen; 
     13 
    1214    PhysicsObject VasenReuna; 
    1315    PhysicsObject OikeaReuna; 
     
    2123 
    2224    Image olionKuva = LoadImage("nuotio"); 
     25    Image Karistaja = LoadImage("tulitest"); 
     26    Image Talentti0 = LoadImage("Talent0"); 
    2327 
    2428    protected override void Begin() 
     
    6771        AlaReuna.IsVisible = true; 
    6872 
    69         PhysicsObject Vihollinen = new PhysicsObject(30.0, 20.0); 
     73        Vihollinen = new PhysicsObject(30.0, 20.0); 
    7074        Vihollinen.Color = Color.GreenYellow; 
    7175        Vihollinen.X = 100; 
     
    8286        nuotio.Image = olionKuva; 
    8387        Add(nuotio); 
     88 
     89        PhysicsObject tulitest = new PhysicsObject(1.0, 1.0); 
     90        tulitest.Image = Karistaja; 
     91 
    8492    } 
    8593 
     
    106114        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu"); 
    107115        Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 
     116 
     117        Keyboard.Listen(Key.NumPad0, ButtonState.Down, LuoTalentit, "Player1: Talent0", Player1 ); 
     118        //Keyboard.Listen(Key.NumPad0, ButtonState.Released, null, Player1,  
     119 
    108120    } 
    109121 
     
    135147    void LuoEfekti() 
    136148    { 
    137         int pMaxMaara = 200; 
    138         ExplosionSystem rajahdys = new ExplosionSystem(LoadImage("testi"), pMaxMaara); 
     149 
     150        Flames liekki = new Flames(Karistaja, 25, Angle.Degrees(270)); 
     151        liekki.Position = new Vector(300, -200); 
     152        Add(liekki); 
     153 
     154        int pMaxMaara = 1; 
     155        ExplosionSystem rajahdys = new ExplosionSystem(LoadImage("Talent0"), pMaxMaara); 
    139156        Add(rajahdys); 
    140157        double x = 0; 
    141158        double y = 0; 
    142         int pMaara = 10; 
    143         rajahdys.AddEffect(x, y, pMaara); 
     159        int pMaara = 1; 
     160        rajahdys.AddEffect(x, y, pMaara);  
     161    } 
    144162 
    145         Flames liekki = new Flames("tulitest", 25, Angle 90); 
    146         liekki.Position = new Vector(300, -200); 
    147         Add(liekki); 
    148  
    149  
     163    void LuoTalentit(PhysicsObject pelaaja) 
     164    { 
     165        Vector etaisyys = new Vector(pelaaja.X - Vihollinen.X, pelaaja.Y - Vihollinen.Y); 
     166        if (etaisyys.Magnitude < 100) 
     167        { 
     168            Vihollinen.Destroy(); 
     169        } 
     170         
    150171    } 
    151172} 
Note: See TracChangeset for help on using the changeset viewer.