Changeset 2995


Ignore:
Timestamp:
2012-06-13 14:57:12 (11 years ago)
Author:
leoslimi
Message:

Talletus.

Location:
2012/24/LeeviL
Files:
8 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2012/24/LeeviL/Rangoneina/Rangoneina/Rangoneina/Rangoneina.cs

    r2975 r2995  
    1515    Image Vih2I = LoadImage("Vih2"); 
    1616    Image Vih3I = LoadImage("Vih3"); 
    17  
     17    PhysicsObject Rekuroka; 
     18    IntMeter Pistelaskuri; 
    1819    public override void Begin() 
    1920    { 
    2021 
     22        LuoKentta(); 
     23        AsetaOhjaimet(); 
     24 
     25    } 
     26 
     27    void LuoKentta() 
     28    { 
     29        TileMap ruudut = TileMap.FromLevelAsset("Kentta1"); 
     30        ruudut.SetTileMethod('=', LuoPalikka); 
     31        ruudut.SetTileMethod('T', LuoTahti); 
     32        ruudut.SetTileMethod('1', Vih1); 
     33        ruudut.SetTileMethod('2', Vih2); 
     34        ruudut.SetTileMethod('3', Vih3); 
     35        ruudut.SetTileMethod('R', LuoRekuroka); 
     36        ruudut.SetTileMethod('S', Serunom); 
     37        ruudut.SetTileMethod('M', Merinoma); 
     38        ruudut.SetTileMethod('W', LuoPiste); 
     39        ruudut.Execute(30,30); 
     40 
     41        Level.BackgroundColor = Color.Aqua; 
     42 
     43        Camera.Follow(Rekuroka); 
     44 
     45        LuoLaskuri(); 
     46    } 
     47 
     48    void LuoRekuroka(Vector paikka, double leveys, double korkeus) 
     49    { 
     50        Rekuroka = new PhysicsObject (leveys, korkeus); 
     51        Rekuroka.Image = RekurokaI; 
     52        Rekuroka.Restitution = 0.0; 
     53        Rekuroka.Position = paikka; 
     54        AddCollisionHandler(Rekuroka, "LuoTahti", Tormays1); 
     55        AddCollisionHandler(Rekuroka, "LuoPiste", Tormays2); 
     56        Rekuroka.Tag = "Kuolema"; 
     57        Add(Rekuroka); 
     58    } 
     59 
     60    void Serunom(Vector paikka, double leveys, double korkeus) 
     61    { 
     62        PhysicsObject Serunom = new PhysicsObject(leveys, korkeus); 
     63        Serunom.Image = SerunomI; 
     64        Serunom.Restitution = 0.0; 
     65        Serunom.Position = paikka; 
     66        Add(Serunom); 
     67    } 
     68 
     69    void Merinoma(Vector paikka, double leveys, double korkeus) 
     70    { 
     71        PhysicsObject Merinoma = new PhysicsObject(leveys, korkeus); 
     72        Merinoma.Image = MerinomaI; 
     73        Merinoma.Restitution = 0.0; 
     74        Merinoma.Position = paikka; 
     75        AddCollisionHandler(Merinoma, "Kuolema", Tormays3); 
     76        Add(Merinoma); 
     77    } 
     78 
     79    void Vih1(Vector paikka, double leveys, double korkeus) 
     80    { 
     81        PhysicsObject Vih1 = new PhysicsObject(leveys, korkeus); 
     82        Vih1.Image = Vih1I; 
     83        Vih1.Restitution = 0.0; 
     84        Vih1.Position = paikka; 
     85        Add(Vih1); 
     86    } 
     87 
     88    void Vih2(Vector paikka, double leveys, double korkeus) 
     89    { 
     90        PhysicsObject Vih2 = new PhysicsObject(leveys, korkeus); 
     91        Vih2.Image = Vih2I; 
     92        Vih2.Restitution = 0.0; 
     93        Vih2.Position = paikka; 
     94        Add(Vih2); 
     95    } 
     96 
     97    void Vih3(Vector paikka, double leveys, double korkeus) 
     98    { 
     99        PhysicsObject Vih3 = new PhysicsObject(leveys, korkeus); 
     100        Vih3.Image = Vih3I; 
     101        Vih3.Restitution = 0.0; 
     102        Vih3.Position = paikka; 
     103        Add(Vih3); 
     104    } 
     105 
     106    void LuoPalikka(Vector paikka, double leveys, double korkeus) 
     107    { 
     108        PhysicsObject palikka = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     109        palikka.Shape = Shape.Rectangle; 
     110        palikka.Color = Color.Black; 
     111        palikka.Restitution = 0.0; 
     112        palikka.Position = paikka; 
     113        Add(palikka); 
     114    } 
     115 
     116    void LuoTahti(Vector paikka, double leveys, double korkeus) 
     117    { 
     118        PhysicsObject tahti = new PhysicsObject(leveys, korkeus); 
     119        tahti.Shape = Shape.Star; 
     120        tahti.Color = Color.Yellow; 
     121        tahti.Restitution = 0.0; 
     122        tahti.Position = paikka; 
     123        tahti.Tag = "LuoTahti"; 
     124        Add(tahti); 
     125    } 
     126 
     127    void LuoPiste(Vector paikka, double leveys, double korkeus) 
     128    { 
     129        PhysicsObject piste = new PhysicsObject(leveys, korkeus); 
     130        piste.Shape = Shape.Circle; 
     131        piste.Color = Color.YellowGreen; 
     132        piste.Restitution = 0.0; 
     133        piste.Position = paikka; 
     134        piste.Tag = "LuoPiste"; 
     135        Add(piste); 
     136    } 
     137 
     138    void AsetaOhjaimet() 
     139    { 
     140       Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, 200)); 
     141       Keyboard.Listen(Key.Down, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, -200)); 
     142       Keyboard.Listen(Key.Right, ButtonState.Down, LiikutaPelaajaa, null, new Vector(200, 0)); 
     143       Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, null, new Vector(-200, 0));  
    21144 
    22145        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
     
    24147    } 
    25148 
    26     void Rekuroka() 
     149    void LiikutaPelaajaa(Vector suunta) 
    27150    { 
    28         PhysicsObject Rekuroka = new PhysicsObject (30.0, 30.0); 
    29         Rekuroka.Image = RekurokaI; 
    30         Add(Rekuroka); 
     151        Rekuroka.Push(suunta); 
    31152    } 
    32153 
    33     void Serunom() 
     154    void Tormays1(IPhysicsObject tormaaja, IPhysicsObject kohde) 
    34155    { 
    35         PhysicsObject Serunom = new PhysicsObject(30.0, 30.0); 
    36         Serunom.Image = SerunomI; 
    37         Add(Serunom); 
     156        kohde.Destroy(); 
     157        Pistelaskuri.Value = Pistelaskuri.Value + 1; 
    38158    } 
    39159 
    40     void Merinoma() 
     160    void Tormays2(IPhysicsObject tormaaja, IPhysicsObject kohde) 
    41161    { 
    42         PhysicsObject Merinoma = new PhysicsObject(30.0, 30.0); 
    43         Merinoma.Image = MerinomaI; 
    44         Add(Merinoma); 
     162        kohde.Destroy(); 
     163        Pistelaskuri.Value = Pistelaskuri.Value + 5; 
    45164    } 
    46165 
    47     void Vih1() 
     166    void Tormays3(IPhysicsObject tormaaja, IPhysicsObject kohde) 
    48167    { 
    49         PhysicsObject Vih1 = new PhysicsObject(30.0, 30.0); 
    50         Vih1.Image = Vih1I; 
    51         Add(Vih1); 
     168        kohde.Destroy(); 
    52169    } 
    53170 
    54     void Vih2() 
     171    void LuoLaskuri() 
    55172    { 
    56         PhysicsObject Vih2 = new PhysicsObject(30.0, 30.0); 
    57         Vih2.Image = Vih2I; 
    58         Add(Vih2); 
    59     } 
     173        Pistelaskuri = new IntMeter(0); 
    60174 
    61     void Vih3() 
    62     { 
    63         PhysicsObject Vih3 = new PhysicsObject(30.0, 30.0); 
    64         Vih3.Image = Vih3I; 
    65         Add(Vih3); 
     175        Label pistenaytto = new Label(); 
     176        pistenaytto.X = Screen.Left + 100; 
     177        pistenaytto.Y = Screen.Top - 100; 
     178        pistenaytto.TextColor = Color.Black; 
     179        pistenaytto.Color = Color.White; 
     180 
     181        pistenaytto.BindTo(Pistelaskuri); 
     182        Add(pistenaytto); 
    66183    } 
    67184} 
  • 2012/24/LeeviL/Rangoneina/Rangoneina/Rangoneina/Rangoneina.csproj.Debug.cachefile

    r2975 r2995  
    22Content\Serunom.xnb 
    33Content\Merinoma.xnb 
     4Content\Vih1.xnb 
     5Content\Vih2.xnb 
     6Content\Vih3.xnb 
     7Content\Kentta1.xnb 
     8Content\Kentta1.txt 
  • 2012/24/LeeviL/Rangoneina/Rangoneina/Rangoneina/obj/x86/Debug/Rangoneina.csproj.FileListAbsolute.txt

    r2975 r2995  
    1010C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Serunom.xnb 
    1111C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Merinoma.xnb 
     12C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Vih1.xnb 
     13C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Vih2.xnb 
     14C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Vih3.xnb 
     15C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Kentta1.xnb 
     16C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Kentta1.txt 
  • 2012/24/LeeviL/Rangoneina/Rangoneina/Rangoneina/obj/x86/Debug/cachefile-{43DDB7A9-921D-4BF9-A5DD-4CA1D9C85B38}-targetpath.txt

    r2975 r2995  
    22Content\Serunom.xnb 
    33Content\Merinoma.xnb 
     4Content\Vih1.xnb 
     5Content\Vih2.xnb 
     6Content\Vih3.xnb 
     7Content\Kentta1.xnb 
     8Content\Kentta1.txt 
  • 2012/24/LeeviL/Rangoneina/Rangoneina/RangoneinaContent/RangoneinaContent.contentproj

    r2975 r2995  
    6565    </Compile> 
    6666  </ItemGroup> 
     67  <ItemGroup> 
     68    <Compile Include="Vih1.png"> 
     69      <Name>Vih1</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72    </Compile> 
     73  </ItemGroup> 
     74  <ItemGroup> 
     75    <Compile Include="Vih2.png"> 
     76      <Name>Vih2</Name> 
     77      <Importer>TextureImporter</Importer> 
     78      <Processor>TextureProcessor</Processor> 
     79    </Compile> 
     80  </ItemGroup> 
     81  <ItemGroup> 
     82    <Compile Include="Vih3.png"> 
     83      <Name>Vih3</Name> 
     84      <Importer>TextureImporter</Importer> 
     85      <Processor>TextureProcessor</Processor> 
     86    </Compile> 
     87  </ItemGroup> 
     88  <ItemGroup> 
     89    <Compile Include="Kentta1.txt"> 
     90      <Name>Kentta1</Name> 
     91      <Importer>TextFileImporter</Importer> 
     92      <Processor>TextFileContentProcessor</Processor> 
     93      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
     94    </Compile> 
     95  </ItemGroup> 
    6796  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    6897  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2012/24/LeeviL/Rangoneina/Rangoneina/RangoneinaContent/obj/x86/Debug/ContentPipeline.xml

    r2975 r2995  
    2828      <Output>C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Merinoma.xnb</Output> 
    2929      <Time>2012-06-13T10:32:39.0996941+03:00</Time> 
     30    </Item> 
     31    <Item> 
     32      <Source>Vih1.png</Source> 
     33      <Name>Vih1</Name> 
     34      <Importer>TextureImporter</Importer> 
     35      <Processor>TextureProcessor</Processor> 
     36      <Options>None</Options> 
     37      <Output>C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Vih1.xnb</Output> 
     38      <Time>2012-06-13T10:39:04.5086941+03:00</Time> 
     39    </Item> 
     40    <Item> 
     41      <Source>Vih2.png</Source> 
     42      <Name>Vih2</Name> 
     43      <Importer>TextureImporter</Importer> 
     44      <Processor>TextureProcessor</Processor> 
     45      <Options>None</Options> 
     46      <Output>C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Vih2.xnb</Output> 
     47      <Time>2012-06-13T10:43:06.7006941+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>Vih3.png</Source> 
     51      <Name>Vih3</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Vih3.xnb</Output> 
     56      <Time>2012-06-13T10:43:09.9886941+03:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>Kentta1.txt</Source> 
     60      <Name>Kentta1</Name> 
     61      <Importer>TextFileImporter</Importer> 
     62      <Processor>TextFileContentProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\LeeviL\Rangoneina\Rangoneina\Rangoneina\bin\x86\Debug\Content\Kentta1.xnb</Output> 
     65      <Time>2012-06-13T14:32:27.4475325+03:00</Time> 
    3066    </Item> 
    3167    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.