Changeset 1224 for 2010/27


Ignore:
Timestamp:
2010-07-09 12:50:24 (13 years ago)
Author:
paaaanro
Message:

valmiimpi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2010/27/viaawipi/samsh cubes/Peli.cs

    r1215 r1224  
    66 
    77 
     8/// <summary> 
     9/// tehnyt ville piesala 
     10/// </summary> 
    811class Tasohyppely : PhysicsGame 
    9 { 
     12{   // 
    1013    const int rulev = 50; 
    1114    const int rukor = 50; 
     
    2831    { 
    2932 
    30  
    31         isku1 = new IntMeter(0); 
    32         isku2 = new IntMeter(0); 
    33  
    3433        // Zoomataan lähemmäksi 
    3534 
     
    5251        // Asetetaan painovoima 
    5352        Gravity = new Vector(0, -1000); 
     53 
     54        LuoLas1(); 
     55        LuoLas2(); 
    5456 
    5557        luoKentta(); 
     
    7678        Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
    7779        Level.Background.Image = LoadImage("aa"); 
     80         
    7881 
    7982 
     
    9093    PhysicsObject Luotaso() 
    9194    { 
    92         PhysicsObject taso = PhysicsObject.CreateStaticObject(50.0, 50.0); 
     95        PhysicsObject taso = PhysicsObject.CreateStaticObject(50.0, 50.0,Shapes.Rectangle,CollisionShapeQuality.Best); 
    9396        taso.Image = LoadImage("seina"); 
    9497        return taso; 
     
    102105        pelaaja1.X = 100; 
    103106        pelaaja1.Y = 120; 
     107        pelaaja1.CanRotate = true; 
    104108 
    105109        pelaaja2 = new PlatformCharacter(40, 40); 
     
    108112        pelaaja2.X = -100; 
    109113        pelaaja2.Y = 120; 
     114        pelaaja2.CanRotate = true; 
     115         
    110116 
    111117        AddCollisionHandler(pelaaja1, kasitteletormays); 
     
    172178        if (aba.Magnitude<75) 
    173179        { 
    174             isku1.Value +=RandomGen.NextInt(1,10); 
     180            isku1.Value +=RandomGen.NextInt(5,10); 
    175181            pelaaja2.Hit(new Vector(aba.X * isku1, aba.Y * isku1)); 
    176182            PlaySound("plzbmfire"); 
     
    184190        if (aba.Magnitude < 75) 
    185191        { 
    186             isku2.Value += RandomGen.NextInt(1, 10); 
     192            isku2.Value += RandomGen.NextInt(5, 10); 
    187193            pelaaja1.Hit(new Vector(aba.X * isku2, aba.Y * isku2)); 
    188194            PlaySound("icebfire"); 
     
    196202 
    197203 
    198             Grenade kranaatti = new Grenade(RandomGen.NextDouble(0.5,4)); 
     204            Grenade kranaatti = new Grenade(RandomGen.NextDouble(0.5,10)); 
    199205            kranaatti.X = RandomGen.NextDouble(Level.Left, Level.Right); 
    200206            kranaatti.Y = Level.Top - 10; 
     
    203209            kranaatti.ExplosionRadius = 50; 
    204210            kranaatti.ExplosionSpeed = 100; 
     211            kranaatti.Image = LoadImage("norsu"); 
    205212 
    206213            Add(kranaatti); 
     
    212219    } 
    213220 
     221    void LuoLas2() 
     222    { 
     223        isku1 = new IntMeter(0); 
     224 
     225        Label pisteNaytto = new Label(); 
     226        pisteNaytto.X = Screen.Left + 100; 
     227        pisteNaytto.Y = Screen.Top - 100; 
     228        pisteNaytto.TextColor = Color.Cyan; 
     229 
     230        pisteNaytto .BindTo(isku1); 
     231        Add(pisteNaytto); 
     232    } 
     233    void LuoLas1() 
     234    { 
     235        isku2 = new IntMeter(0); 
     236 
     237        Label pisteNaytto = new Label(); 
     238        pisteNaytto.X = Screen.Right - 100; 
     239        pisteNaytto.Y = Screen.Top - 100; 
     240        pisteNaytto.TextColor = Color.Red; 
     241 
     242        pisteNaytto.BindTo(isku2); 
     243        Add(pisteNaytto); 
     244    } 
     245 
    214246    
    215247 
Note: See TracChangeset for help on using the changeset viewer.