Ignore:
Timestamp:
2015-07-24 10:58:50 (4 years ago)
Author:
elhytone
Message:
 
Location:
2015/30/EliasHy/SpaceAdventure
Files:
2 added
16 edited

Legend:

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

    r6980 r7007  
    66using Jypeli.Effects; 
    77using Jypeli.Widgets; 
     8/// @authors Aapo Halme ja Elias Hytönen 
     9/// @version 2nd edition ver 2.31 
     10/// SpaceAdventure 
     11///  
     12/// </summary> 
    813 
    914public class SpaceAdventure : PhysicsGame 
     
    1924    Image Boss = LoadImage("Boss Ship_zpspn6osve5"); 
    2025    Image Vihollinenalus = LoadImage("enemy ship 2"); 
     26    Image Voittokuva = LoadImage("voitto"); 
    2127 
    2228 
     
    2632 
    2733    double eteenpain = 500; 
    28     double kaantyminen = 800; 
     34    double kaantyminen = 900; 
    2935 
    3036    public override void Begin() 
     
    3541 
    3642    void Valikko() 
    37     { 
     43    {            
     44         
    3845        MultiSelectWindow alkuValikko = new MultiSelectWindow("Pelin alkuvalikko", 
    39         "Aloita peli", "Parhaat pisteet", "Lopeta"); 
     46        "Aloita peli", "Lopeta"); 
    4047        Add(alkuValikko); 
    4148        alkuValikko.AddItemHandler(0, AloitaPeli); 
    4249        //alkuValikko.AddItemHandler(1, ParhaatPisteet); 
    43         alkuValikko.AddItemHandler(2, Exit); 
     50        alkuValikko.AddItemHandler(1, Exit); 
    4451        Level.Background.CreateStars(); 
    4552    } 
     
    4956    { 
    5057        ClearAll(); 
     58        IsPaused = false; 
     59        voittoLaskuri = new IntMeter (0, 0, 0); 
    5160        LuoKentta(); 
    5261   
     
    7584        voittonautto.Y = Screen.Top - 100; 
    7685        voittonautto.TextColor = Color.Black; 
    77         voittonautto.Color = Color.White; 
     86        voittonautto.Color = Color.White;  
    7887        voittonautto.Title = "Tapot"; 
    7988        voittonautto.BindTo(voittoLaskuri); 
     89        voittonautto.IntFormatString = "{0}/" + voittoLaskuri.MaxValue; 
    8090        Add(voittonautto); 
    8191 
     
    8797    void Voitto() 
    8898    { 
    89         MessageDisplay.Add("Voitit Pelin!"); 
    90         //TODO: Voitto!  
     99        IsPaused = true; 
     100         
     101 
     102        //MessageDisplay.Add("Voitit Pelin!"); 
     103        //TODO: 
     104        //Timer.SingleShot(1, Valikko); 
     105        Timer valikkoAjastin = new Timer(); 
     106        valikkoAjastin.IgnorePause = true; 
     107        valikkoAjastin.Interval = 1; 
     108        valikkoAjastin.Timeout += delegate 
     109        { 
     110            Valikko(); 
     111            GameObject voittoruutu = new GameObject(150, 50); 
     112            voittoruutu.Image = Voittokuva; 
     113            voittoruutu.Position = pelaaja.Position + new Vector(0,100); 
     114            Add(voittoruutu, 2); 
     115            valikkoAjastin.Stop(); 
     116        }; 
     117        valikkoAjastin.Start(); 
     118         
    91119    } 
    92120 
     
    175203        AddCollisionHandler(pelaaja, "vihuammus", delegate(PhysicsObject A, PhysicsObject B) 
    176204        { 
    177             PelaajaVahingoittuu(A, B, 2); 
     205            PelaajaVahingoittuu(A, B, 3); 
    178206        }); 
    179207 
     
    214242 
    215243        voittoLaskuri.MaxValue++; 
     244        Vihollinen.Removed += delegate 
     245        { 
     246            voittoLaskuri.Value++; 
     247             
     248        }; 
    216249 
    217250 
     
    255288        }; 
    256289        Ampuminen.Start(); 
    257         Bossi.Removed += delegate { Ampuminen.Stop(); }; 
     290        Bossi.Removed += delegate 
     291        { 
     292            voittoLaskuri.Value++; 
     293            Ampuminen.Stop(); 
     294        }; 
     295 
    258296         
    259297        voittoLaskuri.MaxValue++; 
     
    319357        }; 
    320358        Ampuminen.Start(); 
    321         Vihollinen2.Removed += delegate { Ampuminen.Stop(); }; 
     359        Vihollinen2.Removed += delegate  
     360        {  
     361            Ampuminen.Stop(); 
     362            voittoLaskuri.Value++; 
     363        }; 
    322364 
    323365        voittoLaskuri.MaxValue++; 
     
    333375            rajahdys.Position = kohde.Position; 
    334376            Add(rajahdys); 
    335             //rajahdys.Image = rajahdysKuva; 
    336             //rajahdys.Sound = rajahdysAani; 
     377 
    337378            pelaaja.IgnoresExplosions = true; 
    338379 
    339380            String tag = kohde.Tag.ToString(); 
    340             if (tag == "pahis" || tag == "pahis2" || tag == "bossi") 
    341             { 
    342                 voittoLaskuri.Value++; 
    343             } 
     381             
    344382        } 
    345383        ammus.Destroy(); 
     
    375413            ammus.Image = Laser; 
    376414            ase.FireRate = 5.0; 
    377  
     415            //ase.FireRate = 100; 
    378416            AddCollisionHandler(ammus, AmmusOsui); 
    379417        } 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/SpaceAdventure.csproj.Debug.cachefile

    r6979 r7007  
    1010Content\Stuff.xnb 
    1111Content\cool tausta new.xnb 
     12Content\voitto.xnb 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/obj/x86/Debug/SpaceAdventure.csproj.FileListAbsolute.txt

    r6980 r7007  
    5555C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\obj\x86\Debug\SpaceAdventure.exe 
    5656C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\obj\x86\Debug\SpaceAdventure.pdb 
     57C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta.xnb 
     58C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool alus.xnb 
     59C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool asteroid bu.xnb 
     60C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolhyvisalus.xnb 
     61C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolasteroidya.xnb 
     62C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool space.xnb 
     63C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb 
     64C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb 
     65C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb 
     66C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb 
     67C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta new.xnb 
     68C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\SpaceAdventure.exe 
     69C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\SpaceAdventure.pdb 
     70C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Jypeli.dll 
     71C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Jypeli.xml 
     72C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\obj\x86\Debug\SpaceAdventure.csprojResolveAssemblyReference.cache 
     73C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 
     74C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\obj\x86\Debug\SpaceAdventure.exe 
     75C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\obj\x86\Debug\SpaceAdventure.pdb 
     76C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\voitto.xnb 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/obj/x86/Debug/cachefile-{A53A8295-A762-4A93-989B-CDE36F5CC9A7}-targetpath.txt

    r6979 r7007  
    1010Content\Stuff.xnb 
    1111Content\cool tausta new.xnb 
     12Content\voitto.xnb 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventureContent/SpaceAdventureContent.contentproj

    r6979 r7007  
    122122    </Compile> 
    123123  </ItemGroup> 
     124  <ItemGroup> 
     125    <Compile Include="voitto.png"> 
     126      <Name>voitto</Name> 
     127      <Importer>TextureImporter</Importer> 
     128      <Processor>TextureProcessor</Processor> 
     129    </Compile> 
     130  </ItemGroup> 
    124131  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    125132  <!--  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

    r6980 r7007  
    88      <Processor>TextureProcessor</Processor> 
    99      <Options>None</Options> 
    10       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta.xnb</Output> 
    11       <Time>2015-07-23T14:31:23.4720825+03:00</Time> 
     10      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta.xnb</Output> 
     11      <Time>2015-07-24T09:23:17.9969255+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1717      <Processor>TextureProcessor</Processor> 
    1818      <Options>None</Options> 
    19       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool alus.xnb</Output> 
    20       <Time>2015-07-23T14:31:23.4750825+03:00</Time> 
     19      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool alus.xnb</Output> 
     20      <Time>2015-07-24T09:23:17.9969255+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    2626      <Processor>TextureProcessor</Processor> 
    2727      <Options>None</Options> 
    28       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool asteroid bu.xnb</Output> 
    29       <Time>2015-07-23T14:31:23.4680825+03:00</Time> 
     28      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool asteroid bu.xnb</Output> 
     29      <Time>2015-07-24T09:23:17.9813255+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    3535      <Processor>TextureProcessor</Processor> 
    3636      <Options>None</Options> 
    37       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolhyvisalus.xnb</Output> 
    38       <Time>2015-07-23T14:31:23.4500825+03:00</Time> 
     37      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolhyvisalus.xnb</Output> 
     38      <Time>2015-07-24T09:23:17.9657255+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4444      <Processor>TextureProcessor</Processor> 
    4545      <Options>None</Options> 
    46       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolasteroidya.xnb</Output> 
    47       <Time>2015-07-23T14:31:23.4780825+03:00</Time> 
     46      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolasteroidya.xnb</Output> 
     47      <Time>2015-07-24T09:23:17.9969255+03:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5353      <Processor>TextureProcessor</Processor> 
    5454      <Options>None</Options> 
    55       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool space.xnb</Output> 
    56       <Time>2015-07-23T14:31:23.4620825+03:00</Time> 
     55      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool space.xnb</Output> 
     56      <Time>2015-07-24T09:23:17.9813255+03:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6262      <Processor>TextureProcessor</Processor> 
    6363      <Options>None</Options> 
    64       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb</Output> 
    65       <Time>2015-07-23T14:31:23.4450825+03:00</Time> 
     64      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb</Output> 
     65      <Time>2015-07-24T09:23:17.9657255+03:00</Time> 
    6666    </Item> 
    6767    <Item> 
     
    7171      <Processor>TextureProcessor</Processor> 
    7272      <Options>None</Options> 
    73       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb</Output> 
    74       <Time>2015-07-23T14:31:23.4940825+03:00</Time> 
     73      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb</Output> 
     74      <Time>2015-07-24T09:23:18.0125255+03:00</Time> 
    7575    </Item> 
    7676    <Item> 
     
    8080      <Processor>TextureProcessor</Processor> 
    8181      <Options>None</Options> 
    82       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb</Output> 
    83       <Time>2015-07-23T14:31:23.4590825+03:00</Time> 
     82      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb</Output> 
     83      <Time>2015-07-24T09:23:17.9813255+03:00</Time> 
    8484    </Item> 
    8585    <Item> 
     
    8989      <Processor>TextureProcessor</Processor> 
    9090      <Options>None</Options> 
    91       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb</Output> 
    92       <Time>2015-07-23T14:31:23.6860825+03:00</Time> 
     91      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Stuff.xnb</Output> 
     92      <Time>2015-07-24T09:23:18.1685255+03:00</Time> 
    9393    </Item> 
    9494    <Item> 
     
    9898      <Processor>TextureProcessor</Processor> 
    9999      <Options>None</Options> 
    100       <Output>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta new.xnb</Output> 
    101       <Time>2015-07-23T14:38:03.2060825+03:00</Time> 
     100      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta new.xnb</Output> 
     101      <Time>2015-07-24T10:53:58.52315+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>voitto.png</Source> 
     105      <Name>voitto</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108      <Options>None</Options> 
     109      <Output>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\voitto.xnb</Output> 
     110      <Time>2015-07-24T10:13:34.95765+03:00</Time> 
    102111    </Item> 
    103112    <BuildSuccessful>true</BuildSuccessful> 
     
    107116      <BuildConfiguration>Debug</BuildConfiguration> 
    108117      <CompressContent>false</CompressContent> 
    109       <RootDirectory>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventureContent\</RootDirectory> 
    110       <LoggerRootDirectory>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\</LoggerRootDirectory> 
    111       <IntermediateDirectory>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\</IntermediateDirectory> 
    112       <OutputDirectory>C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\</OutputDirectory> 
     118      <RootDirectory>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventureContent\</RootDirectory> 
     119      <LoggerRootDirectory>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\</LoggerRootDirectory> 
     120      <IntermediateDirectory>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\</IntermediateDirectory> 
     121      <OutputDirectory>C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\</OutputDirectory> 
    113122    </Settings> 
    114123    <Assemblies> 
     
    147156      <Assembly> 
    148157        <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> 
    149         <Value>2015-07-09T14:19:15.2277481+03:00</Value> 
     158        <Value>2015-07-09T14:51:24.2760228+03:00</Value> 
    150159      </Assembly> 
    151160    </Assemblies> 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventureContent/obj/x86/Debug/SpaceAdventureContent.contentproj.FileListAbsolute.txt

    r6980 r7007  
    22C:\MyTemp\hyva\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\SpaceAdventureContent.contentprojResolveAssemblyReference.cache 
    33C:\MyTemp\peli 23.7\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\SpaceAdventureContent.contentprojResolveAssemblyReference.cache 
     4C:\MyTemp\peli valmis\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\SpaceAdventureContent.contentprojResolveAssemblyReference.cache 
Note: See TracChangeset for help on using the changeset viewer.