Changeset 1978 for 2011


Ignore:
Timestamp:
2011-06-13 20:24:50 (12 years ago)
Author:
mikrkana
Message:
 
Location:
2011/24/MiskaK/HaxPong/Pong/Pong
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 2011/24/MiskaK/HaxPong/Pong/Pong/Peli.cs

    r1977 r1978  
    1010{ 
    1111    PhysicsObject pallo; 
     12    PhysicsObject meteoriitti; 
     13 
    1214 
    1315    Vector nopeusYlos = new Vector(0, 200); 
     
    2527    PhysicsObject alaReuna; 
    2628 
     29    IntMeter laskuri; 
     30 
     31    Image meteoriitinKuva = LoadImage("meteoriitti1"); 
     32 
    2733 
    2834 
     
    3541        AsetaOhjaimet(); 
    3642        LisaaLaskurit(); 
     43 
     44         
     45         
    3746         
    3847         
     
    129138        Keyboard.Listen(Key.Z, ButtonState.Released, AsetaNopeus, null, maila1, Vector.Zero); 
    130139        Keyboard.Listen(Key.Space, ButtonState.Down, Haxaa, null); 
    131         Keyboard.Listen(Key.LeftAlt, ButtonState.Pressed, Haxaa2, null); 
     140        Keyboard.Listen(Key.LeftAlt, ButtonState.Down, Haxaa2, null); 
     141         
    132142        Keyboard.Listen(Key.X, ButtonState.Pressed, Haxaa3, null); 
    133          
     143 
     144        Keyboard.Listen(Key.S, ButtonState.Pressed, Haxaa4, null); 
    134145 
    135146        Keyboard.Listen(Key.Up, ButtonState.Down, AsetaNopeus, "Pelaaja 2: Liikuta mailaa ylös", maila2, nopeusYlos); 
     
    162173    void Haxaa() 
    163174    { 
    164         Vector impulssi = new Vector(10.0, 0.0); 
     175        Vector impulssi = new Vector(20.0, 0.0); 
    165176        pallo.Hit(impulssi); 
    166177    } 
     
    168179    void Haxaa2() 
    169180    { 
     181 
     182        Explosion räjähdys = new Explosion(500); 
     183        räjähdys.Position = maila2.Position; 
     184 
     185        Add(räjähdys); 
     186         
    170187        maila2.Destroy(); 
    171188 
    172     } 
     189         
     190 
     191         
     192 
     193 
     194    } 
     195 
     196    
    173197 
    174198    void Haxaa3() 
     
    178202    } 
    179203 
     204    void Haxaa4() 
     205    { 
     206 
     207         
     208         
     209            meteoriitti = new PhysicsObject(50.0, 50.0); 
     210            meteoriitti.Shape = Shape.Circle; 
     211            meteoriitti.X = 0.0; 
     212            meteoriitti.Y = 0.0; 
     213            Vector impulssi = new Vector(RandomGen.NextDouble(500.0, -500.0), RandomGen.NextDouble(500.0, -500.0)); 
     214            meteoriitti.Hit(impulssi); 
     215            meteoriitti.MaximumLifetime = TimeSpan.FromSeconds(10.0); 
     216            meteoriitti.Restitution = 2.0; 
     217             
     218            Add(meteoriitti); 
     219         
     220    } 
     221     
    180222     
    181223 
     
    194236        pallo.Restitution = 1.2; 
    195237        Gravity = new Vector(0.0, 0.0); 
    196         alaReuna.IgnoresCollisionResponse = false; 
     238         
    197239         
    198240         
     
    233275    IntMeter LuoPisteLaskuri( double x, double y ) 
    234276    { 
    235         IntMeter laskuri = new IntMeter(0); 
     277        laskuri = new IntMeter(0); 
    236278        laskuri.MaxValue = 10; 
    237279        Label naytto = new Label(); 
     
    244286        Add(naytto); 
    245287        laskuri.UpperLimit += PeliLoppui; 
     288         
    246289        return laskuri; 
    247290 
     
    260303    void Loppu() 
    261304    { 
    262  
     305        MessageDisplay.Add("Game Over!"); 
    263306    } 
    264307 
  • 2011/24/MiskaK/HaxPong/Pong/Pong/Pong.csproj

    r1964 r1978  
    118118    <Content Include="Game.ico" /> 
    119119    <Content Include="GameThumbnail.png" /> 
     120    <Content Include="meteoriitti1.png" /> 
    120121  </ItemGroup> 
    121122  <ItemGroup> 
Note: See TracChangeset for help on using the changeset viewer.