Changeset 6951 for 2015/30


Ignore:
Timestamp:
2015-07-23 09:56:28 (4 years ago)
Author:
aahalme
Message:

Laser, pienemmät vihut, näkymättömät reunat + pilviä.

Location:
2015/30/EliasHy/SpaceAdventure
Files:
4 added
14 edited

Legend:

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

    r6921 r6951  
    1515    Image CoolAsteroidi = LoadImage("cool asteroid bu"); 
    1616    Image taustaKuva = LoadImage("cool space"); 
     17    Image Cloud = LoadImage("cloud"); 
    1718    Image Laser = LoadImage("laser"); 
    1819    Image Boss = LoadImage("Boss Ship_zpspn6osve5"); 
    1920    Image Vihollinenalus = LoadImage("enemy ship 2"); 
     21 
     22    IntMeter pistelaskuri; 
    2023 
    2124    double eteenpain = 500; 
     
    3639        Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja); 
    3740        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     41        LuoPistelaskuri(); 
    3842    } 
    3943 
     
    6973        ruudut.SetTileMethod(Color.Gold, LuoAsteroidi); 
    7074        ruudut.SetTileMethod(Color.FromHexCode("FF0000"), LuoVihollinen2); 
     75        ruudut.SetTileMethod(Color.FromHexCode("B200FF"), LuoReuna); 
    7176 
    7277        //Level.CreateBorders(); 
    73         Level.CreateBorders(); 
    7478 
    7579        //3. Execute luo kentän 
     
    7781        ruudut.Execute(20, 20); 
    7882    } 
     83 
     84    void LuoReuna(Vector paikka, double leveys, double korkeus) 
     85    { 
     86        //PhysicsObject Asteroidi = new PhysicsObject(10, 10); 
     87        PhysicsObject Reuna = PhysicsObject.CreateStaticObject(Cloud); 
     88        Reuna.Position = paikka; 
     89        Reuna.Tag = "reuna"; 
     90        Add(Reuna); 
     91 
     92    } 
     93 
    7994    void LuoPelaaja(Vector paikka, double leveys, double korkeus) 
    8095    { 
     
    86101        pelaaja.Position = paikka; 
    87102        pelaaja.AngularDamping = 0.9; 
     103        pelaaja.Tag = "pelaaja"; 
    88104 
    89105        ase = new AssaultRifle(1, 1); 
     
    101117 
    102118        //AddCollisionHandler(Laser, CollisionHandler.ExplodeTarget(150, false)); 
     119        FollowerBrain seuraajanAivot = new FollowerBrain("pelaaja"); 
     120        seuraajanAivot.Speed = 70; 
     121        Vihollinen.Brain = seuraajanAivot; 
    103122 
    104  
    105         //Tehdään uudet satunnaisaivot, jotka liikkuvat nopeudella 200 
    106         RandomMoverBrain satunnaisAivot = new RandomMoverBrain(150); 
    107  
    108         //Ominaisuuksien muokkaaminen 
    109         satunnaisAivot.ChangeMovementSeconds = 3; 
    110  
    111         //Aivot käyttöön oliolle 
    112         Vihollinen.Brain = satunnaisAivot; 
    113123 
    114124    } 
     
    127137        PhysicsObject Vihollinen2 = new PhysicsObject(Vihollinenalus); 
    128138        Vihollinen2.Color = Color.Gold; 
     139        Vihollinen2.Size = new Vector(50, 50); 
    129140        Vihollinen2.Position = paikka; 
    130141        Add(Vihollinen2); 
    131142        Vihollinen2.Tag = "pahis2"; 
     143 
     144        //Tehdään uudet satunnaisaivot, jotka liikkuvat nopeudella 200 
     145        RandomMoverBrain satunnaisAivot = new RandomMoverBrain(150); 
     146 
     147        //Ominaisuuksien muokkaaminen 
     148        satunnaisAivot.ChangeMovementSeconds = 3; 
     149        Vihollinen2.Brain = satunnaisAivot; 
    132150 
    133151    } 
     
    135153    void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
    136154    { 
     155        if (kohde.Tag.ToString() != "reuna") 
     156        { 
     157            kohde.Destroy(); 
     158            pistelaskuri.Value += 1; 
     159        } 
     160        ammus.Destroy(); 
     161 
     162    } 
     163 
     164    void LuoPistelaskuri() 
     165    { 
    137166 
    138167 
     168        pistelaskuri = new IntMeter(0); 
     169 
     170        Label pisteNaytto = new Label(); 
     171        pisteNaytto.X = Screen.Left + 100; 
     172        pisteNaytto.Y = Screen.Top - 100; 
     173        pisteNaytto.TextColor = Color.Black; 
     174        pisteNaytto.Color = Color.White; 
     175        pisteNaytto.Title = "Pisteet"; 
     176        pisteNaytto.BindTo(pistelaskuri); 
     177        Add(pisteNaytto); 
    139178    } 
     179 
    140180    void AmmuAseella(PhysicsObject pelaaja) 
    141181    { 
     
    144184        if (ammus != null) 
    145185        { 
     186            ammus.Tag = "ammus"; 
    146187            ammus.Size *= 0.5; 
    147188            ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 
     189 
    148190            ammus.Image = Laser; 
     191            ase.FireRate = 3.0; 
     192 
     193            AddCollisionHandler(ammus, AmmusOsui); 
    149194        } 
    150195    } 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/SpaceAdventure.csproj.Debug.cachefile

    r6918 r6951  
    77Content\Boss Ship_zpspn6osve5.xnb 
    88Content\enemy ship 2.xnb 
     9Content\cloud.xnb 
     10Content\laser.xnb 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/obj/x86/Debug/SpaceAdventure.csproj.FileListAbsolute.txt

    r6918 r6951  
    1515C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb 
    1616C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb 
     17C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta.xnb 
     18C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool alus.xnb 
     19C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool asteroid bu.xnb 
     20C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolhyvisalus.xnb 
     21C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\coolasteroidya.xnb 
     22C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool space.xnb 
     23C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\Boss Ship_zpspn6osve5.xnb 
     24C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\enemy ship 2.xnb 
     25C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\SpaceAdventure.exe 
     26C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\SpaceAdventure.pdb 
     27C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Jypeli.dll 
     28C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Jypeli.xml 
     29C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\obj\x86\Debug\SpaceAdventure.csprojResolveAssemblyReference.cache 
     30C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 
     31C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\obj\x86\Debug\SpaceAdventure.exe 
     32C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\obj\x86\Debug\SpaceAdventure.pdb 
     33C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cloud.xnb 
     34C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventure/obj/x86/Debug/cachefile-{A53A8295-A762-4A93-989B-CDE36F5CC9A7}-targetpath.txt

    r6918 r6951  
    77Content\Boss Ship_zpspn6osve5.xnb 
    88Content\enemy ship 2.xnb 
     9Content\cloud.xnb 
     10Content\laser.xnb 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventureContent/SpaceAdventureContent.contentproj

    r6918 r6951  
    101101    </Compile> 
    102102  </ItemGroup> 
     103  <ItemGroup> 
     104    <Compile Include="cloud.png"> 
     105      <Name>cloud</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108    </Compile> 
     109    <Compile Include="laser.png"> 
     110      <Name>laser</Name> 
     111      <Importer>TextureImporter</Importer> 
     112      <Processor>TextureProcessor</Processor> 
     113    </Compile> 
     114  </ItemGroup> 
    103115  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    104116  <!--  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

    r6918 r6951  
    88      <Processor>TextureProcessor</Processor> 
    99      <Options>None</Options> 
    10       <Output>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta.xnb</Output> 
    11       <Time>2015-07-22T12:37:40.9096187+03:00</Time> 
     10      <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cool tausta.xnb</Output> 
     11      <Time>2015-07-23T09:45:06.3199068+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1717      <Processor>TextureProcessor</Processor> 
    1818      <Options>None</Options> 
    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> 
     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> 
    2121    </Item> 
    2222    <Item> 
     
    2626      <Processor>TextureProcessor</Processor> 
    2727      <Options>None</Options> 
    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> 
     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> 
    3030    </Item> 
    3131    <Item> 
     
    3535      <Processor>TextureProcessor</Processor> 
    3636      <Options>None</Options> 
    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> 
     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> 
    3939    </Item> 
    4040    <Item> 
     
    4444      <Processor>TextureProcessor</Processor> 
    4545      <Options>None</Options> 
    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> 
     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> 
    4848    </Item> 
    4949    <Item> 
     
    5353      <Processor>TextureProcessor</Processor> 
    5454      <Options>None</Options> 
    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> 
     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> 
    5757    </Item> 
    5858    <Item> 
     
    6262      <Processor>TextureProcessor</Processor> 
    6363      <Options>None</Options> 
    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> 
     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> 
    6666    </Item> 
    6767    <Item> 
     
    7171      <Processor>TextureProcessor</Processor> 
    7272      <Options>None</Options> 
    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> 
     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> 
     75    </Item> 
     76    <Item> 
     77      <Source>cloud.png</Source> 
     78      <Name>cloud</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81      <Options>None</Options> 
     82      <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\cloud.xnb</Output> 
     83      <Time>2015-07-23T09:46:46.4079068+03:00</Time> 
     84    </Item> 
     85    <Item> 
     86      <Source>laser.png</Source> 
     87      <Name>laser</Name> 
     88      <Importer>TextureImporter</Importer> 
     89      <Processor>TextureProcessor</Processor> 
     90      <Options>None</Options> 
     91      <Output>C:\MyTemp\hyva\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\laser.xnb</Output> 
     92      <Time>2015-07-23T09:46:46.4089068+03:00</Time> 
    7593    </Item> 
    7694    <BuildSuccessful>true</BuildSuccessful> 
     
    8098      <BuildConfiguration>Debug</BuildConfiguration> 
    8199      <CompressContent>false</CompressContent> 
    82       <RootDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventureContent\</RootDirectory> 
    83       <LoggerRootDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\</LoggerRootDirectory> 
    84       <IntermediateDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\</IntermediateDirectory> 
    85       <OutputDirectory>C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventure\bin\x86\Debug\Content\</OutputDirectory> 
     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> 
    86104    </Settings> 
    87105    <Assemblies> 
     
    120138      <Assembly> 
    121139        <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> 
    122         <Value>2015-07-09T14:51:24.2760228+03:00</Value> 
     140        <Value>2015-07-09T14:19:15.2277481+03:00</Value> 
    123141      </Assembly> 
    124142    </Assemblies> 
  • 2015/30/EliasHy/SpaceAdventure/SpaceAdventure/SpaceAdventureContent/obj/x86/Debug/SpaceAdventureContent.contentproj.FileListAbsolute.txt

    r6913 r6951  
    11C:\MyTemp\EliasHy\SpaceAdventure\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\SpaceAdventureContent.contentprojResolveAssemblyReference.cache 
     2C:\MyTemp\hyva\SpaceAdventure\SpaceAdventureContent\obj\x86\Debug\SpaceAdventureContent.contentprojResolveAssemblyReference.cache 
Note: See TracChangeset for help on using the changeset viewer.