Changeset 5432 for 2014/27


Ignore:
Timestamp:
2014-07-04 11:56:06 (5 years ago)
Author:
pealrist
Message:
 
Location:
2014/27/PekkaR
Files:
3 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • 2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2d/D2x_2d.cs

    r5381 r5432  
    139139            KineticFriction = 1; 
    140140            MomentOfInertia = Double.PositiveInfinity; 
    141             Color = Color.Red; 
     141            Color = Color.YellowGreen; 
    142142            Timer.SingleShot(5.0, Destroy); 
    143143            Hit(suunta * 120); 
     
    153153    protected PhysicsObject exit; 
    154154    protected Vihollinen reaktori; 
     155    protected IntMeter pisteet; 
    155156 
    156157    private bool playeradded = false; 
     
    167168    private void LuoKuuntelijat() 
    168169    { 
    169         Keyboard.Listen(Key.A, ButtonState.Down, delegate { pelaaja.Velocity = pelaaja.Angle.GetVector() * 70; }, null); 
     170        Keyboard.Listen(Key.A, ButtonState.Down, delegate { pelaaja.Velocity = pelaaja.Angle.GetVector() * 80; }, null); 
    170171        Keyboard.Listen(Key.A, ButtonState.Released, delegate { pelaaja.Velocity = Vector.Zero; }, null); 
    171         Keyboard.Listen(Key.Z, ButtonState.Down, delegate { pelaaja.Velocity = pelaaja.Angle.GetVector() * -70; }, null); 
     172        Keyboard.Listen(Key.Z, ButtonState.Down, delegate { pelaaja.Velocity = pelaaja.Angle.GetVector() * -80; }, null); 
    172173        Keyboard.Listen(Key.Z, ButtonState.Released, delegate { pelaaja.Velocity = Vector.Zero; }, null); 
    173         Keyboard.Listen(Key.Left, ButtonState.Down, delegate { if (altpressed) pelaaja.Velocity = (pelaaja.Angle + Angle.RightAngle).GetVector() * 70; else pelaaja.Angle = pelaaja.Angle + (Angle.RightAngle / 40); }, null); 
     174        Keyboard.Listen(Key.Left, ButtonState.Down, delegate { if (altpressed) pelaaja.Velocity = (pelaaja.Angle + Angle.RightAngle).GetVector() * 80; else pelaaja.Angle = pelaaja.Angle + (Angle.RightAngle / 35 
     175            ); }, null); 
    174176        Keyboard.Listen(Key.Left, ButtonState.Released, delegate { pelaaja.Velocity = Vector.Zero; }, null); 
    175         Keyboard.Listen(Key.Right, ButtonState.Down, delegate { if (altpressed) pelaaja.Velocity = (pelaaja.Angle - Angle.RightAngle).GetVector() * 70; else pelaaja.Angle = pelaaja.Angle - (Angle.RightAngle / 40); }, null); 
     177        Keyboard.Listen(Key.Right, ButtonState.Down, delegate { if (altpressed) pelaaja.Velocity = (pelaaja.Angle - Angle.RightAngle).GetVector() * 80; else pelaaja.Angle = pelaaja.Angle - (Angle.RightAngle / 35); }, null); 
    176178        Keyboard.Listen(Key.Right, ButtonState.Released, delegate { pelaaja.Velocity = Vector.Zero; }, null); 
    177179        Keyboard.Listen(Key.LeftAlt, ButtonState.Pressed, delegate { altpressed = true; }, null); 
     
    181183        Keyboard.Listen(Key.LeftControl, ButtonState.Released, delegate { ctrlpressed = false; }, null); 
    182184 
     185        Keyboard.Listen(Key.Pause, ButtonState.Pressed, Pause, null); 
     186        Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, null); 
    183187        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Exit the game"); 
    184188    } 
     
    188192        MultiSelectWindow alkuValikko = new MultiSelectWindow("", "Start game", "Exit"); 
    189193        alkuValikko.AddItemHandler(0, AloitaPeli); 
    190         alkuValikko.AddItemHandler(1, ConfirmExit); 
     194        alkuValikko.AddItemHandler(1, Exit); 
    191195        alkuValikko.DefaultCancel = 1; 
    192196        Add(alkuValikko); 
     
    216220            ruudut.Optimize('-'); 
    217221            ruudut.Execute(40, 40); 
     222 
     223            Level.Background.Color = Color.LightGray; 
     224            pisteet = new IntMeter(0); 
     225            Label pisteNaytto = new Label(); 
     226            pisteNaytto.X = Screen.Left + 100; 
     227            pisteNaytto.Y = Screen.Bottom + 100; 
     228            pisteNaytto.TextColor = Color.Black; 
     229            pisteNaytto.Color = Color.White; 
     230            pisteNaytto.BindTo(pisteet); 
     231            Add(pisteNaytto); 
    218232        } 
    219233        catch (Exception) 
    220234        { 
    221235            MessageDisplay.Add("Level number out of range"); 
     236            Begin(); 
    222237        } 
    223238    } 
     
    225240    private void LuoVihollinen(Vector paikka, double leveys, double korkeus) 
    226241    { 
    227         Vihollinen vih = new Vihollinen(1, 10, 10, 1); 
     242        Vihollinen vih = new Vihollinen(6, 10, 10, 1); 
    228243        vih.Position = paikka; 
    229244        vih.Tag = "vihollinen"; 
    230         vih.setShield(10); 
     245        vih.setShield(20); 
    231246        Timer ajastin = new Timer(); 
    232247        ajastin.Interval = 0.8; 
     
    261276        shieldNaytto.X = Screen.Left + 100; 
    262277        shieldNaytto.Y = Screen.Top - 100; 
    263         shieldNaytto.TextColor = Color.Black; 
     278        shieldNaytto.TextColor = Color.Blue; 
    264279        shieldNaytto.Color = Color.White; 
     280        shieldNaytto.Title = "Shield"; 
    265281        shieldNaytto.BindTo(pelaaja.shield); 
    266282        Add(shieldNaytto); 
    267283 
    268284        Label eNaytto = new Label(); 
    269         eNaytto.X = Screen.Left + 200; 
     285        eNaytto.X = Screen.Left + 250; 
    270286        eNaytto.Y = Screen.Top - 100; 
    271         eNaytto.TextColor = Color.Black; 
    272         eNaytto.Color = Color.White; 
     287        eNaytto.TextColor = Color.Yellow; 
     288        eNaytto.Color = Color.Black; 
     289        eNaytto.Title = "Energy"; 
    273290        eNaytto.BindTo(pelaaja.getEnergyMeter()); 
    274291        Add(eNaytto); 
     292 
    275293        AddCollisionHandler<Pelaaja, Ammus>(pelaaja, "ammusToP", Osuma); 
    276294        Add(pelaaja); 
    277295        Camera.Follow(pelaaja); 
    278         Camera.Zoom(1.6); 
     296        Camera.Zoom(1.8); 
    279297        playeradded = true; 
    280298 
     
    313331    private void LuoReaktori(Vector paikka, double leveys, double korkeus) 
    314332    { 
    315         reaktori = new Vihollinen(5, 30, 30, 2); 
     333        reaktori = new Vihollinen(8, 30, 30, 2); 
    316334        reaktori.Position = paikka; 
    317335        reaktori.MakeStatic(); 
     
    338356        PhysicsObject et = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    339357        et.Position = paikka; 
    340         et.Color = new Color(255, 255, 255, 0); 
     358        et.Color = Color.LightGray; 
    341359        AddCollisionHandler<PhysicsObject, Pelaaja>(et, "pelaaja", delegate { ClearAll(); playeradded = false; MessageDisplay.Add("You won the game"); Begin(); }); 
    342360        Add(et); 
     
    345363    private void Osuma(Shieldable p, Ammus kohde) 
    346364    { 
     365        kohde.Destroy(); 
    347366        Explosion a = p.setShield(p.getShield() - kohde.getDeal()); 
    348367        if (a != null) 
    349368        { 
    350369            Add(a); 
     370            if(p == pelaaja) 
     371            { 
     372                ClearAll(); 
     373                playeradded = false; 
     374                MessageDisplay.Add("Game over"); 
     375                Begin(); 
     376                return; 
     377            } 
     378            else pisteet.Value += 20; 
    351379            if (p == reaktori) 
    352380            { 
     381                pisteet.Value += 10; 
     382                int time = 30; 
    353383                exit.Destroy(); 
    354                 IntMeter jaika = new IntMeter(0); 
    355                 jaika.Value = 50; 
     384                IntMeter aika = new IntMeter(time); 
    356385                Timer jak = new Timer(); 
    357                 Timer.SingleShot(50, delegate { }); 
    358386                jak.Interval = 1; 
    359                 jak.Timeout += delegate { jaika.Value--; }; 
     387                jak.Timeout += delegate { aika.Value--; if (aika.Value <= 0) { ClearAll(); MessageDisplay.Add("Game over"); playeradded = false; Begin(); } }; 
     388                jak.Start(); 
     389 
     390                Label aikaNaytto = new Label(); 
     391                aikaNaytto.TextColor = Color.Green; 
     392                aikaNaytto.X = Screen.Right - 100; 
     393                aikaNaytto.Y = Screen.Top - 100; 
     394                aikaNaytto.Title = "Time"; 
     395                aikaNaytto.BindTo(aika); 
     396                Add(aikaNaytto); 
    360397            } 
    361398        } 
    362         kohde.Destroy(); 
    363399    } 
    364400 
    365401    private void LisaaEnergiaa(PhysicsObject energ, Pelaaja kohde) 
    366402    { 
    367         kohde.AddEnergy(300); 
     403        kohde.AddEnergy(30); 
    368404        energ.Destroy(); 
    369405    } 
  • 2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2d/D2x_2d.csproj.Debug.cachefile

    r5297 r5432  
    11Content\1.xnb 
    2 Content\2.xnb 
  • 2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2d/obj/x86/Debug/ContentPipeline-{D8F805CA-FFFC-4C76-8CBF-A2C6D544F284}.xml

    r5381 r5432  
    99      <Options>None</Options> 
    1010      <Output>C:\MyTemp\PekkaR\D2x_2d\D2x_2d\D2x_2d\bin\x86\Debug\Content\1.xnb</Output> 
    11       <Time>2014-07-03T14:13:08.0639897+03:00</Time> 
    12     </Item> 
    13     <Item> 
    14       <Source>2.txt</Source> 
    15       <Name>2</Name> 
    16       <Importer>TextFileImporter</Importer> 
    17       <Processor>TextFileContentProcessor</Processor> 
    18       <Options>None</Options> 
    19       <Output>C:\MyTemp\PekkaR\D2x_2d\D2x_2d\D2x_2d\bin\x86\Debug\Content\2.xnb</Output> 
    20       <Time>2014-07-03T14:32:46.3308046+03:00</Time> 
     11      <Time>2014-07-04T09:48:43.0431975+03:00</Time> 
    2112    </Item> 
    2213    <BuildSuccessful>true</BuildSuccessful> 
  • 2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2d/obj/x86/Debug/D2x_2d.csproj.FileListAbsolute.txt

    r5297 r5432  
    88C:\MyTemp\PekkaR\D2x_2d\D2x_2d\D2x_2d\obj\x86\Debug\D2x_2d.pdb 
    99C:\MyTemp\PekkaR\D2x_2d\D2x_2d\D2x_2d\bin\x86\Debug\Content\1.xnb 
    10 C:\MyTemp\PekkaR\D2x_2d\D2x_2d\D2x_2d\bin\x86\Debug\Content\2.xnb 
  • 2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2d/obj/x86/Debug/cachefile-{D8F805CA-FFFC-4C76-8CBF-A2C6D544F284}-targetpath.txt

    r5297 r5432  
    11Content\1.xnb 
    2 Content\2.xnb 
  • 2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2dContent/1.txt

    r5381 r5432  
    1 ------- 
    2 -    V- 
    3 -     - 
    4 -P    - 
    5 ------- 
     1-------------     
     2-P         V-     
     3--------- ---     
     4        - -       
     5        - -       
     6        -V--      
     7        - V-      
     8       --  -      
     9       -V  -   ---- 
     10--------   ----- C- 
     11- V        -V  -V---- 
     12-      -----        - 
     13-              ---- - 
     14-    E         V- - ---- 
     15-         S     - -    -- 
     16-       V       - -    R- 
     17-X--------------- ------- 
     18 @ 
  • 2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2dContent/D2x_2dContent.contentproj

    r5297 r5432  
    5252    </Compile> 
    5353  </ItemGroup> 
    54   <ItemGroup> 
    55     <Compile Include="2.txt"> 
    56       <Name>2</Name> 
    57       <Importer>TextFileImporter</Importer> 
    58       <Processor>TextFileContentProcessor</Processor> 
    59     </Compile> 
    60   </ItemGroup> 
    6154  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    6255  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
Note: See TracChangeset for help on using the changeset viewer.