Changeset 5006


Ignore:
Timestamp:
2014-06-13 10:32:37 (5 years ago)
Author:
anlakane
Message:
 
Location:
2014/24/JuhoJ
Files:
12 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoe/ShotgunJoe.cs

    r4976 r5006  
    2020    bool onKuolematon = false; 
    2121 
    22  
     22    int kenttanumero = 1; 
    2323    PlatformCharacter pelaaja1; 
    2424    PlasmaCannon pelaajan1Ase; 
     
    4141    Image laatikkokuva = LoadImage("laatikko"); 
    4242    SoundEffect haulikkoaani = LoadSoundEffect("haulikkoaani"); 
     43    Image kivikuva = LoadImage("kivi"); 
    4344    public override void Begin() 
    4445    { 
    4546        SmoothTextures = false; 
     47        SeuraavaKentta(); 
    4648        Gravity = new Vector(0, -1000); 
    47  
    48         LuoKentta(); 
     49         
    4950        LisaaNappaimet(); 
    5051        LuoElamaLaskuri(); 
     
    7071    } 
    7172 
    72     void LuoKentta() 
    73     { 
    74         TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
     73    void SeuraavaKentta() 
     74    { 
     75        ClearAll(); 
     76 
     77        if (kenttanumero == 1) 
     78        { 
     79            LuoKentta("kentta1"); 
     80        } 
     81        else if (kenttanumero == 2) 
     82        { 
     83            LuoKentta("kentta2"); 
     84        } 
     85 
     86    } 
     87 
     88   void LisaaMaali(Vector paikka, double leveys, double korkeus) 
     89    { 
     90       PhysicsObject maali = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     91       maali.Position = paikka; 
     92       maali.Tag = "maali"; 
     93       Add(maali); 
     94    } 
     95 
     96   void TormasiMaaliin(PhysicsObject pelaaja1, PhysicsObject maali) 
     97   { 
     98       kenttanumero++; 
     99       SeuraavaKentta(); 
     100   } 
     101 
     102    void LuoKentta(string pelimaailma) 
     103    { 
     104        TileMap kentta = TileMap.FromLevelAsset(pelimaailma); 
    75105        kentta.SetTileMethod('#', LisaaMulta); 
    76106        kentta.SetTileMethod('*', LisaaTahti); 
     
    81111        kentta.SetTileMethod('N', LisaaNakymaton); 
    82112        kentta.SetTileMethod('T', LisaaTynnyri); 
     113        kentta.SetTileMethod('B', LisaaKivi); 
     114        kentta.SetTileMethod('M',LisaaMaali); 
    83115        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    84116        Level.CreateBorders(); 
    85117        Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
    86118    } 
     119 
     120    void LisaaKivi(Vector paikka, double leveys, double korkeus) 
     121    { 
     122        LisaaPalikka(paikka, leveys, korkeus, "kivi", kivikuva, 0); 
     123    } 
     124 
     125 
    87126 
    88127    void LisaaMulta(Vector paikka, double leveys, double korkeus) 
     
    126165        AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 
    127166        AddCollisionHandler(pelaaja1, "piikki", TormaaPiikkiin); 
     167        AddCollisionHandler(pelaaja1, "maali", TormasiMaaliin); 
    128168         
    129169        AddCollisionHandler(pelaaja1, "vihu", TormaaVihuun); 
     
    198238            kohde.Destroy(); 
    199239        } 
     240        if (kohde.Tag =="laatikko") 
     241       { 
     242         ((Laatikko)kohde).spawnausajstin.Stop(); 
     243         ((Laatikko)kohde).VahennaEnergiaa(1); 
     244              
     245      } 
    200246        ammus.Destroy(); 
    201247    } 
     
    209255    { 
    210256        PhysicsObject ammus = pelaaja.Weapon.Shoot(); 
    211  
     257         
    212258        if (ammus != null) 
    213259        { 
     
    229275        Add(vihu); 
    230276        FollowerBrain seuraajanAivot = new FollowerBrain(pelaaja1); 
     277        
    231278        vihu.CollisionIgnoreGroup = 2; 
    232279        vihu.Brain = seuraajanAivot; 
     
    255302    } 
    256303 
    257     void ElamaLoppui() 
     304   public void ElamaLoppui() 
    258305    { 
    259306        MessageDisplay.Add("Huudat elämäsi puolesta kun sisälmyksesi valuvat maahan!"); 
  • 2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoe/ShotgunJoe.csproj.Debug.cachefile

    r4976 r5006  
    1414Content\haulikkoaani.xnb 
    1515Content\haulikko.xnb 
     16Content\kivi.xnb 
     17Content\kentta2.xnb 
  • 2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoe/obj/x86/Debug/ContentPipeline-{CF60888C-4746-4871-9D32-E8426663FBA0}.xml

    r4976 r5006  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2014-06-12T11:52:41.5080413+03:00</Time> 
     38      <Time>2014-06-13T10:31:46.789299+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    136136      <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\haulikko.xnb</Output> 
    137137      <Time>2014-06-11T12:21:36.8419572+03:00</Time> 
     138    </Item> 
     139    <Item> 
     140      <Source>kivi.png</Source> 
     141      <Name>kivi</Name> 
     142      <Importer>TextureImporter</Importer> 
     143      <Processor>TextureProcessor</Processor> 
     144      <Options>None</Options> 
     145      <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\kivi.xnb</Output> 
     146      <Time>2014-06-13T09:14:34.3941058+03:00</Time> 
     147    </Item> 
     148    <Item> 
     149      <Source>kentta2.txt</Source> 
     150      <Name>kentta2</Name> 
     151      <Importer>TextFileImporter</Importer> 
     152      <Processor>TextFileContentProcessor</Processor> 
     153      <Options>None</Options> 
     154      <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\kentta2.xnb</Output> 
     155      <Time>2014-06-13T10:07:01.0427392+03:00</Time> 
    138156    </Item> 
    139157    <BuildSuccessful>true</BuildSuccessful> 
  • 2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoe/obj/x86/Debug/ShotgunJoe.csproj.FileListAbsolute.txt

    r4976 r5006  
    2222C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\laatikko.xnb 
    2323C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\haulikkoaani.xnb 
     24C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\kivi.xnb 
     25C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\kentta2.xnb 
  • 2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoe/obj/x86/Debug/cachefile-{CF60888C-4746-4871-9D32-E8426663FBA0}-targetpath.txt

    r4976 r5006  
    1414Content\haulikkoaani.xnb 
    1515Content\haulikko.xnb 
     16Content\kivi.xnb 
     17Content\kentta2.xnb 
  • 2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoeContent/ShotgunJoeContent.contentproj

    r4976 r5006  
    4646  </ItemGroup> 
    4747  <ItemGroup> 
     48    <Compile Include="kentta1.txt"> 
     49      <Name>kentta1</Name> 
     50      <Importer>TextFileImporter</Importer> 
     51      <Processor>TextFileContentProcessor</Processor> 
     52    </Compile> 
    4853    <Compile Include="maali.wav"> 
    4954      <Name>maali</Name> 
     
    6065      <Importer>TextureImporter</Importer> 
    6166      <Processor>TextureProcessor</Processor> 
    62     </Compile> 
    63     <Compile Include="kentta1.txt"> 
    64       <Name>kentta1</Name> 
    65       <Importer>TextFileImporter</Importer> 
    66       <Processor>TextFileContentProcessor</Processor> 
    6767    </Compile> 
    6868  </ItemGroup> 
     
    144144    </Compile> 
    145145  </ItemGroup> 
     146  <ItemGroup> 
     147    <Compile Include="kivi.png"> 
     148      <Name>kivi</Name> 
     149      <Importer>TextureImporter</Importer> 
     150      <Processor>TextureProcessor</Processor> 
     151    </Compile> 
     152  </ItemGroup> 
     153  <ItemGroup> 
     154    <Compile Include="kentta2.txt"> 
     155      <Name>kentta2</Name> 
     156      <Importer>TextFileImporter</Importer> 
     157      <Processor>TextFileContentProcessor</Processor> 
     158    </Compile> 
     159  </ItemGroup> 
    146160  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    147161  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoeContent/kentta1.txt

    r4972 r5006  
    44.......................RRR....NNN................................................................................................................ 
    55...................R........................................................................RRRRRRRRRRRRRRR..........RRRRR....................... 
    6 ...........RRRR.......................................................................RRRRR..................RRRRRR...........R.................. 
     6...........RRRR......................................................T................RRRRR..................RRRRRR...........R.................. 
    77.J....T.V............................................... RRRRRRRRRRRRRRRRRRRRRRRRRRR............................................................. 
    88RRRRRRRRRRRRRRRRRRRRRRRR................................ ###########################...............................................N............. 
    9 ########################................................ ###########################.....................................................RRR..... 
     9########################..............T................. ###########################.....................................................RRR..... 
    1010########################............RRRRRRRR............ ###########################............................................................. 
    1111########################......RR..R............RRRR......###########################............................................................. 
     
    1515##################################################...... ##############.............................RRRRRRR...RRRRR...............RRRRR...PP##### 
    1616##################################################...... ############################...........RRRRR######PP..........#......#..#####....####### 
    17 ##################################################.......................................N...RRR#############PPPPPPPPPPPPPP#PPPPP#####PPPPPPPPPPP 
     17##################################################......T................................N...RRR#############PPPPPPPPPPPPPP#PPPPP#####PPPPPPPPPPP 
    1818##################################################P####################################PPPP###################################################### 
Note: See TracChangeset for help on using the changeset viewer.