Changeset 5643 for 2014


Ignore:
Timestamp:
2014-07-24 15:00:49 (5 years ago)
Author:
jotapoti
Message:
 
Location:
2014/30/AkseliK
Files:
13 added
14 edited

Legend:

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

    r5598 r5643  
    99public class BunniesVsHunters : PhysicsGame 
    1010{ 
     11    DoubleMeter elamalaskuri; 
     12    Image taustakuva = LoadImage("puu"); 
    1113    const double nopeus = 100; 
    1214    const double hyppyNopeus = 450; 
    1315    const int RUUDUN_KOKO = 40; 
    1416    PlatformCharacter pelaaja1; 
     17     
    1518 
    1619    Image pelaajanKuva = LoadImage("thehero"); 
     
    2124    Image[] pupuseisoo = LoadImages("janiskavely3"); 
    2225    Image luotikuva = LoadImage("luoti"); 
     26    Image plokkikuva = LoadImage("plokki"); 
    2327    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     28    SoundEffect kuolemisAani = LoadSoundEffect("kuolo"); 
    2429 
    2530    public override void Begin() 
     
    2934        LuoKentta(); 
    3035        LisaaNappaimet(); 
     36        LuoElamaLaskuri(); 
    3137 
    3238        Camera.Follow(pelaaja1); 
     
    4450        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4551        Level.CreateBorders(); 
    46         Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
     52         
     53        //Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
     54        Level.Background.Image = taustakuva; 
     55        Level.Background.FitToLevel(); 
     56        Level.Background.TextureWrapSize = new Vector(10, 1); 
     57        //Level.Background.ScaleToLevelFull(); 
     58        //Level.Background.TextureFillsShape = true; 
     59        //Level.Background.TileToLevel(); 
    4760    } 
    4861 
     
    5164        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    5265        taso.Position = paikka; 
    53         taso.Color = Color.Green; 
     66        taso.Image = plokkikuva; 
    5467        Add(taso); 
    5568    } 
     
    6679    void LisaaVihollinen(Vector paikka, double leveys, double korkeus) 
    6780    { 
    68         PlatformCharacter vihollinen = new PlatformCharacter(leveys, korkeus); 
     81        Vihollishahmo vihollinen = new Vihollishahmo (leveys, korkeus, 3, kuolemisAani); 
    6982        vihollinen.Position = paikka; 
    7083        vihollinen.Image = viholliskuva; 
     
    7689        Animation kavelyanimaatio = new Animation(vihollisKavely); 
    7790        kavelyanimaatio.FPS = 3; 
     91        vihollinen.Tag = "vihollinen"; 
    7892        vihollinen.AnimWalk = kavelyanimaatio; 
     93 
    7994 
    8095        Add(vihollinen); 
     
    90105        pelaaja1.AnimWalk.FPS = 4; 
    91106        pelaaja1.Weapon = new AssaultRifle(0.1, 0.1); 
     107        pelaaja1.Weapon.FireRate = 1.5; 
     108        pelaaja1.Weapon.Power.DefaultValue = 200; 
     109        pelaaja1.Weapon.AmmoIgnoresGravity = false; 
     110        pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 
    92111        AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 
     112        if( 
    93113 
    94114        Add(pelaaja1); 
     
    97117    { 
    98118    PhysicsObject ammus = pelaaja.Weapon.Shoot(); 
    99  
    100119    if (ammus != null) 
    101120    { 
     
    106125    } 
    107126 
     127    } 
     128    void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
     129    { 
     130        ammus.Destroy(); 
     131 
     132        if (kohde.Tag == "vihollinen") 
     133        { 
     134            (kohde as Vihollishahmo).ElamaLaskuri.Value--; 
     135        } 
    108136 
    109137    } 
     
    142170        MessageDisplay.Add("you escaped"); 
    143171        tahti.Destroy(); 
     172 
    144173    } 
     174    void LuoElamaLaskuri() 
     175    { 
     176        elamalaskuri = new DoubleMeter(10); 
     177        elamalaskuri.MaxValue = 10; 
     178        elamalaskuri.LowerLimit += ElamaLoppui; 
     179 
     180        ProgressBar elamaPalkki = new ProgressBar(150, 20); 
     181        elamaPalkki.X = Screen.Left + 150; 
     182        elamaPalkki.Y = Screen.Top - 20; 
     183        elamaPalkki.BindTo(elamalaskuri); 
     184        Add(elamaPalkki); 
     185    } 
     186 
     187    void ElamaLoppui() 
     188    { 
     189        MessageDisplay.Add("u are now lunch"); 
     190    } 
     191 
    145192} 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters.csproj

    r5542 r5643  
    114114    <Compile Include="BunniesVsHunters.cs" /> 
    115115    <Compile Include="Properties\AssemblyInfo.cs" /> 
     116    <Compile Include="Vihollishahmo.cs" /> 
    116117  </ItemGroup> 
    117118  <ItemGroup> 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters.csproj.Debug.cachefile

    r5598 r5643  
    1111Content\janiskavely3.xnb 
    1212Content\luoti.xnb 
     13Content\puu.xnb 
     14Content\kuolo.xnb 
     15Content\bloodydeath.xnb 
     16Content\plokki.xnb 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters/obj/x86/Debug/BunniesVsHunters.csproj.FileListAbsolute.txt

    r5598 r5643  
    1919C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\janiskavely3.xnb 
    2020C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\luoti.xnb 
     21C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\puu.xnb 
     22C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\kuolo.xnb 
     23C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\bloodydeath.xnb 
     24C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\plokki.xnb 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters/obj/x86/Debug/ContentPipeline-{B1CC40CE-BF09-4019-9684-652C700666E1}.xml

    r5598 r5643  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2014-07-23T13:59:43.3236753+03:00</Time> 
     38      <Time>2014-07-24T14:48:02.8428651+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    110110      <Time>2014-07-23T14:38:53.1692193+03:00</Time> 
    111111    </Item> 
     112    <Item> 
     113      <Source>puu.png</Source> 
     114      <Name>puu</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\puu.xnb</Output> 
     119      <Time>2014-07-24T10:33:42.4916215+03:00</Time> 
     120    </Item> 
     121    <Item> 
     122      <Source>kuolo.wav</Source> 
     123      <Name>kuolo</Name> 
     124      <Importer>WavImporter</Importer> 
     125      <Processor>SoundEffectProcessor</Processor> 
     126      <Options>None</Options> 
     127      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\kuolo.xnb</Output> 
     128      <Time>2014-07-24T12:53:02.5457561+03:00</Time> 
     129    </Item> 
     130    <Item> 
     131      <Source>bloodydeath.png</Source> 
     132      <Name>bloodydeath</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135      <Options>None</Options> 
     136      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\bloodydeath.xnb</Output> 
     137      <Time>2014-07-24T13:15:38.8535216+03:00</Time> 
     138    </Item> 
     139    <Item> 
     140      <Source>plokki.png</Source> 
     141      <Name>plokki</Name> 
     142      <Importer>TextureImporter</Importer> 
     143      <Processor>TextureProcessor</Processor> 
     144      <Options>None</Options> 
     145      <Output>C:\MyTemp\AkseliK\BunniesVsHunters\BunniesVsHunters\BunniesVsHunters\bin\x86\Debug\Content\plokki.xnb</Output> 
     146      <Time>2014-07-24T14:44:53.9699797+03:00</Time> 
     147    </Item> 
    112148    <BuildSuccessful>true</BuildSuccessful> 
    113149    <Settings> 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHunters/obj/x86/Debug/cachefile-{B1CC40CE-BF09-4019-9684-652C700666E1}-targetpath.txt

    r5598 r5643  
    1111Content\janiskavely3.xnb 
    1212Content\luoti.xnb 
     13Content\puu.xnb 
     14Content\kuolo.xnb 
     15Content\bloodydeath.xnb 
     16Content\plokki.xnb 
  • 2014/30/AkseliK/BunniesVsHunters/BunniesVsHunters/BunniesVsHuntersContent/BunniesVsHuntersContent.contentproj

    r5598 r5643  
    119119    </Compile> 
    120120  </ItemGroup> 
     121  <ItemGroup> 
     122    <Compile Include="puu.png"> 
     123      <Name>puu</Name> 
     124      <Importer>TextureImporter</Importer> 
     125      <Processor>TextureProcessor</Processor> 
     126    </Compile> 
     127  </ItemGroup> 
     128  <ItemGroup> 
     129    <Compile Include="kuolo.wav"> 
     130      <Name>kuolo</Name> 
     131      <Importer>WavImporter</Importer> 
     132      <Processor>SoundEffectProcessor</Processor> 
     133    </Compile> 
     134  </ItemGroup> 
     135  <ItemGroup> 
     136    <Compile Include="bloodydeath.png"> 
     137      <Name>bloodydeath</Name> 
     138      <Importer>TextureImporter</Importer> 
     139      <Processor>TextureProcessor</Processor> 
     140    </Compile> 
     141  </ItemGroup> 
     142  <ItemGroup> 
     143    <Compile Include="plokki.png"> 
     144      <Name>plokki</Name> 
     145      <Importer>TextureImporter</Importer> 
     146      <Processor>TextureProcessor</Processor> 
     147    </Compile> 
     148  </ItemGroup> 
    121149  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    122150  <!--  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

    r5598 r5643  
    11................................................................................#######.................... 
    22....................................................................####.......#.......#................... 
    3 .###.........##..................##########...................,,,.#......#....#.........#.............####### 
    4 ...V....N...###........####...v........v..........###v.....###.........v.......................v.........*..# 
    5 ###############..#############################################..##########################################..# 
     3.............##..................##########...................,,,.#......#....#.........#.............####### 
     4...V.....N..###........####...v........v..........###v.....###.........v.......................v............# 
     5###############..#############################################..##########################################*.# 
Note: See TracChangeset for help on using the changeset viewer.