Changeset 6369


Ignore:
Timestamp:
2015-06-25 15:00:20 (4 years ago)
Author:
rapelton
Message:
 
Location:
2015/26/RasmusP/DungeonClasher
Files:
16 added
31 edited

Legend:

Unmodified
Added
Removed
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/DungeonClasher.cs

    r6343 r6369  
    99class mob : PhysicsObject 
    1010{ 
    11     private IntMeter elamaLaskuri = new IntMeter(25 ,0, 25); 
     11    private IntMeter elamaLaskuri = new IntMeter(25 ,0, 130); 
    1212    public IntMeter ElamaLaskuri { get { return elamaLaskuri; } } 
    1313 
     
    3030    Image taustaKuva = LoadImage("TaustaKuva"); 
    3131    Image tyrmaSeina = LoadImage("DunegonWall"); 
     32    Image ritari = LoadImage("Ritari"); 
     33 
     34    private Image[] pelaajahyokkaa = LoadImages("Ritari", "Ritarihyokkaa"); 
    3235 
    3336    PlatformCharacter pelaaja; 
    3437    PhysicsObject miekka; 
     38    Image miekkaKuva2 = LoadImage("Miekka2"); 
    3539     
    3640    
     
    7175    void SeuraavaKentta() 
    7276{ 
    73     ClearAll(); 
     77    
    7478    if (kenttaNro > 6) 
    7579    { MessageDisplay.Add("voitit pelin"); } 
    76     else { LuoKentta(); } 
     80    else { ClearAll(); LuoKentta(); } 
    7781  
    78     
     82  
     83   
     84 
     85 
    7986} 
    8087    void LuoKentta() 
     
    102109        Mouse.IsCursorVisible = true; 
    103110 
    104         Camera.ZoomToLevel(); 
     111        Camera.Follow(pelaaja); 
     112        Camera.Zoom(1.75); 
     113        Level.Background.Color = Color.Black; 
    105114    } 
    106115 
     
    132141 
    133142    seina.Position = paikka; 
    134     seina.Y = lattia.Y + lattia.Height / 2; 
    135      
    136      
    137  
     143    
     144    
    138145 
    139146} 
     
    208215    { 
    209216        PhysicsObject lattia = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    210         lattia.Position = paikka; 
     217  
    211218        lattia.Color = Color.Brown; 
    212219        lattia.Image = tiiliskivi; 
     220         
     221        lattia.Position = paikka; 
     222        lattia.Y -= 20 - lattia.Height * 0.5; 
     223 
    213224        Add(lattia); 
    214225 
    215  
     226         
    216227    } 
    217228 
     
    239250        Boss.Tag = "Enimy"; 
    240251 
     252        Boss.ElamaLaskuri.LowerLimit += delegate 
     253        { 
     254            { kenttaNro++; SeuraavaKentta(); } 
     255        }; 
     256 
    241257 
    242258        Add(Boss); 
     
    257273    void LuoPelaaja(Vector paikka, Double leveys, Double korkeus) 
    258274    { 
    259         pelaaja = new PlatformCharacter(40, 120); 
     275        pelaaja = new PlatformCharacter(64, 128); 
    260276        pelaaja.Position = paikka; 
    261277        pelaaja.Y -= 20 - pelaaja.Height * 0.5; 
    262278        //pelaaja.Elamat = 3; 
    263279        pelaaja.Color = Color.Black; 
     280        pelaaja.Image = ritari; 
    264281 
    265282        elamaLaskuri.LowerLimit += delegate { pelaaja.Destroy(); }; 
     
    267284        ProgressBar elamaPalkki = new ProgressBar(150, 20); 
    268285        elamaPalkki.X = Screen.Left + 150; 
    269         elamaPalkki.Y = Screen.Top - 20; 
     286        elamaPalkki.Y = Screen.Top - 75; 
    270287        elamaPalkki.BindTo(elamaLaskuri); 
    271288        Add(elamaPalkki); 
     
    280297        AddCollisionHandler(pelaaja, "Boss", PelaajaOsuiBossiin); 
    281298 
     299         
     300         
     301 
    282302    } 
    283303    void PelaajaOsui(PhysicsObject pelaaja, PhysicsObject kohde) 
     
    294314    void IskeMiekalla() 
    295315    { 
     316        //Image miekantoinenkuva = miekkaKuva.; 
    296317        if (!miekkaEsille) 
    297318        { 
     
    300321            miekka.X = pelaaja.X + pelaaja.Width / 2; 
    301322            miekka.Image = miekkaKuva; 
     323 
     324             
    302325            miekka.IgnoresCollisionResponse = true; 
    303326            miekka.IgnoresGravity = true; 
    304327            miekka.Y = pelaaja.Y; 
    305             Add(miekka); 
     328            Add(miekka, 2); 
    306329            Timer.SingleShot(1, delegate { miekka.Destroy(); miekkaEsille = false; }); 
    307330 
     
    310333            Timer MiekanLiikutus = new Timer(); 
    311334            MiekanLiikutus.Interval = 0.01; 
    312             MiekanLiikutus.Timeout += delegate { miekka.Position = pelaaja.Position + pelaaja.FacingDirection.GetVector() * 33; }; 
     335            MiekanLiikutus.Timeout += delegate 
     336            { 
     337                miekka.Position = pelaaja.Position + pelaaja.FacingDirection.GetVector() * 33; 
     338                if (pelaaja.FacingDirection == Direction.Left) 
     339                { 
     340                    miekka.Image = miekkaKuva2; 
     341                } 
     342                else { miekka.Image = miekkaKuva; } 
     343            }; 
    313344            MiekanLiikutus.Start(); 
    314345 
    315  
    316              
     346            pelaaja.Animation = new Animation(pelaajahyokkaa); 
     347 
     348            pelaaja.Animation.Start(); 
     349            pelaaja.Animation.FPS = 8; 
     350            Timer.SingleShot(2, delegate { pelaaja.Animation.Stop(); }); 
    317351 
    318352             
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/DungeonClasher.csproj.Debug.cachefile

    r6343 r6369  
    99Content\TaustaKuva.xnb 
    1010Content\DunegonWall.xnb 
     11Content\Miekka2.xnb 
     12Content\Ritarihyokkaa.xnb 
     13Content\Ritari.xnb 
    1114Content\kentta1.txt 
    1215Content\kentta2.txt 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/bin/x86/Debug/Content/kentta1.txt

    r6343 r6369  
    66............................................. 
    77............................................. 
     8..D....D....D....D....D....D....D....D....D.. 
    89............................................. 
    9 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
    1010..P........................=.......=.....=... 
    1111********************************************* 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/bin/x86/Debug/Content/kentta2.txt

    r6241 r6369  
    66............................................. 
    77............................................. 
    8 ............................................. 
     8..D....D....D....D....D....D....D....D....D.. 
    99............................................. 
    1010.P........=.....=......=.................=... 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/bin/x86/Debug/Content/kentta3.txt

    r6241 r6369  
    1 ............................................... 
    2 ............................................... 
    3 ............................................... 
    4 ............................................... 
    5 ............................................... 
    6 ............................................... 
    7 ............................................... 
    8 ............................................... 
    9 ............................................... 
    10 .P...=....=.....=......=.......=.........=...=. 
    11 *********************************************** 
     1............................................. 
     2............................................. 
     3............................................. 
     4............................................. 
     5............................................. 
     6............................................. 
     7............................................. 
     8..D....D....D....D....D....D....D....D....D.. 
     9............................................. 
     10P...=....=.....=......=.......=.........=...= 
     11********************************************* 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/bin/x86/Debug/Content/kentta4.txt

    r6241 r6369  
    1 ............................................... 
    2 ............................................... 
    3 ............................................... 
    4 ............................................... 
    5 ............................................... 
    6 ............................................... 
    7 ............................................... 
    8 ............................................... 
    9 ............................................... 
    10 .P...=....=.....=........................=...=. 
    11 *********************************************** 
     1............................................. 
     2............................................. 
     3............................................. 
     4............................................. 
     5............................................. 
     6............................................. 
     7............................................. 
     8..D....D....D....D....D....D....D....D....D.. 
     9............................................. 
     10.P...=....=.....=......................=...=. 
     11********************************************* 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/bin/x86/Debug/Content/kentta5.txt

    r6241 r6369  
    1 ............................................... 
    2 ............................................... 
    3 ............................................... 
    4 ............................................... 
    5 ............................................... 
    6 ............................................... 
    7 ............................................... 
    8 ............................................... 
    9 ............................................... 
    10 .P...=....=.....=........................=...=. 
    11 *********************************************** 
     1............................................. 
     2............................................. 
     3............................................. 
     4............................................. 
     5............................................. 
     6............................................. 
     7............................................. 
     8..D....D....D....D....D....D....D....D....D.. 
     9............................................. 
     10.P...=....=.....=......................=...=. 
     11********************************************* 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/bin/x86/Debug/Content/kentta6.txt

    r6260 r6369  
    1 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 
    2 kkkkkk..........kkkkkkk......kkkkkkk.......kkkk 
    3 kkk...............kkkk.........kkk..........kkk 
    4 kk..................kk..........kk...........kk 
    5 k.............................................k 
    6 k.............................................k 
    7 ............................................... 
    8 ............................................... 
    9 ............................................... 
    10 ............................................... 
    11 ............................................... 
    12 ............................................... 
    13 .P............................................B 
    14 *********************************************** 
     1 
     2............................................. 
     3............................................. 
     4..D....D....D....D....D....D....D....D....D.. 
     5............................................. 
     6.P..........................................B 
     7********************************************* 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/obj/x86/Debug/ContentPipeline-{9E8A5BF1-0124-4B72-B960-7241168C215B}.xml

    r6343 r6369  
    99      <Options>None</Options> 
    1010      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\kentta1.xnb</Output> 
    11       <Time>2015-06-25T11:21:10.4047828+03:00</Time> 
     11      <Time>2015-06-25T12:25:08.0171828+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Tiiliskivi.xnb</Output> 
    20       <Time>2015-06-24T10:00:01.4024062+03:00</Time> 
     20      <Time>2015-06-25T13:28:47.9960828+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    2727      <Options>None</Options> 
    2828      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\kentta2.xnb</Output> 
    29       <Time>2015-06-24T11:27:02.7486062+03:00</Time> 
     29      <Time>2015-06-25T13:31:13.0244828+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\kentta3.xnb</Output> 
    38       <Time>2015-06-24T11:28:55.3406062+03:00</Time> 
     38      <Time>2015-06-25T13:33:33.2288828+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4545      <Options>None</Options> 
    4646      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\kentta4.xnb</Output> 
    47       <Time>2015-06-24T11:29:40.6816062+03:00</Time> 
     47      <Time>2015-06-25T13:34:32.5456828+03:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5454      <Options>None</Options> 
    5555      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\kentta5.xnb</Output> 
    56       <Time>2015-06-24T11:29:51.9146062+03:00</Time> 
     56      <Time>2015-06-25T13:34:32.5456828+03:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6363      <Options>None</Options> 
    6464      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\kentta6.xnb</Output> 
    65       <Time>2015-06-25T09:41:00.1578828+03:00</Time> 
     65      <Time>2015-06-25T13:35:51.3752828+03:00</Time> 
    6666    </Item> 
    6767    <Item> 
     
    9191      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\DunegonWall.xnb</Output> 
    9292      <Time>2015-06-25T11:16:33.7919828+03:00</Time> 
     93    </Item> 
     94    <Item> 
     95      <Source>Miekka2.png</Source> 
     96      <Name>Miekka2</Name> 
     97      <Importer>TextureImporter</Importer> 
     98      <Processor>TextureProcessor</Processor> 
     99      <Options>None</Options> 
     100      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Miekka2.xnb</Output> 
     101      <Time>2015-06-25T13:25:21.0566828+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>Ritarihyokkaa.png</Source> 
     105      <Name>Ritarihyokkaa</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108      <Options>None</Options> 
     109      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Ritarihyokkaa.xnb</Output> 
     110      <Time>2015-06-25T14:43:48.9060828+03:00</Time> 
     111    </Item> 
     112    <Item> 
     113      <Source>Ritari.png</Source> 
     114      <Name>Ritari</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Ritari.xnb</Output> 
     119      <Time>2015-06-25T14:56:41.5952828+03:00</Time> 
    93120    </Item> 
    94121    <BuildSuccessful>true</BuildSuccessful> 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/obj/x86/Debug/DungeonClasher.csproj.FileListAbsolute.txt

    r6343 r6369  
    3333C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\TaustaKuva.xnb 
    3434C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\DunegonWall.xnb 
     35C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Miekka2.xnb 
     36C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Ritarihyokkaa.xnb 
     37C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Ritari.xnb 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/obj/x86/Debug/cachefile-{9E8A5BF1-0124-4B72-B960-7241168C215B}-targetpath.txt

    r6343 r6369  
    99Content\TaustaKuva.xnb 
    1010Content\DunegonWall.xnb 
     11Content\Miekka2.xnb 
     12Content\Ritarihyokkaa.xnb 
     13Content\Ritari.xnb 
    1114Content\kentta1.txt 
    1215Content\kentta2.txt 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasherContent/DungeonClasherContent.contentproj

    r6343 r6369  
    5454  </ItemGroup> 
    5555  <ItemGroup> 
     56    <Compile Include="Ritari.png"> 
     57      <Name>Ritari</Name> 
     58      <Importer>TextureImporter</Importer> 
     59      <Processor>TextureProcessor</Processor> 
     60    </Compile> 
    5661    <Compile Include="Tiiliskivi.png"> 
    5762      <Name>Tiiliskivi</Name> 
     
    113118    </Compile> 
    114119  </ItemGroup> 
     120  <ItemGroup> 
     121    <Compile Include="Miekka2.png"> 
     122      <Name>Miekka2</Name> 
     123      <Importer>TextureImporter</Importer> 
     124      <Processor>TextureProcessor</Processor> 
     125    </Compile> 
     126  </ItemGroup> 
     127  <ItemGroup> 
     128    <Compile Include="Ritarihyokkaa.png"> 
     129      <Name>Ritarihyokkaa</Name> 
     130      <Importer>TextureImporter</Importer> 
     131      <Processor>TextureProcessor</Processor> 
     132    </Compile> 
     133  </ItemGroup> 
    115134  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    116135  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasherContent/kentta1.txt

    r6343 r6369  
    66............................................. 
    77............................................. 
     8..D....D....D....D....D....D....D....D....D.. 
    89............................................. 
    9 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
    1010..P........................=.......=.....=... 
    1111********************************************* 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasherContent/kentta2.txt

    r6241 r6369  
    66............................................. 
    77............................................. 
    8 ............................................. 
     8..D....D....D....D....D....D....D....D....D.. 
    99............................................. 
    1010.P........=.....=......=.................=... 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasherContent/kentta3.txt

    r6241 r6369  
    1 ............................................... 
    2 ............................................... 
    3 ............................................... 
    4 ............................................... 
    5 ............................................... 
    6 ............................................... 
    7 ............................................... 
    8 ............................................... 
    9 ............................................... 
    10 .P...=....=.....=......=.......=.........=...=. 
    11 *********************************************** 
     1............................................. 
     2............................................. 
     3............................................. 
     4............................................. 
     5............................................. 
     6............................................. 
     7............................................. 
     8..D....D....D....D....D....D....D....D....D.. 
     9............................................. 
     10P...=....=.....=......=.......=.........=...= 
     11********************************************* 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasherContent/kentta4.txt

    r6241 r6369  
    1 ............................................... 
    2 ............................................... 
    3 ............................................... 
    4 ............................................... 
    5 ............................................... 
    6 ............................................... 
    7 ............................................... 
    8 ............................................... 
    9 ............................................... 
    10 .P...=....=.....=........................=...=. 
    11 *********************************************** 
     1............................................. 
     2............................................. 
     3............................................. 
     4............................................. 
     5............................................. 
     6............................................. 
     7............................................. 
     8..D....D....D....D....D....D....D....D....D.. 
     9............................................. 
     10.P...=....=.....=......................=...=. 
     11********************************************* 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasherContent/kentta5.txt

    r6241 r6369  
    1 ............................................... 
    2 ............................................... 
    3 ............................................... 
    4 ............................................... 
    5 ............................................... 
    6 ............................................... 
    7 ............................................... 
    8 ............................................... 
    9 ............................................... 
    10 .P...=....=.....=........................=...=. 
    11 *********************************************** 
     1............................................. 
     2............................................. 
     3............................................. 
     4............................................. 
     5............................................. 
     6............................................. 
     7............................................. 
     8..D....D....D....D....D....D....D....D....D.. 
     9............................................. 
     10.P...=....=.....=......................=...=. 
     11********************************************* 
  • 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasherContent/kentta6.txt

    r6260 r6369  
    1 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 
    2 kkkkkk..........kkkkkkk......kkkkkkk.......kkkk 
    3 kkk...............kkkk.........kkk..........kkk 
    4 kk..................kk..........kk...........kk 
    5 k.............................................k 
    6 k.............................................k 
    7 ............................................... 
    8 ............................................... 
    9 ............................................... 
    10 ............................................... 
    11 ............................................... 
    12 ............................................... 
    13 .P............................................B 
    14 *********************************************** 
     1 
     2............................................. 
     3............................................. 
     4..D....D....D....D....D....D....D....D....D.. 
     5............................................. 
     6.P..........................................B 
     7********************************************* 
Note: See TracChangeset for help on using the changeset viewer.