Changeset 3037


Ignore:
Timestamp:
2012-06-14 15:11:00 (11 years ago)
Author:
anlakane
Message:

Talletus.

Location:
2012/24/EemeliKu/DefendTheTreasure
Files:
18 added
14 edited

Legend:

Unmodified
Added
Removed
  • 2012/24/EemeliKu/DefendTheTreasure/DefendTheTreasure/DefendTheTreasure/DefendTheTreasure.cs

    r2999 r3037  
    1414 
    1515    PlatformCharacter pelaaja1; 
    16  
    17     Image pelaajanKuva = LoadImage("Untitled"); 
     16    GameObject Jousi; 
     17    PhysicsObject Arkku; 
     18 
     19    Image pelaajanKuva = LoadImage("Jousimies2"); 
    1820    Image tahtiKuva = LoadImage("tahti"); 
    1921    Image Nurmikko2 = LoadImage("Nurmikko2"); 
     
    2224    Image Kallio = LoadImage("Kallio"); 
    2325    Image Linna = LoadImage("Linna"); 
     26    Image Portti = LoadImage("Portti"); 
     27    Image JousiKuva = LoadImage("Jousi"); 
     28    Image Aarre = LoadImage("Aarre"); 
     29    Image Pilvi = LoadImage("Pilvi"); 
     30    Image Aurinko = LoadImage("Aurinko"); 
     31    Image Hakki = LoadImage("Hakki"); 
     32    Image Ammus = LoadImage("Ammus"); 
     33    Image HirvioKuva = LoadImage("Hirvio"); 
    2434    SoundEffect maaliAani = LoadSoundEffect("maali"); 
    2535 
     
    3040        luoKentta(); 
    3141        lisaaNappaimet(); 
     42        LuoAjastimet(); 
    3243 
    3344        Camera.Follow(pelaaja1); 
     
    4253        kentta.SetTileMethod('*', lisaaTahti); 
    4354        kentta.SetTileMethod('N', lisaaPelaaja); 
    44         kentta.SetTileMethod('%', lisaaMaaTaso ); 
     55        kentta.SetTileMethod('%', lisaaMaaTaso); 
    4556        kentta.SetTileMethod('&', lisaaSilta); 
    4657        kentta.SetTileMethod('-', lisaaKallio); 
    4758        kentta.SetTileMethod('=', lisaaLinna); 
     59        kentta.SetTileMethod('+', lisaaPortti); 
     60        kentta.SetTileMethod('$', lisaaAarre); 
     61        kentta.SetTileMethod('O', lisaaPilvi); 
     62        kentta.SetTileMethod('@', lisaaAurinko); 
     63        kentta.SetTileMethod('<', lisaaHakki); 
    4864        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4965        Level.CreateBorders(); 
     
    5369    } 
    5470 
     71    void LuoAjastimet() 
     72    { 
     73        Timer Ajastin = new Timer(); 
     74        Ajastin.Interval = 3; 
     75        Ajastin.Timeout += LuoHirvio ; 
     76        Ajastin.Start(); 
     77 
     78    } 
     79 
    5580    void lisaaTaso(Vector paikka, double leveys, double korkeus) 
    5681    { 
     
    92117    } 
    93118 
     119    void lisaaPortti(Vector paikka, double leveys, double korkeus) 
     120    { 
     121        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     122        taso.Position = paikka; 
     123        taso.Image = Portti; 
     124        Add(taso); 
     125    } 
     126 
     127    void lisaaAarre(Vector paikka, double leveys, double korkeus) 
     128    { 
     129        Arkku = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     130        Arkku.Position = paikka; 
     131        Arkku.Image = Aarre; 
     132        Add(Arkku); 
     133    } 
     134 
     135    void lisaaPilvi(Vector paikka, double leveys, double korkeus) 
     136    { 
     137        PhysicsObject taso = PhysicsObject.CreateStaticObject(200, 100); 
     138        taso.Position = paikka; 
     139        taso.Image = Pilvi; 
     140        Add(taso); 
     141        taso.IgnoresCollisionResponse = true; 
     142    } 
     143 
     144    void lisaaAurinko(Vector paikka, double leveys, double korkeus) 
     145    { 
     146        PhysicsObject taso = PhysicsObject.CreateStaticObject(200, 200); 
     147        taso.Position = paikka; 
     148        taso.Image = Aurinko; 
     149        Add(taso); 
     150        taso.IgnoresCollisionResponse = true; 
     151    } 
     152 
     153    void lisaaHakki(Vector paikka, double leveys, double korkeus) 
     154    { 
     155        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     156        taso.Position = paikka; 
     157        taso.Image = Hakki; 
     158        Add(taso); 
     159        taso.IgnoresCollisionResponse = true; 
     160    } 
    94161 
    95162    void lisaaTahti(Vector paikka, double leveys, double korkeus) 
     
    105172    void lisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    106173    { 
    107         pelaaja1 = new PlatformCharacter(leveys, korkeus); 
     174        pelaaja1 = new PlatformCharacter(leveys * 0.7, korkeus); 
    108175        pelaaja1.Position = paikka; 
    109176        pelaaja1.Mass = 4.0; 
     
    111178        AddCollisionHandler(pelaaja1, kasittelePelaajanTormays); 
    112179        Add(pelaaja1); 
     180        Jousi = new GameObject(60, 60); 
     181        Jousi.Image = JousiKuva; 
     182        pelaaja1.Add(Jousi); 
     183        pelaaja1.CollisionIgnoreGroup = 1; 
    113184    } 
    114185 
     
    130201 
    131202        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    132     } 
     203 
     204        Mouse.IsCursorVisible = true; 
     205        Mouse.ListenMovement(0.1, KuunteleLiiketta, null); 
     206        Mouse.Listen(MouseButton.Left, ButtonState.Pressed, Ammu, "Ammu"); 
     207    } 
     208 
     209    void KuunteleLiiketta(AnalogState hiirenTila) 
     210    { 
     211        Jousi.AbsoluteAngle = (Mouse.PositionOnWorld - pelaaja1.Position).Angle; 
     212 
     213        //Vector hiirenLiike = hiirenTila.MouseMovement; 
     214    } 
     215 
     216 
     217 
    133218 
    134219    void liikuta(PlatformCharacter hahmo, double nopeus) 
     
    144229    void kasittelePelaajanTormays(PhysicsObject hahmo, PhysicsObject kohde) 
    145230    { 
    146         if (kohde.Tag.ToString() == "tahti") 
     231        if (kohde.Tag.ToString() == "Hirvio") 
    147232        { 
    148             maaliAani.Play(); 
    149             MessageDisplay.Add("Keräsit tähden!"); 
    150             kohde.Destroy(); 
     233            
     234            pelaaja1.Destroy(); 
     235            MessageDisplay.Add("GAME OVER"); 
    151236        } 
    152     } 
     237 
     238    } 
     239 
     240 
     241    void Ammu() 
     242    { 
     243        PhysicsObject Nuoli = new PhysicsObject(40, 10); 
     244        Nuoli.Position = pelaaja1.Position; 
     245        Add(Nuoli); 
     246        Nuoli.Hit((Mouse.PositionOnWorld - pelaaja1.Position) *10); 
     247        Nuoli.CollisionIgnoreGroup = 1; 
     248        Nuoli.Angle = Jousi.Angle; 
     249        Nuoli.Image = Ammus; 
     250        AddCollisionHandler(Nuoli, "Hirvio", HirvioKuoli); 
     251    } 
     252 
     253    void LuoHirvio () 
     254    { 
     255        PhysicsObject Hirvio = new PhysicsObject(40, 40); 
     256        PathFollowerBrain SeuraajanAivot = new PathFollowerBrain (); 
     257        Hirvio.Brain = SeuraajanAivot; 
     258        SeuraajanAivot.Active = true; 
     259        Hirvio.Shape = Shape.FromImage(HirvioKuva); 
     260        Hirvio.Image = HirvioKuva; 
     261        Hirvio.Top = Level.Top; 
     262        Hirvio.CanRotate = false; 
     263        Hirvio.Tag = ("Hirvio"); 
     264        Add (Hirvio); 
     265    } 
     266 
     267    void HirvioKuoli(PhysicsObject nuoli, PhysicsObject hirvio) 
     268    { 
     269 
     270    } 
     271 
    153272} 
  • 2012/24/EemeliKu/DefendTheTreasure/DefendTheTreasure/DefendTheTreasure/DefendTheTreasure.csproj.Debug.cachefile

    r2999 r3037  
    1010Content\Kallio.xnb 
    1111Content\Linna.xnb 
     12Content\Portti.xnb 
     13Content\Jousimies2.xnb 
     14Content\Jousi.xnb 
     15Content\Aarre.xnb 
     16Content\Pilvi.xnb 
     17Content\Aurinko.xnb 
     18Content\Hakki.xnb 
     19Content\Ammus.xnb 
     20Content\Hirvio.xnb 
    1221kentta1.txt 
  • 2012/24/EemeliKu/DefendTheTreasure/DefendTheTreasure/DefendTheTreasure/bin/x86/Debug/kentta1.txt

    r2999 r3037  
    1  
     1                             O 
    22       
    3  
     3                        @                        O 
    44       
    5         
     5                                               
    66 
    77     
    88      
     9 = = = = =                                           = = = = = 
     10 =========                                           ========= 
     11 =========                                           ========= 
     12 ===+++===                  ##########               ==    === 
     13 ===+++===       N       ####%%%%%%%%######              <<=== 
     14 #########&   ############%%%%-------%%%%#######&&&&########## 
     15 %%%======                                           =======%% 
     16 %%%=    =                                           =     <%% 
     17 %%%=$                                                     <%% 
     18 %%%======#####%%%%-----%%&&&&&&&%%%%%%%%%%%%%%%%####======--- 
     19 %%%%%%%%%%%%%%%%---------       ---%%%%%%%--------%%%%%%%%%%% 
     20 %%%%%%%%%--------------%-       ----------------------------- 
     21 %%%%%------------%%------       -----------%%%%%%------------ 
     22 %-------%%%-------%%-----       -----%%---------------------- 
     23 -------------------------       ----------------------------- 
     24 -------------------------       ----------------------------- 
     25 -------------------------       ----------------------------- 
     26 -------------------------       ----------------------------- 
    927 
    10  = = = =                                            = = = = = 
    11  ========                                           ========= 
    12  ===  ===                  ##########               ===  ==== 
    13  ===  ===       N       ####%%%%%%%%######          ===  ==== 
    14  ########    ############%%%%-------%%%%#######     ######### 
    15  %%                                                        %% 
    16  %%                                                        %% 
    17  %%                                                        %% 
    18  %%%%%%%%#####%%%%-----%%&&&&&&&%%%%%%%%%%%%%%%%######%%%%--- 
    19  %%%%%%%%%%%%%%%---------       ---%%%%%%%--------%%%%%%%%%%% 
    20  %%%%%%%%----------------       ----------------------------- 
    21  
    22  
    23  
  • 2012/24/EemeliKu/DefendTheTreasure/DefendTheTreasure/DefendTheTreasure/kentta1.txt

    r2999 r3037  
    1  
     1                             O 
    22       
    3  
     3                        @                        O 
    44       
    5         
     5                                               
    66 
    77     
    88      
     9 = = = = =                                           = = = = = 
     10 =========                                           ========= 
     11 =========                                           ========= 
     12 ===+++===                  ##########               ==    === 
     13 ===+++===       N       ####%%%%%%%%######              <<=== 
     14 #########&   ############%%%%-------%%%%#######&&&&########## 
     15 %%%======                                           =======%% 
     16 %%%=    =                                           =     <%% 
     17 %%%=$                                                     <%% 
     18 %%%======#####%%%%-----%%&&&&&&&%%%%%%%%%%%%%%%%####======--- 
     19 %%%%%%%%%%%%%%%%---------       ---%%%%%%%--------%%%%%%%%%%% 
     20 %%%%%%%%%--------------%-       ----------------------------- 
     21 %%%%%------------%%------       -----------%%%%%%------------ 
     22 %-------%%%-------%%-----       -----%%---------------------- 
     23 -------------------------       ----------------------------- 
     24 -------------------------       ----------------------------- 
     25 -------------------------       ----------------------------- 
     26 -------------------------       ----------------------------- 
    927 
    10  = = = =                                            = = = = = 
    11  ========                                           ========= 
    12  ===  ===                  ##########               ===  ==== 
    13  ===  ===       N       ####%%%%%%%%######          ===  ==== 
    14  ########    ############%%%%-------%%%%#######     ######### 
    15  %%                                                        %% 
    16  %%                                                        %% 
    17  %%                                                        %% 
    18  %%%%%%%%#####%%%%-----%%&&&&&&&%%%%%%%%%%%%%%%%######%%%%--- 
    19  %%%%%%%%%%%%%%%---------       ---%%%%%%%--------%%%%%%%%%%% 
    20  %%%%%%%%----------------       ----------------------------- 
    21  
    22  
    23  
  • 2012/24/EemeliKu/DefendTheTreasure/DefendTheTreasure/DefendTheTreasure/obj/x86/Debug/DefendTheTreasure.csproj.FileListAbsolute.txt

    r2999 r3037  
    1919C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Kallio.xnb 
    2020C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Linna.xnb 
     21C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Portti.xnb 
     22C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Jousimies2.xnb 
     23C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Jousi.xnb 
     24C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Aarre.xnb 
     25C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Pilvi.xnb 
     26C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Aurinko.xnb 
     27C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Hakki.xnb 
     28C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Ammus.xnb 
     29C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Hirvio.xnb 
  • 2012/24/EemeliKu/DefendTheTreasure/DefendTheTreasure/DefendTheTreasure/obj/x86/Debug/cachefile-{52FEC355-BB49-4C62-A839-93CA6E9D29FD}-targetpath.txt

    r2999 r3037  
    1010Content\Kallio.xnb 
    1111Content\Linna.xnb 
     12Content\Portti.xnb 
     13Content\Jousimies2.xnb 
     14Content\Jousi.xnb 
     15Content\Aarre.xnb 
     16Content\Pilvi.xnb 
     17Content\Aurinko.xnb 
     18Content\Hakki.xnb 
     19Content\Ammus.xnb 
     20Content\Hirvio.xnb 
  • 2012/24/EemeliKu/DefendTheTreasure/DefendTheTreasure/DefendTheTreasureContent/DefendTheTreasureContent.contentproj

    r2999 r3037  
    117117    </Compile> 
    118118  </ItemGroup> 
     119  <ItemGroup> 
     120    <Compile Include="Portti.png"> 
     121      <Name>Portti</Name> 
     122      <Importer>TextureImporter</Importer> 
     123      <Processor>TextureProcessor</Processor> 
     124    </Compile> 
     125  </ItemGroup> 
     126  <ItemGroup> 
     127    <Compile Include="Jousimies2.png"> 
     128      <Name>Jousimies2</Name> 
     129      <Importer>TextureImporter</Importer> 
     130      <Processor>TextureProcessor</Processor> 
     131    </Compile> 
     132  </ItemGroup> 
     133  <ItemGroup> 
     134    <Compile Include="Jousi.png"> 
     135      <Name>Jousi</Name> 
     136      <Importer>TextureImporter</Importer> 
     137      <Processor>TextureProcessor</Processor> 
     138    </Compile> 
     139  </ItemGroup> 
     140  <ItemGroup> 
     141    <Compile Include="Aarre.png"> 
     142      <Name>Aarre</Name> 
     143      <Importer>TextureImporter</Importer> 
     144      <Processor>TextureProcessor</Processor> 
     145    </Compile> 
     146  </ItemGroup> 
     147  <ItemGroup> 
     148    <Compile Include="Pilvi.png"> 
     149      <Name>Pilvi</Name> 
     150      <Importer>TextureImporter</Importer> 
     151      <Processor>TextureProcessor</Processor> 
     152    </Compile> 
     153  </ItemGroup> 
     154  <ItemGroup> 
     155    <Compile Include="Aurinko.png"> 
     156      <Name>Aurinko</Name> 
     157      <Importer>TextureImporter</Importer> 
     158      <Processor>TextureProcessor</Processor> 
     159    </Compile> 
     160  </ItemGroup> 
     161  <ItemGroup> 
     162    <Compile Include="Hakki.png"> 
     163      <Name>Hakki</Name> 
     164      <Importer>TextureImporter</Importer> 
     165      <Processor>TextureProcessor</Processor> 
     166    </Compile> 
     167  </ItemGroup> 
     168  <ItemGroup> 
     169    <Compile Include="Ammus.png"> 
     170      <Name>Ammus</Name> 
     171      <Importer>TextureImporter</Importer> 
     172      <Processor>TextureProcessor</Processor> 
     173    </Compile> 
     174  </ItemGroup> 
     175  <ItemGroup> 
     176    <Compile Include="Hirvio.png"> 
     177      <Name>Hirvio</Name> 
     178      <Importer>TextureImporter</Importer> 
     179      <Processor>TextureProcessor</Processor> 
     180    </Compile> 
     181  </ItemGroup> 
    119182  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    120183  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2012/24/EemeliKu/DefendTheTreasure/DefendTheTreasure/DefendTheTreasureContent/obj/x86/Debug/ContentPipeline.xml

    r2999 r3037  
    9999      <Options>None</Options> 
    100100      <Output>C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Linna.xnb</Output> 
    101       <Time>2012-06-13T14:51:06.9711852+03:00</Time> 
     101      <Time>2012-06-14T09:33:49.2394692+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>Portti.png</Source> 
     105      <Name>Portti</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108      <Options>None</Options> 
     109      <Output>C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Portti.xnb</Output> 
     110      <Time>2012-06-14T11:44:34.7827156+03:00</Time> 
     111    </Item> 
     112    <Item> 
     113      <Source>Jousimies2.png</Source> 
     114      <Name>Jousimies2</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Jousimies2.xnb</Output> 
     119      <Time>2012-06-14T14:10:15.8504343+03:00</Time> 
     120    </Item> 
     121    <Item> 
     122      <Source>Jousi.png</Source> 
     123      <Name>Jousi</Name> 
     124      <Importer>TextureImporter</Importer> 
     125      <Processor>TextureProcessor</Processor> 
     126      <Options>None</Options> 
     127      <Output>C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Jousi.xnb</Output> 
     128      <Time>2012-06-14T12:45:50.7412771+03:00</Time> 
     129    </Item> 
     130    <Item> 
     131      <Source>Aarre.png</Source> 
     132      <Name>Aarre</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135      <Options>None</Options> 
     136      <Output>C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Aarre.xnb</Output> 
     137      <Time>2012-06-14T12:16:44.4563156+03:00</Time> 
     138    </Item> 
     139    <Item> 
     140      <Source>Pilvi.png</Source> 
     141      <Name>Pilvi</Name> 
     142      <Importer>TextureImporter</Importer> 
     143      <Processor>TextureProcessor</Processor> 
     144      <Options>None</Options> 
     145      <Output>C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Pilvi.xnb</Output> 
     146      <Time>2012-06-14T12:52:14.9880771+03:00</Time> 
     147    </Item> 
     148    <Item> 
     149      <Source>Aurinko.png</Source> 
     150      <Name>Aurinko</Name> 
     151      <Importer>TextureImporter</Importer> 
     152      <Processor>TextureProcessor</Processor> 
     153      <Options>None</Options> 
     154      <Output>C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Aurinko.xnb</Output> 
     155      <Time>2012-06-14T13:06:59.7720771+03:00</Time> 
     156    </Item> 
     157    <Item> 
     158      <Source>Hakki.png</Source> 
     159      <Name>Hakki</Name> 
     160      <Importer>TextureImporter</Importer> 
     161      <Processor>TextureProcessor</Processor> 
     162      <Options>None</Options> 
     163      <Output>C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Hakki.xnb</Output> 
     164      <Time>2012-06-14T13:41:47.1916343+03:00</Time> 
     165    </Item> 
     166    <Item> 
     167      <Source>Ammus.png</Source> 
     168      <Name>Ammus</Name> 
     169      <Importer>TextureImporter</Importer> 
     170      <Processor>TextureProcessor</Processor> 
     171      <Options>None</Options> 
     172      <Output>C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Ammus.xnb</Output> 
     173      <Time>2012-06-14T13:51:32.8388343+03:00</Time> 
     174    </Item> 
     175    <Item> 
     176      <Source>Hirvio.png</Source> 
     177      <Name>Hirvio</Name> 
     178      <Importer>TextureImporter</Importer> 
     179      <Processor>TextureProcessor</Processor> 
     180      <Options>None</Options> 
     181      <Output>C:\MyTemp\EemeliKu\DefendTheTreasure\DefendTheTreasure\DefendTheTreasure\bin\x86\Debug\Content\Hirvio.xnb</Output> 
     182      <Time>2012-06-14T14:04:13.5094343+03:00</Time> 
    102183    </Item> 
    103184    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.