Changeset 7167


Ignore:
Timestamp:
2016-05-14 14:39:27 (7 years ago)
Author:
empaheik
Message:
 
Location:
2015/koodauskerho/OttoR
Files:
10 added
2 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • 2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArena/BattleArena.cs

    r7153 r7167  
    1414 
    1515    PlatformCharacter pelaaja1; 
     16 
    1617    int pelaaja1hahmo = 0; 
    1718 
    1819    int vahinko = 0; 
    1920 
     21 
     22    private Image[] Flight = LoadImages("monsters/consumer", "monsters/consumer2", "monsters/consumer3"); 
     23 
     24 
    2025    DoubleMeter elamaLaskuri; 
    2126 
     27     
    2228    Image ShadowKuva = LoadImage("monsters/shadow"); 
    2329    Image DirtKuva = LoadImage("blocks/dirt"); 
     
    3238    Image GrassKuva = LoadImage("blocks/grass"); 
    3339    Image tahti1Kuva = LoadImage("blocks/boomBox"); 
    34     Image CrabKuva = LoadImage("monsters/crab"); 
     40    Image ConsumerKuva = LoadImage("monsters/consumer"); 
    3541    Image FuelKuva = LoadImage("blocks/fuel1"); 
    36  
     42     
    3743    class monster : PlatformCharacter 
    3844    { 
     
    6773        SmoothTextures = false; 
    6874    } 
    69      
     75 
    7076    
    7177    void LuoAlkuvalikko() 
     
    146152        kentta.SetTileMethod('T', LisaaTaintedGrass); 
    147153        kentta.SetTileMethod('S', LisaaShadow); 
    148         kentta.SetTileMethod('C', LisaaCrab); 
     154        kentta.SetTileMethod('C', LisaaConsumer); 
    149155        kentta.SetTileMethod('d', LisaaFuel); 
    150156 
     
    251257    void LisaaShadow(Vector paikka, double leveys, double korkeus) 
    252258    { 
    253         monster Shadow = new monster(leveys, korkeus); 
     259        UusiaShadoveja(paikka, new Vector(leveys, korkeus)); 
     260 
     261        Timer ajastin = new Timer(); 
     262        ajastin.Interval = RandomGen.NextDouble(3, 10); 
     263        ajastin.Start(); 
     264        ajastin.Timeout += delegate 
     265        { 
     266            UusiaShadoveja(paikka, new Vector(leveys,korkeus));             
     267        }; 
     268 
     269 
     270    } 
     271    void UusiaShadoveja(Vector paikka, Vector koko) 
     272    { 
     273        monster Shadow = new monster(koko.X,koko.Y); 
    254274        Shadow.Image = ShadowKuva; 
    255275        Shadow.Position = paikka; 
     
    257277        Shadow.Tag = "Shadow"; 
    258278        Shadow.CanMoveOnAir = true; 
    259          
     279 
    260280        PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
    261281        tasoAivot.Speed = 150; 
     
    267287        Shadow.Brain = tasoAivot; 
    268288        Add(Shadow); 
    269  
    270          
    271  
    272  
    273     } 
    274     void UusiaShadoveja() 
    275     { 
    276          
    277     } 
    278     void LisaaCrab(Vector paikka, double leveys, double korkeus) 
    279     { 
    280         monster1 Crab = new monster1(19, 15); 
    281         Crab.Image = CrabKuva; 
    282         Crab.Position = paikka; 
    283         Crab.Mass = 10.0; 
    284         Crab.Tag = "monster1"; 
    285         Crab.CanMoveOnAir = true; 
    286  
    287         PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
    288         tasoAivot.Speed = 100; 
    289  
    290         Crab.Brain = tasoAivot; 
    291  
    292         Add(Crab); 
     289    } 
     290    void LisaaConsumer(Vector paikka, double leveys, double korkeus) 
     291    { 
     292        PhysicsObject Consumer = new  PhysicsObject(leveys, korkeus); 
     293        Consumer.Image = ConsumerKuva; 
     294        Consumer.Position = paikka; 
     295        Consumer.Mass = 1.0; 
     296        Consumer.Tag = "monster1"; 
     297        AddCollisionHandler(Consumer, "ammus", delegate(PhysicsObject a, PhysicsObject b) { Consumer.Destroy(); }); 
     298        Consumer.IgnoresPhysicsLogics = true; 
     299        Consumer.IgnoresCollisionResponse = true; 
     300        FollowerBrain seuraajanaivot= new FollowerBrain(pelaaja1); 
     301        seuraajanaivot.Speed = 150; 
     302        Consumer.Brain = seuraajanaivot; 
     303        Consumer.Animation = new Animation(Flight); 
     304        Consumer.Animation.Start(); 
     305        Add(Consumer); 
    293306 
    294307         
     
    458471            ammus.Size *= 0.3; 
    459472            ammus.Width *= 2.0; 
    460             ammus.Image = LoadImage("ammusKuva");  
     473            ammus.Image = LoadImage("ammusKuva"); 
     474            ammus.Tag = "ammus"; 
    461475            ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 
    462476        } 
  • 2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArena/BattleArena.csproj.Debug.cachefile

    r7153 r7167  
    3030Content\blocks\taintedgrass.xnb 
    3131Content\blocks\dirt.xnb 
    32 Content\monsters\crab.xnb 
    3332Content\monsters\shadow.xnb 
    3433Content\blocks\fuel1.xnb 
    3534Content\blocks\Freak.xnb 
    3635Content\music\freak it.xnb 
     36Content\monsters\consumer.xnb 
     37Content\monsters\consumer2.xnb 
     38Content\monsters\consumer3.xnb 
    3739Content\music\taustamusiikki.wma 
    3840Content\music\boombox.wma 
  • 2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArena/obj/x86/Debug/BattleArena.csproj.FileListAbsolute.txt

    r7153 r7167  
    4141C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\blocks\taintedgrass.xnb 
    4242C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\blocks\dirt.xnb 
    43 C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\monsters\crab.xnb 
    4443C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\monsters\shadow.xnb 
    4544C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\blocks\fuel1.xnb 
     
    4746C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\music\freak it.xnb 
    4847C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\music\freak it.wma 
     48C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\monsters\consumer.xnb 
     49C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\monsters\consumer2.xnb 
     50C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\monsters\consumer3.xnb 
  • 2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArena/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r7153 r7167  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2016-04-16T12:51:33.1175299+03:00</Time> 
     38      <Time>2016-05-14T12:49:08.8095314+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    285285    </Item> 
    286286    <Item> 
    287       <Source>monsters\crab.png</Source> 
    288       <Name>monsters\crab</Name> 
    289       <Importer>TextureImporter</Importer> 
    290       <Processor>TextureProcessor</Processor> 
    291       <Options>None</Options> 
    292       <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\monsters\crab.xnb</Output> 
    293       <Time>2016-03-12T12:56:37.6249254+02:00</Time> 
    294     </Item> 
    295     <Item> 
    296287      <Source>monsters\shadow.png</Source> 
    297288      <Name>monsters\shadow</Name> 
     
    329320      <Extra>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\music\freak it.wma</Extra> 
    330321      <Time>2016-04-16T10:11:38.5558553+03:00</Time> 
     322    </Item> 
     323    <Item> 
     324      <Source>monsters\consumer.png</Source> 
     325      <Name>monsters\consumer</Name> 
     326      <Importer>TextureImporter</Importer> 
     327      <Processor>TextureProcessor</Processor> 
     328      <Options>None</Options> 
     329      <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\monsters\consumer.xnb</Output> 
     330      <Time>2016-05-14T11:34:28.8123314+03:00</Time> 
     331    </Item> 
     332    <Item> 
     333      <Source>monsters\consumer2.png</Source> 
     334      <Name>monsters\consumer2</Name> 
     335      <Importer>TextureImporter</Importer> 
     336      <Processor>TextureProcessor</Processor> 
     337      <Options>None</Options> 
     338      <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\monsters\consumer2.xnb</Output> 
     339      <Time>2016-05-14T13:00:36.3181314+03:00</Time> 
     340    </Item> 
     341    <Item> 
     342      <Source>monsters\consumer3.png</Source> 
     343      <Name>monsters\consumer3</Name> 
     344      <Importer>TextureImporter</Importer> 
     345      <Processor>TextureProcessor</Processor> 
     346      <Options>None</Options> 
     347      <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\monsters\consumer3.xnb</Output> 
     348      <Time>2016-05-14T13:00:42.3749314+03:00</Time> 
    331349    </Item> 
    332350    <BuildSuccessful>true</BuildSuccessful> 
  • 2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArena/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r7153 r7167  
    3333Content\blocks\taintedgrass.xnb 
    3434Content\blocks\dirt.xnb 
    35 Content\monsters\crab.xnb 
    3635Content\monsters\shadow.xnb 
    3736Content\blocks\fuel1.xnb 
     
    3938Content\music\freak it.xnb 
    4039Content\music\freak it.wma 
     40Content\monsters\consumer.xnb 
     41Content\monsters\consumer2.xnb 
     42Content\monsters\consumer3.xnb 
  • 2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArenaContent/BattleArenaContent.contentproj

    r7153 r7167  
    259259  </ItemGroup> 
    260260  <ItemGroup> 
    261     <Compile Include="monsters\crab.png"> 
    262       <Name>crab</Name> 
    263       <Importer>TextureImporter</Importer> 
    264       <Processor>TextureProcessor</Processor> 
    265     </Compile> 
    266   </ItemGroup> 
    267   <ItemGroup> 
    268261    <Compile Include="monsters\shadow.png"> 
    269262      <Name>shadow</Name> 
     
    291284      <Importer>Mp3Importer</Importer> 
    292285      <Processor>SongProcessor</Processor> 
     286    </Compile> 
     287  </ItemGroup> 
     288  <ItemGroup> 
     289    <Compile Include="monsters\consumer.png"> 
     290      <Name>consumer</Name> 
     291      <Importer>TextureImporter</Importer> 
     292      <Processor>TextureProcessor</Processor> 
     293    </Compile> 
     294  </ItemGroup> 
     295  <ItemGroup> 
     296    <Compile Include="monsters\consumer2.png"> 
     297      <Name>consumer2</Name> 
     298      <Importer>TextureImporter</Importer> 
     299      <Processor>TextureProcessor</Processor> 
     300    </Compile> 
     301  </ItemGroup> 
     302  <ItemGroup> 
     303    <Compile Include="monsters\consumer3.png"> 
     304      <Name>consumer3</Name> 
     305      <Importer>TextureImporter</Importer> 
     306      <Processor>TextureProcessor</Processor> 
    293307    </Compile> 
    294308  </ItemGroup> 
  • 2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArenaContent/kentta1.txt

    r7153 r7167  
    22#          
    33# 
    4 #        S       S S 
    5 #       ##  ##   ####                                                            s           s 
    6 #* 
    7 #####  S   S    S        
    8 #      ##  ##  ##       S  
     4#                     
     5#       ##  ##   ####                                                                        
     6#*                                      C           C        C         C           C 
     7#####                    
     8#      ##  ##  ##          
    99#X                    #### 
    10 ###                      
    11 #      #######          S        
     10###        S       C       
     11#      #######                   
    1212#B            ##       ###     
    13 ##    #           ###                                    S    d     S  S  S   
    14 #   #####   ##  #######      #              S  d  TTTTTTTTTTTTTTTTTTTTTT d     S   d 
     13##    #           ###                                         d        
     14#   #####   ##  #######      #                 d  TTTTTTTTTTTTTTTTTTTTTT d        d 
    1515#f                           ##          TTTTTTTTDDDDDDDDDDDDDDDDDDDDDDTTTTTTTTTTTTTTT  d  d S 
    16 ##       #     N             ###  S   TTTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDTTTTTTTTTTTT 
     16##       #     N             ###   C  TTTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDTTTTTTTTTTTT 
    1717GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGTTTTTTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 
Note: See TracChangeset for help on using the changeset viewer.