Changeset 8430 for 2015


Ignore:
Timestamp:
2017-05-20 13:18:53 (2 years ago)
Author:
sieerinn
Message:
 
Location:
2015/koodauskerho/AarreP
Files:
3 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2015/koodauskerho/AarreP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.cs

    r8419 r8430  
    77using Jypeli.Widgets; 
    88 
     9class Pelaaja : PlatformCharacter 
     10{ 
     11    private IntMeter elamaLaskuri = new IntMeter(3, 0, 3); 
     12    public IntMeter ElamaLaskuri { get { return elamaLaskuri; } } 
     13 
     14    public Pelaaja(double leveys, double korkeus) 
     15        : base(leveys, korkeus) 
     16    { 
     17       // elamaLaskuri.LowerLimit += delegate { this.Destroy(); }; 
     18    } 
     19} 
    920public class Tasohyppelypeli1 : PhysicsGame 
    1021{ 
     
    4455        LisaaNappaimet(); 
    4556 
    46         Camera.Follow(pelaaja1); 
     57        Camera.Follow(pelaaja1, pelaaja2); 
    4758        Camera.ZoomFactor = 1.2; 
    4859        Camera.StayInLevel = true; 
     
    6475        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    6576        Level.CreateBorders(); 
    66         Level.Background.CreateGradient(Color.Red, Color.MidnightBlue); 
     77        Level.Background.CreateGradient(Color.Gray, Color.Black); 
    6778    } 
    6879 
     
    7182        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    7283        taso.Position = paikka; 
    73         taso.Color = Color.Green; 
     84        taso.Color = Color.Red; 
    7485        Add(taso); 
    7586    } 
     
    94105    } 
    95106 
    96     PlatformCharacter LisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    97     { 
    98         PlatformCharacter pelaaja1 = new PlatformCharacter(50, 70); 
     107    Pelaaja LisaaPelaaja(Vector paikka, double leveys, double korkeus) 
     108    { 
     109        Pelaaja pelaaja1 = new Pelaaja(50, 70); 
    99110        pelaaja1.Position = paikka; 
    100111        pelaaja1.Mass = 9.0; 
     
    111122        AddCollisionHandler(pelaaja1, "kuollut", TormaakuolleeseenPelaajaan); 
    112123        pelaajan1Ase = new AssaultRifle(30, 10); 
     124        pelaaja1.ElamaLaskuri.LowerLimit += delegate { Kuole(pelaaja1); }; 
    113125        return pelaaja1; 
    114126    } 
     
    170182        Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    171183        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    172         Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaajan1Ase); 
     184        Keyboard.Listen(Key.RightControl, ButtonState.Down, AmmuAseella, "Ammu", pelaajan1Ase); 
    173185 
    174186        Keyboard.Listen(Key.A, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja2, -nopeus); 
     
    209221        // tahti.Destroy(); 
    210222        // lisaapelaaja2(tahti.Position, 0, 0); 
    211         herata(tahti as PlatformCharacter); 
     223        herata(tahti as Pelaaja); 
    212224         
    213225    } 
     
    254266        // kuva.Image = KuolemaKuva; 
    255267        // Add(kuva); 
    256         Kuole(hahmo as PlatformCharacter); 
    257     } 
    258  
    259  
    260     void Kuole(PlatformCharacter hahmo) 
     268        OtaVahinkoa(hahmo as Pelaaja); 
     269    } 
     270    void OtaVahinkoa(Pelaaja hahmo) 
     271    { 
     272        hahmo.ElamaLaskuri.Value--; 
     273    } 
     274    void Kuole(Pelaaja hahmo) 
    261275    { 
    262276        hahmo.Image = KuolemaKuva; 
     
    265279    } 
    266280 
    267     void herata (PlatformCharacter hahmo) 
     281    void herata (Pelaaja hahmo) 
    268282    { 
    269283        hahmo.Image = pelaajanKuva; 
    270284        hahmo.AnimIdle = new Animation(pelaajanKuva); 
     285        hahmo.ElamaLaskuri.Value=3; 
    271286        hahmo.Tag = "pelaaja"; 
    272287    } 
  • 2015/koodauskerho/AarreP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.csproj.Debug.cachefile

    r8419 r8430  
    1818Content\pommi.xnb 
    1919Content\originalvihukavelee.xnb 
     20Content\KUOLEMA2.xnb 
     21Content\kuolema3.xnb 
    2022Content\kentta1.xnb 
    2123Content\musa.xnb 
    22 Content\KUOLEMA2.xnb 
    23 Content\kuolema3.xnb 
     24Content\aikapommi.xnb 
    2425Content\musa.wma 
  • 2015/koodauskerho/AarreP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r8419 r8430  
    99      <Options>None</Options> 
    1010      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\maali.xnb</Output> 
    11       <Time>2017-04-22T11:01:25.1907531+03:00</Time> 
     11      <Time>2017-05-20T10:20:19.6241548+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\norsu.xnb</Output> 
    20       <Time>2017-04-22T11:01:25.2375534+03:00</Time> 
     20      <Time>2017-05-20T10:20:19.6553548+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    2727      <Options>None</Options> 
    2828      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\tahti.xnb</Output> 
    29       <Time>2017-04-22T11:01:25.2375534+03:00</Time> 
     29      <Time>2017-05-20T10:20:19.6709548+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\sydansydan.xnb</Output> 
    38       <Time>2017-04-22T11:01:25.2531535+03:00</Time> 
     38      <Time>2017-05-20T10:20:19.6709548+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4545      <Options>None</Options> 
    4646      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\originalhahmo.xnb</Output> 
    47       <Time>2017-04-22T11:01:25.2687536+03:00</Time> 
     47      <Time>2017-05-20T10:20:19.7021548+03:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5454      <Options>None</Options> 
    5555      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\hahmosyosydan.xnb</Output> 
    56       <Time>2017-04-22T11:01:25.3467541+03:00</Time> 
     56      <Time>2017-05-20T10:20:19.7801548+03:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6363      <Options>None</Options> 
    6464      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\hahmosydan.xnb</Output> 
    65       <Time>2017-04-22T11:01:25.487155+03:00</Time> 
     65      <Time>2017-05-20T10:20:19.9049548+03:00</Time> 
    6666    </Item> 
    6767    <Item> 
     
    7272      <Options>None</Options> 
    7373      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\vihu.xnb</Output> 
    74       <Time>2017-04-22T11:01:25.2375534+03:00</Time> 
     74      <Time>2017-05-20T10:20:19.6709548+03:00</Time> 
    7575    </Item> 
    7676    <Item> 
     
    8181      <Options>None</Options> 
    8282      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\originalvihu.xnb</Output> 
    83       <Time>2017-04-22T11:01:25.2219533+03:00</Time> 
     83      <Time>2017-05-20T10:20:19.6397548+03:00</Time> 
    8484    </Item> 
    8585    <Item> 
     
    9090      <Options>None</Options> 
    9191      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kuolema.xnb</Output> 
    92       <Time>2017-04-22T11:01:25.2063532+03:00</Time> 
     92      <Time>2017-05-20T10:20:19.6397548+03:00</Time> 
    9393    </Item> 
    9494    <Item> 
     
    9999      <Options>None</Options> 
    100100      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\ampujahahmo.xnb</Output> 
    101       <Time>2017-04-22T11:01:25.4715549+03:00</Time> 
     101      <Time>2017-05-20T10:20:19.9049548+03:00</Time> 
    102102    </Item> 
    103103    <Item> 
     
    108108      <Options>None</Options> 
    109109      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\ammushahmo.xnb</Output> 
    110       <Time>2017-04-22T11:01:25.2063532+03:00</Time> 
     110      <Time>2017-05-20T10:20:19.6397548+03:00</Time> 
    111111    </Item> 
    112112    <Item> 
     
    117117      <Options>None</Options> 
    118118      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\ampujakukka.xnb</Output> 
    119       <Time>2017-04-22T11:01:25.2219533+03:00</Time> 
     119      <Time>2017-05-20T10:20:19.6553548+03:00</Time> 
    120120    </Item> 
    121121    <Item> 
     
    126126      <Options>None</Options> 
    127127      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\ammuttuvihu.xnb</Output> 
    128       <Time>2017-04-22T11:01:25.4559548+03:00</Time> 
     128      <Time>2017-05-20T10:20:19.8893548+03:00</Time> 
    129129    </Item> 
    130130    <Item> 
     
    135135      <Options>None</Options> 
    136136      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\rakettikukka.xnb</Output> 
    137       <Time>2017-04-22T11:01:25.4715549+03:00</Time> 
     137      <Time>2017-05-20T10:20:19.9049548+03:00</Time> 
    138138    </Item> 
    139139    <Item> 
     
    144144      <Options>None</Options> 
    145145      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\rakettihahmo.xnb</Output> 
    146       <Time>2017-04-22T11:01:25.2531535+03:00</Time> 
     146      <Time>2017-05-20T10:20:19.6865548+03:00</Time> 
    147147    </Item> 
    148148    <Item> 
     
    153153      <Options>None</Options> 
    154154      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\originalhahmokävely1.xnb</Output> 
    155       <Time>2017-04-22T11:01:25.2843537+03:00</Time> 
     155      <Time>2017-05-20T10:20:19.7177548+03:00</Time> 
    156156    </Item> 
    157157    <Item> 
     
    162162      <Options>None</Options> 
    163163      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\pommi.xnb</Output> 
    164       <Time>2017-04-22T11:01:25.2687536+03:00</Time> 
     164      <Time>2017-05-20T10:20:19.7021548+03:00</Time> 
    165165    </Item> 
    166166    <Item> 
     
    171171      <Options>None</Options> 
    172172      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\originalvihukavelee.xnb</Output> 
    173       <Time>2017-04-22T11:01:25.2063532+03:00</Time> 
     173      <Time>2017-05-20T10:20:19.6241548+03:00</Time> 
     174    </Item> 
     175    <Item> 
     176      <Source>KUOLEMA2.png</Source> 
     177      <Name>KUOLEMA2</Name> 
     178      <Importer>TextureImporter</Importer> 
     179      <Processor>TextureProcessor</Processor> 
     180      <Options>None</Options> 
     181      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\KUOLEMA2.xnb</Output> 
     182      <Time>2017-05-20T10:20:19.6865548+03:00</Time> 
     183    </Item> 
     184    <Item> 
     185      <Source>kuolema3.png</Source> 
     186      <Name>kuolema3</Name> 
     187      <Importer>TextureImporter</Importer> 
     188      <Processor>TextureProcessor</Processor> 
     189      <Options>None</Options> 
     190      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kuolema3.xnb</Output> 
     191      <Time>2017-05-20T10:20:19.6865548+03:00</Time> 
    174192    </Item> 
    175193    <Item> 
     
    180198      <Options>None</Options> 
    181199      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta1.xnb</Output> 
    182       <Time>2017-04-22T11:01:25.2219533+03:00</Time> 
     200      <Time>2017-05-20T11:36:09.7133548+03:00</Time> 
    183201    </Item> 
    184202    <Item> 
     
    190208      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\musa.xnb</Output> 
    191209      <Extra>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\musa.wma</Extra> 
    192       <Time>2017-04-22T11:01:25.2687536+03:00</Time> 
    193     </Item> 
    194     <Item> 
    195       <Source>KUOLEMA2.png</Source> 
    196       <Name>KUOLEMA2</Name> 
    197       <Importer>TextureImporter</Importer> 
    198       <Processor>TextureProcessor</Processor> 
    199       <Options>None</Options> 
    200       <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\KUOLEMA2.xnb</Output> 
    201       <Time>2017-04-22T11:08:19.3466123+03:00</Time> 
    202     </Item> 
    203     <Item> 
    204       <Source>kuolema3.png</Source> 
    205       <Name>kuolema3</Name> 
    206       <Importer>TextureImporter</Importer> 
    207       <Processor>TextureProcessor</Processor> 
    208       <Options>None</Options> 
    209       <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kuolema3.xnb</Output> 
    210       <Time>2017-04-22T11:48:36.7842153+03:00</Time> 
     210      <Time>2017-05-20T10:20:19.7021548+03:00</Time> 
     211    </Item> 
     212    <Item> 
     213      <Source>aikapommi.png</Source> 
     214      <Name>aikapommi</Name> 
     215      <Importer>TextureImporter</Importer> 
     216      <Processor>TextureProcessor</Processor> 
     217      <Options>None</Options> 
     218      <Output>C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\aikapommi.xnb</Output> 
     219      <Time>2017-05-20T12:53:44.7963548+03:00</Time> 
    211220    </Item> 
    212221    <BuildSuccessful>true</BuildSuccessful> 
     
    257266      <Assembly> 
    258267        <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 
    259         <Value>2015-09-16T19:08:26.9736388+03:00</Value> 
     268        <Value>2015-09-16T20:00:09.2376023+03:00</Value> 
    260269      </Assembly> 
    261270    </Assemblies> 
  • 2015/koodauskerho/AarreP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/Tasohyppelypeli1.csproj.FileListAbsolute.txt

    r8419 r8430  
    6060C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\KUOLEMA2.xnb 
    6161C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kuolema3.xnb 
     62C:\MyTemp\AarreP\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\aikapommi.xnb 
  • 2015/koodauskerho/AarreP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r8419 r8430  
    1818Content\pommi.xnb 
    1919Content\originalvihukavelee.xnb 
     20Content\KUOLEMA2.xnb 
     21Content\kuolema3.xnb 
    2022Content\kentta1.xnb 
    2123Content\musa.xnb 
    2224Content\musa.wma 
    23 Content\KUOLEMA2.xnb 
    24 Content\kuolema3.xnb 
     25Content\aikapommi.xnb 
  • 2015/koodauskerho/AarreP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/Tasohyppelypeli1Content.contentproj

    r8419 r8430  
    200200    </Compile> 
    201201  </ItemGroup> 
     202  <ItemGroup> 
     203    <Compile Include="aikapommi.png"> 
     204      <Name>aikapommi</Name> 
     205      <Importer>TextureImporter</Importer> 
     206      <Processor>TextureProcessor</Processor> 
     207    </Compile> 
     208  </ItemGroup> 
    202209  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    203210  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/koodauskerho/AarreP/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/kentta1.txt

    r8411 r8430  
    99# A r    N..M....................#....................................................................................# 
    1010###################........########vvvv...........................vvvv...............A................................# 
    11 ###################........##########################........##########################........########...............# 
    12 ###################........########.....................................................vvv...........................# 
    13 ###################........########vvvv.........................vvvv..................................................# 
    14 ###################........##########################........##########################........########...............# 
    15 ###################........########...................................................................................# 
    16 ###################.*..*.*.########vvvv.........................vvvv..................................................# 
    17 ###################........##########################........##########################........########...............# 
    18 ###################........########...................................................................................# 
     11##...............##........#v.....###################........##########################........########...............# 
     12##.*.............##........#......#.....................................................vvv...........................# 
     13#####............##........#....v.#vvvv.........................vvvv..................................................# 
     14##...........vv..##........#....#####################........##########################........########...............# 
     15##.........########........#......#...................................................................................# 
     16##...............##.*..*.*.#......#vvvv.........................vvvv..................................................# 
     17##...............##........#....*.###################........##########################........########...............# 
     18##........*......##........#..*...#...................................................................................# 
    1919###################........########vvvv.........................vvvv..................................................# 
    2020#............................................................##########################........########...............# 
Note: See TracChangeset for help on using the changeset viewer.