Changeset 6979 for 2015/30/EliasHy


Ignore:
Timestamp:
2015-07-23 14:31:00 (8 years ago)
Author:
elhytone
Message:
 
Location:
2015/30/EliasHy/SpaceAdventure/SpaceAdventure
Files:
3 added
1 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/SpaceAdventure.cs

    r6976 r6979  
    2222 
    2323    IntMeter pistelaskuri; 
     24    IntMeter voittoLaskuri = new IntMeter(0, 0, 0); 
    2425    DoubleMeter elamaLaskuri; 
    2526 
     
    6263        Keyboard.Listen(Key.R, ButtonState.Pressed, AloitaPeli, "Aloita peli alusta"); 
    6364        LuoPistelaskuri(); 
     65 
     66        LuoVoittoLaskuri(); 
     67         
     68 
     69    } 
     70    void LuoVoittoLaskuri() 
     71    { 
     72 
     73        Label voittonautto = new Label(); 
     74        voittonautto.X = Screen.Right - 130; 
     75        voittonautto.Y = Screen.Top - 100; 
     76        voittonautto.TextColor = Color.Black; 
     77        voittonautto.Color = Color.White; 
     78        voittonautto.Title = "Tapot"; 
     79        voittonautto.BindTo(voittoLaskuri); 
     80        Add(voittonautto); 
     81 
     82        voittoLaskuri.UpperLimit += Voitto; 
     83 
     84     
     85    } 
     86 
     87    void Voitto() 
     88    { 
     89        MessageDisplay.Add("Voitit Pelin!"); 
     90        //TODO: Voitto!  
    6491    } 
    6592 
     
    89116    { 
    90117        //1. Luetaan kuva uuteen ColorTileMappiin, kuvan nimen perässä ei .png-päätettä. 
    91         ColorTileMap ruudut = ColorTileMap.FromLevelAsset("cool tausta"); 
     118        ColorTileMap ruudut = ColorTileMap.FromLevelAsset("cool tausta new"); 
    92119 
    93120        //2. Kerrotaan mitä aliohjelmaa kutsutaan, kun tietyn värinen pikseli tulee vastaan kuvatiedostossa. 
     
    143170        AddCollisionHandler(pelaaja, "bossi", delegate(PhysicsObject A, PhysicsObject B) 
    144171        { 
     172            PelaajaVahingoittuu(A, B, 2); 
     173        }); 
     174         
     175        AddCollisionHandler(pelaaja, "vihuammus", delegate(PhysicsObject A, PhysicsObject B) 
     176        { 
     177            PelaajaVahingoittuu(A, B, 2); 
     178        }); 
     179 
     180        AddCollisionHandler(pelaaja, "bossinammus", delegate(PhysicsObject A, PhysicsObject B) 
     181        { 
    145182            PelaajaVahingoittuu(A, B, 4); 
    146183        }); 
    147          
     184 
    148185        elamaLaskuri = new DoubleMeter(10); 
    149         elamaLaskuri.MaxValue = 10; 
     186        elamaLaskuri.MaxValue = 15; 
    150187        elamaLaskuri.LowerLimit += ElamaLoppui; 
    151188 
     
    175212 
    176213 
     214        voittoLaskuri.MaxValue++; 
     215 
    177216 
    178217    } 
     
    192231        Bossi.Brain = seuraajanAivot; 
    193232 
     233        Timer Ampuminen = new Timer(); 
     234        Ampuminen.Interval = 1.0;   //Kuinka usein bossi ampuu 
     235        Ampuminen.Timeout += delegate 
     236        { 
     237            if (pelaaja != null) 
     238            { 
     239                Vector suunta = pelaaja.Position - Bossi.Position; 
     240 
     241                if (suunta.Magnitude < 500) 
     242                { 
     243                    suunta = suunta.Normalize(); 
     244                    PhysicsObject vihunAmmus = new PhysicsObject(Laser); 
     245                    vihunAmmus.Position = Bossi.Position + suunta * 30; 
     246                    vihunAmmus.IgnoresCollisionResponse = true; 
     247                    vihunAmmus.Size *= 0.1; 
     248                    vihunAmmus.Angle = suunta.Angle; 
     249                    Add(vihunAmmus); 
     250                    vihunAmmus.Hit(suunta * 2000); 
     251                    vihunAmmus.Tag = "bossinammus"; 
     252                } 
     253            } 
     254        }; 
     255        Ampuminen.Start(); 
     256        Bossi.Removed += delegate { Ampuminen.Stop(); }; 
     257         
     258        voittoLaskuri.MaxValue++; 
    194259    } 
    195260 
     
    229294        Vihollinen2.Brain = satunnaisAivot; 
    230295 
     296        Timer Ampuminen = new Timer(); 
     297        Ampuminen.Interval = 3.5; 
     298        Ampuminen.Timeout += delegate  
     299        { 
     300            if (pelaaja != null) 
     301            { 
     302                Vector suunta = pelaaja.Position - Vihollinen2.Position; 
     303 
     304                if (suunta.Magnitude < 500) 
     305                { 
     306                    suunta = suunta.Normalize(); 
     307                    PhysicsObject vihunAmmus = new PhysicsObject(Laser); 
     308                    vihunAmmus.Position = Vihollinen2.Position + suunta * 30; 
     309                    vihunAmmus.IgnoresCollisionResponse = true; 
     310                    vihunAmmus.Size *= 0.1; 
     311                    vihunAmmus.Angle = suunta.Angle; 
     312                    Add(vihunAmmus); 
     313                    vihunAmmus.Hit(suunta * 2000); 
     314                    vihunAmmus.Tag = "vihuammus"; 
     315                } 
     316            } 
     317        }; 
     318        Ampuminen.Start(); 
     319        Vihollinen2.Removed += delegate { Ampuminen.Stop(); }; 
     320 
     321        voittoLaskuri.MaxValue++; 
    231322    } 
    232323 
     
    243334            //rajahdys.Sound = rajahdysAani; 
    244335            pelaaja.IgnoresExplosions = true; 
     336 
     337            String tag = kohde.Tag.ToString(); 
     338            if (tag == "pahis" || tag == "pahis2" || tag == "bossi") 
     339            { 
     340                voittoLaskuri.Value++; 
     341            } 
    245342        } 
    246343        ammus.Destroy(); 
     
    275372 
    276373            ammus.Image = Laser; 
    277             ase.FireRate = 3.0; 
     374            ase.FireRate = 5.0; 
    278375 
    279376            AddCollisionHandler(ammus, AmmusOsui); 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/SpaceAdventure.csproj.Debug.cachefile

    r6976 r6979  
    99Content\laser.xnb 
    1010Content\Stuff.xnb 
     11Content\cool tausta new.xnb 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/obj/x86/Debug/SpaceAdventure.csproj.FileListAbsolute.txt

    r6976 r6979  
    77C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb 
    88C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb 
    9 C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cloud.xnb 
    109C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb 
    1110C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\SpaceAdventure.exe 
     
    3534C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\obj\x86\Debug\SpaceAdventure.pdb 
    3635C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb 
     36C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb 
     37C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta new.xnb 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/obj/x86/Debug/cachefile-{A53A8295-A762-4A93-989B-CDE36F5CC9A7}-targetpath.txt

    r6976 r6979  
    99Content\laser.xnb 
    1010Content\Stuff.xnb 
     11Content\cool tausta new.xnb 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventureContent/SpaceAdventureContent.contentproj

    r6976 r6979  
    115115    </Compile> 
    116116  </ItemGroup> 
     117  <ItemGroup> 
     118    <Compile Include="cool tausta new.png"> 
     119      <Name>cool tausta new</Name> 
     120      <Importer>TextureImporter</Importer> 
     121      <Processor>TextureProcessor</Processor> 
     122    </Compile> 
     123  </ItemGroup> 
    117124  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    118125  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventureContent/obj/x86/Debug/ContentPipeline.xml

    r6976 r6979  
    88      <Processor>TextureProcessor</Processor> 
    99      <Options>None</Options> 
    10       <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta.xnb</Output> 
    11       <Time>2015-07-23T12:17:59.4044483+03:00</Time> 
     10      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta.xnb</Output> 
     11      <Time>2015-07-23T12:53:23.8300809+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1717      <Processor>TextureProcessor</Processor> 
    1818      <Options>None</Options> 
    19       <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool alus.xnb</Output> 
    20       <Time>2015-07-23T09:45:06.3229068+03:00</Time> 
     19      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool alus.xnb</Output> 
     20      <Time>2015-07-21T14:12:05.8146469+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    2626      <Processor>TextureProcessor</Processor> 
    2727      <Options>None</Options> 
    28       <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool asteroid bu.xnb</Output> 
    29       <Time>2015-07-23T09:45:06.3069068+03:00</Time> 
     28      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool asteroid bu.xnb</Output> 
     29      <Time>2015-07-21T14:55:03.3357265+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    3535      <Processor>TextureProcessor</Processor> 
    3636      <Options>None</Options> 
    37       <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolhyvisalus.xnb</Output> 
    38       <Time>2015-07-23T09:45:06.3329068+03:00</Time> 
     37      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolhyvisalus.xnb</Output> 
     38      <Time>2015-07-22T11:35:17.1851187+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4444      <Processor>TextureProcessor</Processor> 
    4545      <Options>None</Options> 
    46       <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolasteroidya.xnb</Output> 
    47       <Time>2015-07-23T09:45:06.3259068+03:00</Time> 
     46      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolasteroidya.xnb</Output> 
     47      <Time>2015-07-21T14:55:35.1129265+03:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5353      <Processor>TextureProcessor</Processor> 
    5454      <Options>None</Options> 
    55       <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool space.xnb</Output> 
    56       <Time>2015-07-23T09:45:06.4709068+03:00</Time> 
     55      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool space.xnb</Output> 
     56      <Time>2015-07-22T11:05:32.8286354+03:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6262      <Processor>TextureProcessor</Processor> 
    6363      <Options>None</Options> 
    64       <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb</Output> 
    65       <Time>2015-07-23T09:45:06.3039068+03:00</Time> 
     64      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb</Output> 
     65      <Time>2015-07-22T12:56:39.8323187+03:00</Time> 
    6666    </Item> 
    6767    <Item> 
     
    7171      <Processor>TextureProcessor</Processor> 
    7272      <Options>None</Options> 
    73       <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb</Output> 
    74       <Time>2015-07-23T09:45:06.3299068+03:00</Time> 
     73      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb</Output> 
     74      <Time>2015-07-22T13:01:57.3205187+03:00</Time> 
    7575    </Item> 
    7676    <Item> 
     
    8080      <Processor>TextureProcessor</Processor> 
    8181      <Options>None</Options> 
    82       <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb</Output> 
    83       <Time>2015-07-23T09:46:46.4089068+03:00</Time> 
     82      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb</Output> 
     83      <Time>2015-07-23T09:57:07.8638619+03:00</Time> 
    8484    </Item> 
    8585    <Item> 
     
    8989      <Processor>TextureProcessor</Processor> 
    9090      <Options>None</Options> 
    91       <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb</Output> 
    92       <Time>2015-07-23T11:23:12.2378915+03:00</Time> 
     91      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb</Output> 
     92      <Time>2015-07-23T12:42:37.5810809+03:00</Time> 
     93    </Item> 
     94    <Item> 
     95      <Source>cool tausta new.png</Source> 
     96      <Name>cool tausta new</Name> 
     97      <Importer>TextureImporter</Importer> 
     98      <Processor>TextureProcessor</Processor> 
     99      <Options>None</Options> 
     100      <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta new.xnb</Output> 
     101      <Time>2015-07-23T13:25:00.6790809+03:00</Time> 
    93102    </Item> 
    94103    <BuildSuccessful>true</BuildSuccessful> 
     
    98107      <BuildConfiguration>Debug</BuildConfiguration> 
    99108      <CompressContent>false</CompressContent> 
    100       <RootDirectory>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventureContent\</RootDirectory> 
    101       <LoggerRootDirectory>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\</LoggerRootDirectory> 
    102       <IntermediateDirectory>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\</IntermediateDirectory> 
    103       <OutputDirectory>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\</OutputDirectory> 
     109      <RootDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventureContent\</RootDirectory> 
     110      <LoggerRootDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\</LoggerRootDirectory> 
     111      <IntermediateDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\</IntermediateDirectory> 
     112      <OutputDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\</OutputDirectory> 
    104113    </Settings> 
    105114    <Assemblies> 
     
    138147      <Assembly> 
    139148        <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 
    140         <Value>2015-07-09T14:19:15.2277481+03:00</Value> 
     149        <Value>2015-07-09T14:51:24.2760228+03:00</Value> 
    141150      </Assembly> 
    142151    </Assemblies> 
Note: See TracChangeset for help on using the changeset viewer.