Changeset 2517 for 2011/26


Ignore:
Timestamp:
2011-08-02 21:53:17 (12 years ago)
Author:
osmavanh
Message:
 
Location:
2011/26/OssiV
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • 2011/26/OssiV/dall of dude 2d.cs

    r2452 r2517  
    1717    const int RUUDUN_KOKO = 40; 
    1818    IntMeter pisteLaskuri; 
    19  
     19    IntMeter ammusLaskuri; 
    2020    PlatformCharacter pelaaja1; 
    2121    PlatformCharacter pelaaja2; 
     
    3232    Image maalinkuva = LoadImage("maali2"); 
    3333    Image kaupankuva = LoadImage("kauppa"); 
     34    Image bossinkuva = LoadImage("bossi"); 
     35 
     36 
    3437 
    3538    List<Pahis> pahikset; 
     
    4043    { 
    4144 
    42         // Gravity = new Vector(0, -1000); 
     45 
    4346        Valikko(); 
    4447        if (DataStorage.Exists("pisteet.xml")) 
     
    6164        kentta['H'] = lisaaMaali; 
    6265        kentta['K'] = luoKauppa; 
    63  
     66        kentta['B'] = luoBossi; 
    6467 
    6568        kentta.Insert(RUUDUN_KOKO, RUUDUN_KOKO); 
     
    230233    } 
    231234 
    232     IntMeter LuoPisteLaskuri(double x, double y) 
    233     { 
    234         IntMeter laskuri = new IntMeter(0); 
    235         laskuri.MaxValue = 10; 
    236         Label naytto = new Label(); 
    237         naytto.BindTo(laskuri); 
    238         naytto.X = x; 
    239         naytto.Y = y; 
    240         naytto.TextColor = Color.White; 
    241         naytto.BorderColor = Level.BackgroundColor; 
    242         naytto.Color = Level.BackgroundColor; 
    243         Add(naytto); 
    244         return laskuri; 
    245     } 
     235 
    246236 
    247237    PhysicsObject lisaaHaivePalikka() 
     
    358348    { 
    359349        pisteLaskuri = new IntMeter(0); 
    360        
     350 
    361351        Label pisteNaytto = new Label(); 
    362352        pisteNaytto.X = Screen.Left + 100; 
     
    422412    void naytaPisteet() 
    423413    { 
     414 
    424415        HighScoreWindow topIkkuna = new HighScoreWindow("Dall of Dude 2D", 
    425416                     "Parhaat pisteet", 
     
    428419        topIkkuna.Closed += TallennaPisteet; 
    429420        Add(topIkkuna); 
    430  
    431421    } 
    432422    void TallennaPisteet(Window sender) 
     
    512502        pelaaja2.Weapon = new LaserGun(60, 20); 
    513503        pelaaja2.Weapon.ProjectileCollision += AmmusOsui; 
    514         
     504 
    515505 
    516506    } 
     
    621611            Keyboard.Listen(Key.D2, ButtonState.Pressed, vaihdaPlasmaCannoniin, "plasmatykki"); 
    622612            Keyboard.Listen(Key.D1, ButtonState.Pressed, vaihdaRynkkyyn, "rynnäkkökivääri"); 
    623             //Keyboard.Listen(Key.D7, ButtonState.Pressed, vaihdaLaserPyssyyn, null); 
    624         } 
    625     } 
    626         void lisaaPisteita() 
    627         { 
    628             pisteLaskuri.Value = pisteLaskuri.Value += 1000000; 
    629         } 
    630     } 
    631  
    632  
    633  
    634  
    635  
    636  
    637  
    638  
    639  
    640  
    641  
    642  
    643  
    644  
    645  
    646     public class Pahis : PhysicsObject 
    647     { 
    648         public int Elamat { get; set; } 
    649  
    650         public Pahis(double width, double height) 
    651             : base(width, height) 
    652         { 
    653  
    654         } 
    655  
    656  
    657     } 
    658  
    659  
    660  
    661  
    662  
    663  
     613            Keyboard.Listen(Key.D7, ButtonState.Pressed, vaihdaLaserPyssyyn, null); 
     614        } 
     615    } 
     616    void lisaaPisteita() 
     617    { 
     618        pisteLaskuri.Value = pisteLaskuri.Value += 1000000; 
     619    } 
     620    PhysicsObject luoBossi() 
     621    { 
     622        Pahis bossi = new Pahis(50, 50); 
     623 
     624        bossi.Shape = Shape.FromImage(bossinkuva); 
     625        bossi.Elamat = 30; 
     626        bossi.Mass = 100; 
     627        bossi.Restitution = 1.0; 
     628        bossi.Image = bossinkuva; 
     629        bossi.CanRotate = true; 
     630        Add(bossi); 
     631        return bossi; 
     632    } 
     633 
     634 
     635 
     636    } 
     637 
     638 
     639 
     640public class Pahis : PhysicsObject 
     641{ 
     642    public int Elamat { get; set; } 
     643 
     644    public Pahis(double width, double height) 
     645        : base(width, height) 
     646    { 
     647 
     648    } 
     649 
     650 
     651} 
     652 
     653 
     654 
     655 
     656 
     657 
     658 
     659 
     660 
     661 
     662 
     663 
     664 
     665 
     666 
     667 
     668 
     669 
     670 
     671 
     672 
     673 
Note: See TracChangeset for help on using the changeset viewer.