Changeset 609


Ignore:
Timestamp:
2010-06-09 11:59:33 (13 years ago)
Author:
ekeimaja
Message:

tässäpä on

Location:
2010/23/ekeimaja/Labyrinth
Files:
2 added
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • 2010/23/ekeimaja/Labyrinth/Labyrinth/Content/Content.contentproj

    r593 r609  
    5555      <Processor>TextureProcessor</Processor> 
    5656    </Compile> 
    57     <Compile Include="tausta.png"> 
    58       <Name>tausta</Name> 
    59       <Importer>TextureImporter</Importer> 
    60       <Processor>TextureProcessor</Processor> 
    61     </Compile> 
    6257    <Compile Include="wall.png"> 
    6358      <Name>wall</Name> 
     
    6661    </Compile> 
    6762  </ItemGroup> 
     63  <ItemGroup> 
     64    <Compile Include="goal.PNG"> 
     65      <Name>goal</Name> 
     66      <Importer>TextureImporter</Importer> 
     67      <Processor>TextureProcessor</Processor> 
     68    </Compile> 
     69  </ItemGroup> 
    6870</Project> 
  • 2010/23/ekeimaja/Labyrinth/Labyrinth/Labyrinth.csproj

    r593 r609  
    9090    <Content Include="Game.ico" /> 
    9191    <Content Include="GameThumbnail.png" /> 
    92     <Content Include="kentta1.txt"> 
     92    <None Include="kentta1.txt"> 
    9393      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
    94     </Content> 
     94    </None> 
    9595    <Content Include="monster.png" /> 
    9696    <Content Include="player1.png" /> 
    9797    <Content Include="player2.png" /> 
    98     <Content Include="tausta.png" /> 
    9998  </ItemGroup> 
    10099  <ItemGroup> 
  • 2010/23/ekeimaja/Labyrinth/Labyrinth/Peli.cs

    r593 r609  
    1010    public class Peli : Game 
    1111    { 
     12        GameObject Pelaaja1; 
     13 
    1214        const int RuudunLeveys = 50; 
    1315        const int RuudunKorkeus = 50; 
     
    2325            merkit['0'] = LuoRuoka; 
    2426            merkit['1'] = LuoPelaaja1; 
    25             //merkit['2'] = LuoPelaaja2; 
     27            merkit['2'] = LuoPelaaja2; 
     28            merkit['F'] = LuoMaali; 
    2629 
    2730            char[,] ruudut = Tiles.ReadFromFile("kentta1.txt"); 
    2831 
    2932            Tiles.Insert(this, ruudut, merkit, RuudunLeveys, RuudunKorkeus); 
     33 
     34            LuoOhjain(); 
     35 
    3036            Camera.ZoomToLevel(); 
    3137        } 
     
    3339        GameObject LuoPelaaja1() 
    3440        { 
    35             GameObject Pelaaja1 = new GameObject(50.0,50.0); 
     41            Pelaaja1 = new GameObject(50.0,50.0); 
    3642            Pelaaja1.Image = LoadImage("player1"); 
    3743            Add(Pelaaja1); 
    3844            return Pelaaja1; 
     45 
     46        } 
     47 
     48        GameObject LuoPelaaja2() 
     49        { 
     50            GameObject Pelaaja2 = new GameObject(50.0, 50.0); 
     51            Pelaaja2.Image = LoadImage("player2"); 
     52            Add(Pelaaja2); 
     53            return Pelaaja2; 
    3954        } 
    4055 
     
    5570        } 
    5671 
     72        GameObject LuoMaali() 
     73        {  
     74            GameObject Maali = new GameObject(50.0, 50.0); 
     75            Maali.Image = LoadImage("goal"); 
     76            Add(Maali); 
     77            return Maali; 
     78        } 
     79 
    5780        PhysicsObject LuoSeina() 
    5881        { 
     
    6386 
    6487        } 
     88        void LuoOhjain() 
     89        { 
    6590 
    66         
     91            Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaaVasemmalle, null); 
     92            Keyboard.Listen(Key.Right, ButtonState.Down, LiikutaPelaajaaOikealle, null); 
     93            Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaaYlos, null); 
     94            Keyboard.Listen(Key.Down, ButtonState.Down, LiikutaPelaajaaAlas, null); 
     95             
     96        } 
    6797 
     98 
     99        void LiikutaPelaajaaVasemmalle() 
     100        { 
     101            Pelaaja1.Move(new Vector(-20, 0)); 
     102        } 
     103 
     104        void LiikutaPelaajaaOikealle() 
     105        { 
     106            Pelaaja1.Move(new Vector(20, 0)); 
     107        } 
     108 
     109        void LiikutaPelaajaaYlos() 
     110        { 
     111            Pelaaja1.Move(new Vector(0, -0)); 
     112        } 
     113 
     114        void LiikutaPelaajaaAlas() 
     115        { 
     116            Pelaaja1.Move(new Vector(-0, 0)); 
     117        } 
    68118 
    69119    } 
  • 2010/23/ekeimaja/Labyrinth/Labyrinth/kentta1.txt

    r592 r609  
    1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    3 xx 1 x 0      xxx D              0000000  x 
    4 xx   xxxxxx   xxxxxxxxxxx  xxxxxxxxxxxxxxxx 
    5 xx                               x 00000  x 
    6 xxxxxxxxxxx      xxxxxxxxxxxxxx      x 00000  x 
    7 xxxxx 00  x     xxx 00000 x      x        x 
    8 xx D            xx                        x 
    9 xxxxxxxxxxxx    xxxxxxxxxxxxxxxx   xxxxxxxx 
    10 xx D     0       x D                      x 
    11 xxxxxxxx  xx   xxxxxxxxxxxxxxxxxxxxxx     x 
    12 xx 000000 x    xx                         x 
    13 xxxxxxxxxxx    xx   xxxxxxxx  000000      x 
    14 xx             xx   xxxxxxxx         0000 x 
    15 xx   xxxxxxxxxxxxx          0000000       x 
    16 xx   xxxxxxxxxxxxxxxxx   xxx       xxxxxxxx 
    17 xx   xxxxxxxxxxxxx F x   xxx       xxxxxxxx 
    18 xx 2 xxxxxxxxxxxxx                 xxxxxxxx 
    19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     3xx 1 x 0     xxx D                0000000 xx 
     4xx   xxxxxx  xxxxxxxxxxxx  xxxxxxxxxxxxxxxxx 
     5xx                          x             xx 
     6xxxxxxxxxxxx    xxxxxxxxx   x  x          xx 
     7xxxxxx 00  x    xxxxxxxxx   x  x 000000   xx 
     8xxx D           xxxxxxxxx      x          xx 
     9xxxxxxxxxxxxx   xxxxxxxxxxxxxxxxxxxx      xx 
     10xx D            xx D                      xx 
     11xxxxxxxxx  xx   xxxxxxxxxxxxxxxxxxxxxx    xx 
     12xx 000000  x    xx 0000000                xx 
     13xxxxxxxxxxxx    xx 000   xxxxxxxx  000000 xx 
     14xx              xx       xxxxxxxx         xx 
     15xx   xxxxxxxxxxxxx         D      000000  xx 
     16xx   xxxxxxxxxxxxxxxxx   xxx     xxxxxxxxxxx 
     17xx   xxxxxxxxxxxxx  Fx   xxx     xxxxxxxxxxx 
     18xx 2 xxxxxxxxxxxxx               xxxxxxxxxxx 
     19xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     20xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     21 
     22 
     23 
     24 
     25 
Note: See TracChangeset for help on using the changeset viewer.