Changeset 5598 for 2014


Ignore:
Timestamp:
2014-07-23 15:03:09 (5 years ago)
Author:
sieerinn
Message:

puolivälissä

Location:
2014/30/AkseliK
Files:
23 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters.cs

    r5542 r5598  
    1212    const double hyppyNopeus = 450; 
    1313    const int RUUDUN_KOKO = 40; 
    14  
    1514    PlatformCharacter pelaaja1; 
    1615 
    1716    Image pelaajanKuva = LoadImage("thehero"); 
    1817    Image tahtiKuva = LoadImage("tahti"); 
    19  
     18    Image viholliskuva = LoadImage("vihollinen"); 
     19    Image[] vihollisKavely = LoadImages("kavely1","kavely2"); 
     20    Image[] pupukavely = LoadImages("janiskavely1","janiskavely2","janiskavely3"); 
     21    Image[] pupuseisoo = LoadImages("janiskavely3"); 
     22    Image luotikuva = LoadImage("luoti"); 
    2023    SoundEffect maaliAani = LoadSoundEffect("maali"); 
    2124 
     
    3841        kentta.SetTileMethod('*', LisaaTahti); 
    3942        kentta.SetTileMethod('N', LisaaPelaaja); 
     43        kentta.SetTileMethod('v', LisaaVihollinen); 
    4044        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4145        Level.CreateBorders(); 
     
    6064        Add(tahti); 
    6165    } 
     66    void LisaaVihollinen(Vector paikka, double leveys, double korkeus) 
     67    { 
     68        PlatformCharacter vihollinen = new PlatformCharacter(leveys, korkeus); 
     69        vihollinen.Position = paikka; 
     70        vihollinen.Image = viholliskuva; 
     71        PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
     72        vihollinen.Brain = tasoAivot; 
     73        tasoAivot.Speed = 70; 
     74        tasoAivot.JumpSpeed = 650; 
     75        tasoAivot.TriesToJump = true; 
     76        Animation kavelyanimaatio = new Animation(vihollisKavely); 
     77        kavelyanimaatio.FPS = 3; 
     78        vihollinen.AnimWalk = kavelyanimaatio; 
    6279 
     80        Add(vihollinen); 
     81    } 
    6382    void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    6483    { 
     
    6786        pelaaja1.Mass = 4.0; 
    6887        pelaaja1.Image = pelaajanKuva; 
     88        pelaaja1.AnimWalk = new Animation(pupukavely); 
     89        pelaaja1.AnimIdle = new Animation(pupuseisoo); 
     90        pelaaja1.AnimWalk.FPS = 4; 
     91        pelaaja1.Weapon = new AssaultRifle(0.1, 0.1); 
    6992        AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 
     93 
    7094        Add(pelaaja1); 
     95    } 
     96    void AmmuAseella(PlatformCharacter pelaaja) 
     97    { 
     98    PhysicsObject ammus = pelaaja.Weapon.Shoot(); 
     99 
     100    if (ammus != null) 
     101    { 
     102        ammus.Restitution = 0; 
     103        ammus.Size *= 0.3; 
     104        ammus.Image = luotikuva; 
     105        ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 
     106    } 
     107 
     108 
    71109    } 
    72110 
     
    75113        Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 
    76114        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    77  
     115        Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 
    78116        Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 
    79117        Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
     
    102140    { 
    103141        maaliAani.Play(); 
    104         MessageDisplay.Add("Keräsit tähden!"); 
     142        MessageDisplay.Add("you escaped"); 
    105143        tahti.Destroy(); 
    106144    } 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters.csproj.Debug.cachefile

    r5542 r5598  
    44Content\kentta1.xnb 
    55Content\thehero.xnb 
     6Content\vihollinen.xnb 
     7Content\kavely1.xnb 
     8Content\kavely2.xnb 
     9Content\janiskavely1.xnb 
     10Content\janiskavely2.xnb 
     11Content\janiskavely3.xnb 
     12Content\luoti.xnb 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters/obj/x86/Debug/BunniesVsHunters.csproj.FileListAbsolute.txt

    r5542 r5598  
    1212C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\obj\x86\Debug\BunniesVsHunters.pdb 
    1313C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\thehero.xnb 
     14C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\vihollinen.xnb 
     15C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\kavely1.xnb 
     16C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\kavely2.xnb 
     17C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\janiskavely1.xnb 
     18C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\janiskavely2.xnb 
     19C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\janiskavely3.xnb 
     20C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\luoti.xnb 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters/obj/x86/Debug/ContentPipeline-{B1CC40CE-BF09-4019-9684-652C700666E1}.xml

    r5542 r5598  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2014-07-22T14:55:32.1017482+03:00</Time> 
     38      <Time>2014-07-23T13:59:43.3236753+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4646      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\thehero.xnb</Output> 
    4747      <Time>2014-07-22T14:05:44.2648911+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>vihollinen.png</Source> 
     51      <Name>vihollinen</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\vihollinen.xnb</Output> 
     56      <Time>2014-07-23T10:23:20.5606056+03:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>kavely1.png</Source> 
     60      <Name>kavely1</Name> 
     61      <Importer>TextureImporter</Importer> 
     62      <Processor>TextureProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\kavely1.xnb</Output> 
     65      <Time>2014-07-23T13:06:19.4528609+03:00</Time> 
     66    </Item> 
     67    <Item> 
     68      <Source>kavely2.png</Source> 
     69      <Name>kavely2</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\kavely2.xnb</Output> 
     74      <Time>2014-07-23T12:46:52.2281501+03:00</Time> 
     75    </Item> 
     76    <Item> 
     77      <Source>janiskavely1.png</Source> 
     78      <Name>janiskavely1</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81      <Options>None</Options> 
     82      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\janiskavely1.xnb</Output> 
     83      <Time>2014-07-23T13:36:28.0136989+03:00</Time> 
     84    </Item> 
     85    <Item> 
     86      <Source>janiskavely2.png</Source> 
     87      <Name>janiskavely2</Name> 
     88      <Importer>TextureImporter</Importer> 
     89      <Processor>TextureProcessor</Processor> 
     90      <Options>None</Options> 
     91      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\janiskavely2.xnb</Output> 
     92      <Time>2014-07-23T13:36:28.0156991+03:00</Time> 
     93    </Item> 
     94    <Item> 
     95      <Source>janiskavely3.png</Source> 
     96      <Name>janiskavely3</Name> 
     97      <Importer>TextureImporter</Importer> 
     98      <Processor>TextureProcessor</Processor> 
     99      <Options>None</Options> 
     100      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\janiskavely3.xnb</Output> 
     101      <Time>2014-07-23T13:36:28.0166992+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>luoti.png</Source> 
     105      <Name>luoti</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108      <Options>None</Options> 
     109      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\luoti.xnb</Output> 
     110      <Time>2014-07-23T14:38:53.1692193+03:00</Time> 
    48111    </Item> 
    49112    <BuildSuccessful>true</BuildSuccessful> 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters/obj/x86/Debug/cachefile-{B1CC40CE-BF09-4019-9684-652C700666E1}-targetpath.txt

    r5542 r5598  
    44Content\kentta1.xnb 
    55Content\thehero.xnb 
     6Content\vihollinen.xnb 
     7Content\kavely1.xnb 
     8Content\kavely2.xnb 
     9Content\janiskavely1.xnb 
     10Content\janiskavely2.xnb 
     11Content\janiskavely3.xnb 
     12Content\luoti.xnb 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHuntersContent/BunniesVsHuntersContent.contentproj

    r5542 r5598  
    7474    </Compile> 
    7575  </ItemGroup> 
     76  <ItemGroup> 
     77    <Compile Include="vihollinen.png"> 
     78      <Name>vihollinen</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81    </Compile> 
     82  </ItemGroup> 
     83  <ItemGroup> 
     84    <Compile Include="kavely2.png"> 
     85      <Name>kavely2</Name> 
     86      <Importer>TextureImporter</Importer> 
     87      <Processor>TextureProcessor</Processor> 
     88    </Compile> 
     89  </ItemGroup> 
     90  <ItemGroup> 
     91    <Compile Include="kavely1.png"> 
     92      <Name>kavely1</Name> 
     93      <Importer>TextureImporter</Importer> 
     94      <Processor>TextureProcessor</Processor> 
     95    </Compile> 
     96  </ItemGroup> 
     97  <ItemGroup> 
     98    <Compile Include="janiskavely1.png"> 
     99      <Name>janiskavely1</Name> 
     100      <Importer>TextureImporter</Importer> 
     101      <Processor>TextureProcessor</Processor> 
     102    </Compile> 
     103    <Compile Include="janiskavely2.png"> 
     104      <Name>janiskavely2</Name> 
     105      <Importer>TextureImporter</Importer> 
     106      <Processor>TextureProcessor</Processor> 
     107    </Compile> 
     108    <Compile Include="janiskavely3.png"> 
     109      <Name>janiskavely3</Name> 
     110      <Importer>TextureImporter</Importer> 
     111      <Processor>TextureProcessor</Processor> 
     112    </Compile> 
     113  </ItemGroup> 
     114  <ItemGroup> 
     115    <Compile Include="luoti.png"> 
     116      <Name>luoti</Name> 
     117      <Importer>TextureImporter</Importer> 
     118      <Processor>TextureProcessor</Processor> 
     119    </Compile> 
     120  </ItemGroup> 
    76121  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    77122  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHuntersContent/kentta1.txt

    r5542 r5598  
    1 ................................................................................##########.................... 
    2 ...............................................................................#..........#................... 
    3 .............##..........#.......##########........#.........#................#............#...........####### 
    4 ........N...###........####.....................###........###...............................................# 
    5 ###############...############################################....############################################ 
     1................................................................................#######.................... 
     2....................................................................####.......#.......#................... 
     3.###.........##..................##########...................,,,.#......#....#.........#.............####### 
     4...V....N...###........####...v........v..........###v.....###.........v.......................v.........*..# 
     5###############..#############################################..##########################################..# 
Note: See TracChangeset for help on using the changeset viewer.