Changeset 7295 for 2016


Ignore:
Timestamp:
2016-06-14 14:56:25 (7 years ago)
Author:
eemjohla
Message:
 
Location:
2016/24/EemeliL
Files:
65 added
7 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/EemeliL/Pong/Pong.cs

    r7265 r7295  
    4040        pallo = new PhysicsObject(40.0, 40.0); 
    4141        pallo.Shape = Shape.Circle; 
     42        pallo.Color = RandomGen.NextColor(); 
    4243        pallo.X = -200.0; 
    4344        pallo.Y = 0.0; 
     
    8586    { 
    8687        PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 
    87         maila.Shape = Shape.Rectangle; 
     88        maila.Shape = Shape.Hexagon; 
    8889        maila.X = X; 
    8990        maila.Y = Y; 
    9091        maila.Restitution = 1.0; 
     92        maila.Color = RandomGen.NextColor(); 
    9193        Add(maila); 
    9294        return maila; 
     
    109111        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    110112 
    111         Keyboard.Listen(Key.Space, ButtonState.Pressed, NopeutaPalloa, "Nopeuta pallon liikettä"); 
    112 } 
     113        Keyboard.Listen(Key.Right, ButtonState.Pressed, NopeutaPalloa, "Nopeuta pallon liikettä"); 
     114        Keyboard.Listen(Key.W, ButtonState.Pressed, NopeutaPalloa, "Nopeuta pallon liikettä"); 
     115 
     116        Keyboard.Listen(Key.Left, ButtonState.Pressed, HidastaPalloa, "Hidasta pallon liikettä"); 
     117        Keyboard.Listen(Key.Q, ButtonState.Pressed, HidastaPalloa, "Hidasta pallon liikettä"); 
     118 
     119        Keyboard.Listen(Key.Space, ButtonState.Pressed, AloitaAlusta, "Aloita peli alusta"); 
     120    } 
    113121 
    114122    void AsetaNopeus(PhysicsObject maila, Vector nopeus) 
     
    178186        pallo.Velocity /= 2; 
    179187    } 
     188        void AloitaAlusta() 
     189    { 
     190        pelaajan1Pisteet.Value = 0; 
     191        pelaajan2Pisteet.Value = 0; 
     192      
     193       } 
    180194 
    181195} 
    182196 
    183      
     197 
  • 2016/24/EemeliL/Pong/Pong/Pong/Pong.csproj

    r7267 r7295  
    114114    <Compile Include="Level\backround\colour.cs" /> 
    115115    <Compile Include="Ohjelma.cs" /> 
    116     <Compile Include="Pong.cs" /> 
     116    <Compile Include="..\..\Pong.cs"> 
     117      <Link>Pong.cs</Link> 
     118    </Compile> 
    117119    <Compile Include="Properties\AssemblyInfo.cs" /> 
    118120  </ItemGroup> 
Note: See TracChangeset for help on using the changeset viewer.