Changeset 3956 for 2012/kerho
- Timestamp:
- 2013-04-27 16:11:51 (8 years ago)
- Location:
- 2012/kerho/IlmariT
- Files:
-
- 4 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/kerho/IlmariT/NINJAGAME/NINJAGAME/NINJAGAME.cs
r3930 r3956 25 25 SoundEffect maaliAani = LoadSoundEffect("maali"); 26 26 27 private Image[] ninjanKavely = LoadImages("NINJAGAME", "NINJAGAME2"); 28 private Image[] ninjanPaikallaanolo = LoadImages("NINJAGAME"); 29 30 Image taustaKuva = LoadImage("Cityyyyyy!"); 31 32 int kenttaNro = 1; 33 27 34 public override void Begin() 28 { 35 { 36 SeuraavaKentta(); 37 38 39 } 40 41 void SeuraavaKentta() 42 { 43 ClearAll(); 44 ClearControls(); 45 46 LuoPistelaskuri(); 47 48 if (kenttaNro == 1) LuoKentta("kentta1"); 49 else if (kenttaNro == 2) LuoKentta("kentta2"); 50 else if (kenttaNro == 3) LuoKentta("kentta3"); 51 else if (kenttaNro > 3) Exit(); 52 53 MessageDisplay.Add("Kerää " + pisteLaskuri.MaxValue + " expapalleroa!"); 29 54 Gravity = new Vector(0, -1000); 30 31 L uoKentta();55 Level.Background.Image = taustaKuva; 56 Level.Background.FitToLevel(); 32 57 LisaaNappaimet(); 33 34 58 Camera.Follow(pelaaja1); 35 59 Camera.ZoomFactor = 1.2; … … 37 61 } 38 62 39 void LuoKentta() 40 { 41 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 63 64 IntMeter pisteLaskuri; 65 66 void LuoPistelaskuri() 67 { 68 pisteLaskuri = new IntMeter(0); 69 pisteLaskuri.MaxValue = 0; 70 pisteLaskuri.UpperLimit += KaikkiKeratty; 71 72 Label pisteNaytto = new Label(); 73 pisteNaytto.X = Screen.Left + 400; 74 pisteNaytto.Y = Screen.Top - 50; 75 pisteNaytto.TextColor = Color.Black; 76 pisteNaytto.Color = Color.White; 77 78 pisteNaytto.BindTo(pisteLaskuri); 79 Add(pisteNaytto); 80 } 81 82 void LuoKentta(string kentanNimi) 83 { 84 TileMap kentta = TileMap.FromLevelAsset(kentanNimi); 42 85 kentta.SetTileMethod('#', LisaaTaso); 43 86 kentta.SetTileMethod('*', LisaaTahti); … … 46 89 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 47 90 Level.CreateBorders(); 91 PhysicsObject alareuna = Level.CreateBottomBorder(); 92 AddCollisionHandler(pelaaja1, alareuna, PutoaaRotkoon); 93 48 94 // Level.Background.CreateGradient(Color.White, Color.SkyBlue); 49 95 } … … 65 111 tahti.Image = tahtiKuva; 66 112 tahti.Tag = "tahti"; 113 pisteLaskuri.MaxValue += 1; 67 114 Add(tahti); 68 115 } … … 84 131 pelaaja1.Mass = 4.0; 85 132 pelaaja1.Image = pelaajanKuva; 86 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 133 //pelaaja1.Animation.FPS = 1; 134 //pelaaja1.AnimIdle = new Animation(ninjanPaikallaanolo); 135 //pelaaja1.AnimWalk = new Animation(ninjanKavely); 136 //pelaaja1.Animation.Start(); 137 AddCollisionHandler(pelaaja1, "tahti", TormaaExpapalloon); 87 138 AddCollisionHandler(pelaaja1, "vihu", TormaaViholliseen); 88 139 Add(pelaaja1); … … 130 181 } 131 182 132 void Tormaa Tahteen(PhysicsObject hahmo, PhysicsObject tahti)183 void TormaaExpapalloon(PhysicsObject hahmo, PhysicsObject expapallo) 133 184 { 134 185 maaliAani.Play(); 135 186 MessageDisplay.Add("PUHKAISIT EXPAPALLERON POKS!"); 136 tahti.Destroy(); 187 expapallo.Destroy(); 188 pisteLaskuri.AddValue(1); 137 189 } 138 190 … … 141 193 maaliAani.Play(); 142 194 143 if (hahmo.Tag == "lyo") vihu.Destroy();195 if (hahmo.Tag.Equals("lyo")) vihu.Destroy(); 144 196 else 145 197 { 146 MessageDisplay.Add("KUOLIT! :("); 147 hahmo.Destroy(); 198 Kuoleminen(hahmo); 148 199 149 200 Level.BackgroundColor = Color.DarkRed; 150 201 } 151 202 } 203 204 void KaikkiKeratty() 205 { 206 kenttaNro = kenttaNro + 1; 207 SeuraavaKentta(); 208 } 209 210 void PutoaaRotkoon(PhysicsObject hahmo, PhysicsObject rotko) 211 { 212 Kuoleminen(hahmo); 213 } 214 215 void Kuoleminen(PhysicsObject hahmo) 216 { 217 MessageDisplay.Add("KUOLIT"); 218 hahmo.Destroy(); 219 Timer.SingleShot(2, SeuraavaKentta); 220 } 152 221 } -
2012/kerho/IlmariT/NINJAGAME/NINJAGAME/NINJAGAME.csproj.Debug.cachefile
r3930 r3956 1 1 Content\maali.xnb 2 2 Content\norsu.xnb 3 Content\kentta1.xnb4 3 Content\NINJAGAME.xnb 5 4 Content\PISTE.xnb … … 7 6 Content\Lyo.xnb 8 7 Content\juddua.xnb 8 Content\kentta1.xnb 9 Content\kentta2.xnb 10 Content\Cityyyyyy!.xnb 11 Content\NINJAGAME2.xnb -
2012/kerho/IlmariT/NINJAGAME/NINJAGAME/bin/x86/Debug/Jypeli.xml
r3930 r3956 768 768 </summary> 769 769 </member> 770 <member name="M:Jypeli.PhysicsObject.MakeOneWay"> 771 <summary> 772 Tekee oliosta lÀpimentÀvÀn alhaalta ylöspÀin (tasohyppelytaso). 773 Huom. ei toimi yhdessÀ CollisionIgnoreGroupien kanssa! 774 </summary> 775 </member> 776 <member name="M:Jypeli.PhysicsObject.MakeOneWay(Jypeli.Vector)"> 777 <summary> 778 Tekee oliosta lÀpimentÀvÀn vektorin suuntaan. 779 Huom. ei toimi yhdessÀ CollisionIgnoreGroupien kanssa! 780 </summary> 781 </member> 770 782 <member name="M:Jypeli.PhysicsObject.CreatePhysicsShape(Jypeli.Shape,Jypeli.Vector,Jypeli.CollisionShapeParameters)"> 771 783 <summary> … … 2111 2123 </summary> 2112 2124 <param name="action"></param> 2125 </member> 2126 <member name="M:Jypeli.Game.DoNextUpdate``1(System.Action{``0},``0)"> 2127 <summary> 2128 Suorittaa aliohjelman seuraavalla pÀivityksellÀ. 2129 </summary> 2130 <typeparam name="T1"></typeparam> 2131 <param name="action"></param> 2132 <param name="p1"></param> 2133 </member> 2134 <member name="M:Jypeli.Game.DoNextUpdate``2(System.Action{``0,``1},``0,``1)"> 2135 <summary> 2136 Suorittaa aliohjelman seuraavalla pÀivityksellÀ. 2137 </summary> 2138 <typeparam name="T1"></typeparam> 2139 <typeparam name="T2"></typeparam> 2140 <param name="action"></param> 2141 <param name="p1"></param> 2142 <param name="p2"></param> 2113 2143 </member> 2114 2144 <member name="M:Jypeli.Game.AssertInitialized``1(System.Action{``0},``0)"> … … 2533 2563 <summary> 2534 2564 VÀri, jolla kentÀn reunat piirretÀÀn. 2565 </summary> 2566 </member> 2567 <member name="P:Jypeli.Game.SmoothTextures"> 2568 <summary> 2569 Tekstuurien (kuvien) reunanpehmennys skaalattaessa (oletus pÀÀllÀ). 2535 2570 </summary> 2536 2571 </member> … … 5766 5801 <param name="songName">Kappaleen nimi.</param> 5767 5802 </member> 5803 <member name="M:Jypeli.MediaPlayer.PlayFromFile(System.String)"> 5804 <summary> 5805 Soittaa kappaleen tiedostosta. 5806 </summary> 5807 <param name="fileName">Tiedoston nimi.</param> 5808 </member> 5809 <member name="M:Jypeli.MediaPlayer.PlayFromURL(System.String)"> 5810 <summary> 5811 Soittaa kappaleen nettiosoitteesta. 5812 </summary> 5813 <param name="url">Nettiosoite (URL).</param> 5814 </member> 5768 5815 <member name="M:Jypeli.MediaPlayer.Pause"> 5769 5816 <summary> … … 5793 5840 <member name="P:Jypeli.MediaPlayer.IsRepeating"> 5794 5841 <summary> 5795 Toistetaanko kappaleita. 5842 Toistetaanko kappaleita alusta. 5843 </summary> 5844 </member> 5845 <member name="P:Jypeli.MediaPlayer.IsPlaying"> 5846 <summary> 5847 Soitetaanko tÀllÀ hetkellÀ mitÀÀn. 5796 5848 </summary> 5797 5849 </member> … … 12013 12065 <param name="method">Aliohjelma, jota kutsutaan.</param> 12014 12066 </member> 12067 <member name="M:Jypeli.Meter`1.AddTrigger(`0,Jypeli.TriggerDirection,System.Action{`0})"> 12068 <summary> 12069 LisÀÀ mittarille rajan, jonka yli mentÀessÀ laukaistaan aliohjelma. 12070 </summary> 12071 <param name="value">Mittarin arvo</param> 12072 <param name="direction">Suunta (TriggerDirection.Irrelevant, TriggerDirection.Up tai TriggerDirection.Down)</param> 12073 <param name="method">Aliohjelma, jota kutsutaan (parametrina mittarin arvo).</param> 12074 </member> 12015 12075 <member name="M:Jypeli.Meter`1.RemoveTriggers(`0)"> 12016 12076 <summary> -
2012/kerho/IlmariT/NINJAGAME/NINJAGAME/obj/x86/Debug/ContentPipeline-{37C5FB37-634D-4895-860F-46E86F399A64}.xml
r3930 r3956 19 19 <Output>C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\norsu.xnb</Output> 20 20 <Time>2013-01-26T10:17:49.4256135+02:00</Time> 21 </Item>22 <Item>23 <Source>kentta1.txt</Source>24 <Name>kentta1</Name>25 <Importer>TextFileImporter</Importer>26 <Processor>TextFileContentProcessor</Processor>27 <Options>None</Options>28 <Output>C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\kentta1.xnb</Output>29 <Time>2013-01-26T16:06:34.5226135+02:00</Time>30 21 </Item> 31 22 <Item> … … 74 65 <Time>2013-01-26T15:47:14.3606135+02:00</Time> 75 66 </Item> 67 <Item> 68 <Source>kentta1.txt</Source> 69 <Name>kentta1</Name> 70 <Importer>TextFileImporter</Importer> 71 <Processor>TextFileContentProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\kentta1.xnb</Output> 74 <Time>2013-04-27T13:45:33.585341+03:00</Time> 75 </Item> 76 <Item> 77 <Source>kentta2.txt</Source> 78 <Name>kentta2</Name> 79 <Importer>TextFileImporter</Importer> 80 <Processor>TextFileContentProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\kentta2.xnb</Output> 83 <Time>2013-04-27T15:51:56.8455912+03:00</Time> 84 </Item> 85 <Item> 86 <Source>Cityyyyyy!.jpg</Source> 87 <Name>Cityyyyyy!</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\Cityyyyyy!.xnb</Output> 92 <Time>2013-04-27T14:58:30.9060293+03:00</Time> 93 </Item> 94 <Item> 95 <Source>NINJAGAME2.png</Source> 96 <Name>NINJAGAME2</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\NINJAGAME2.xnb</Output> 101 <Time>2013-04-27T15:23:09.8879127+03:00</Time> 102 </Item> 76 103 <BuildSuccessful>true</BuildSuccessful> 77 104 <Settings> … … 89 116 <Assembly> 90 117 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 91 <Value>2013-0 1-25T08:50:48+02:00</Value>118 <Value>2013-02-25T12:40:34+02:00</Value> 92 119 </Assembly> 93 120 <Assembly> … … 117 144 <Assembly> 118 145 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 119 <Value>2013-0 1-25T08:50:50+02:00</Value>146 <Value>2013-02-25T12:40:34+02:00</Value> 120 147 </Assembly> 121 148 <Assembly> -
2012/kerho/IlmariT/NINJAGAME/NINJAGAME/obj/x86/Debug/NINJAGAME.csproj.FileListAbsolute.txt
r3930 r3956 15 15 C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\Lyo.xnb 16 16 C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\juddua.xnb 17 C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\kentta2.xnb 18 C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\Cityyyyyy!.xnb 19 C:\MyTemp\ohjelmointikerho\NINJAGAME\NINJAGAME\NINJAGAME\bin\x86\Debug\Content\NINJAGAME2.xnb -
2012/kerho/IlmariT/NINJAGAME/NINJAGAME/obj/x86/Debug/cachefile-{37C5FB37-634D-4895-860F-46E86F399A64}-targetpath.txt
r3930 r3956 1 1 Content\maali.xnb 2 2 Content\norsu.xnb 3 Content\kentta1.xnb4 3 Content\NINJAGAME.xnb 5 4 Content\PISTE.xnb … … 7 6 Content\Lyo.xnb 8 7 Content\juddua.xnb 8 Content\kentta1.xnb 9 Content\kentta2.xnb 10 Content\Cityyyyyy!.xnb 11 Content\NINJAGAME2.xnb -
2012/kerho/IlmariT/NINJAGAME/NINJAGAMEContent/NINJAGAMEContent.contentproj
r3930 r3956 97 97 </Compile> 98 98 </ItemGroup> 99 <ItemGroup> 100 <Compile Include="kentta2.txt"> 101 <Name>kentta2</Name> 102 <Importer>TextFileImporter</Importer> 103 <Processor>TextFileContentProcessor</Processor> 104 </Compile> 105 </ItemGroup> 106 <ItemGroup> 107 <Compile Include="Cityyyyyy!.jpg"> 108 <Name>Cityyyyyy!</Name> 109 <Importer>TextureImporter</Importer> 110 <Processor>TextureProcessor</Processor> 111 </Compile> 112 </ItemGroup> 113 <ItemGroup> 114 <Compile Include="NINJAGAME2.png"> 115 <Name>NINJAGAME2</Name> 116 <Importer>TextureImporter</Importer> 117 <Processor>TextureProcessor</Processor> 118 </Compile> 119 </ItemGroup> 99 120 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 100 121 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2012/kerho/IlmariT/NINJAGAME/NINJAGAMEContent/kentta1.txt
r3930 r3956 5 5 6 6 7 8 7 **************** VVVVVVVV 8 **************** ######### 9 9 **** **************** 10 ## #### # # ##### ## ################ 10 ## #### # # ##### ## ################ * * * 11 11 *** 12 * * ****** ### 12 * * ****** ### * # # # # # # # # # ************** # # # # * 13 13 N ###### ##### ############ ############ ############# ############## ############## 14 14 ##### ##### ##### * ## ## ### 15 V # ### ************* *** # V ** 16 ################ #### ### ############ ########### ### ###### ## 15 V # ### ************* *** # V *** 16 ################ #### ### ############ ########### ### ###### ###
Note: See TracChangeset
for help on using the changeset viewer.