Changeset 1691
- Timestamp:
- 2010-08-19 16:33:45 (13 years ago)
- Location:
- 2010/31/rimapuha
- Files:
-
- 134 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/31/rimapuha/NorsuPeli/NorsuPeli/Content/Content.contentproj
r1663 r1691 55 55 </ItemGroup> 56 56 <ItemGroup> 57 <Compile Include="norsu2.png">58 <Name>norsu2</Name>59 <Importer>TextureImporter</Importer>60 <Processor>TextureProcessor</Processor>61 </Compile>62 </ItemGroup>63 <ItemGroup>64 57 <Compile Include="maali2.png"> 65 58 <Name>maali2</Name> … … 103 96 </Compile> 104 97 </ItemGroup> 98 <ItemGroup> 99 <Compile Include="karhukopla.png"> 100 <Name>karhukopla</Name> 101 <Importer>TextureImporter</Importer> 102 <Processor>TextureProcessor</Processor> 103 </Compile> 104 </ItemGroup> 105 <ItemGroup> 106 <Compile Include="tiili.png"> 107 <Name>tiili</Name> 108 <Importer>TextureImporter</Importer> 109 <Processor>TextureProcessor</Processor> 110 </Compile> 111 </ItemGroup> 112 <ItemGroup> 113 <Compile Include="taustagraffiti.png"> 114 <Name>taustagraffiti</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 </Compile> 118 </ItemGroup> 119 <ItemGroup> 120 <Compile Include="lintu-1 kavelee.png"> 121 <Name>lintu-1 kavelee</Name> 122 <Importer>TextureImporter</Importer> 123 <Processor>TextureProcessor</Processor> 124 </Compile> 125 </ItemGroup> 126 <ItemGroup> 127 <Compile Include="lintu-1 kavelee2.png"> 128 <Name>lintu-1 kavelee2</Name> 129 <Importer>TextureImporter</Importer> 130 <Processor>TextureProcessor</Processor> 131 </Compile> 132 </ItemGroup> 133 <ItemGroup> 134 <Compile Include="lintu-1 hyppaa.png"> 135 <Name>lintu-1 hyppaa</Name> 136 <Importer>TextureImporter</Importer> 137 <Processor>TextureProcessor</Processor> 138 </Compile> 139 </ItemGroup> 105 140 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 106 141 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2010/31/rimapuha/NorsuPeli/NorsuPeli/NorsuPeli.csproj
r1598 r1691 16 16 <Thumbnail>GameThumbnail.png</Thumbnail> 17 17 <IsWebBootstrapper>false</IsWebBootstrapper> 18 <ManifestCertificateThumbprint>6D0813EC5EA172F5950BA71A54D20365F0208272</ManifestCertificateThumbprint> 19 <ManifestKeyFile>NorsuPeli_TemporaryKey.pfx</ManifestKeyFile> 20 <GenerateManifests>true</GenerateManifests> 21 <SignManifests>true</SignManifests> 18 22 <PublishUrl>publish\</PublishUrl> 19 23 <Install>true</Install> … … 26 30 <UpdateRequired>false</UpdateRequired> 27 31 <MapFileExtensions>true</MapFileExtensions> 28 <ApplicationRevision> 0</ApplicationRevision>32 <ApplicationRevision>1</ApplicationRevision> 29 33 <ApplicationVersion>1.0.0.%2a</ApplicationVersion> 30 34 <UseApplicationTrust>false</UseApplicationTrust> … … 36 40 <Optimize>false</Optimize> 37 41 <OutputPath>bin\x86\Debug</OutputPath> 38 <DefineConstants> DEBUG;TRACE;WINDOWS</DefineConstants>42 <DefineConstants>WINDOWS</DefineConstants> 39 43 <ErrorReport>prompt</ErrorReport> 40 44 <WarningLevel>4</WarningLevel> … … 92 96 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 93 97 </None> 98 <None Include="NorsuPeli_TemporaryKey.pfx" /> 94 99 </ItemGroup> 95 100 <ItemGroup> -
2010/31/rimapuha/NorsuPeli/NorsuPeli/Peli.cs
r1663 r1691 7 7 class Tasohyppely : PhysicsGame 8 8 { 9 const double nopeus = 500;9 const double nopeus = 380; 10 10 const double hyppyVoima = 4000; 11 11 const int ruudunLeveys = 50; … … 36 36 void laskuriYlarajassa(int arvo) 37 37 { 38 MessageDisplay.TextColor = Color. White;39 MessageDisplay.Add(" Pelaaja 1 voitti pelin.");38 MessageDisplay.TextColor = Color.Black; 39 MessageDisplay.Add("Voitit pelin"); 40 40 } 41 41 42 42 43 43 PlatformCharacter pelaaja1; 44 //PlatformCharacter pelaaja2;44 // PlatformCharacter pelaaja2; 45 45 46 46 Image tahtiKuva = LoadImage("Untitled"); 47 //Image taustaKuva = LoadImage("taustagraffiti"); 47 48 48 49 List<Label> valikonKohdat; … … 57 58 valikonKohdat.Add(kohta1); 58 59 59 //Label kohta2 = new Label("High Scores"); 60 //kohta2.Position = new Vector(0, 40); 61 //valikonKohdat.Add(kohta2); 62 60 /*Label kohta2 = new Label("High Scores"); 61 kohta2.Position = new Vector(0, 40); 62 valikonKohdat.Add(kohta2); 63 */ 64 63 65 Label kohta2 = new Label("Lopeta"); 64 66 kohta2.Position = new Vector(0, -40); … … 108 110 Camera.ZoomFactor = 1.5; 109 111 Camera.StayInLevel = true; 112 // Level.Background.Image = taustaKuva; 113 110 114 111 115 … … 118 122 119 123 //HighScoreList dddtopLista; 124 125 126 120 127 protected override void Begin() 121 128 { … … 125 132 topLista.ScreenList.ItemColor = Color.Red; 126 133 topLista.ScreenList.BackGroundColor = Color.Black; 127 * */134 */ 128 135 Valikko(); 129 136 … … 144 151 void LuoKentta() 145 152 { 153 //Image taustaKuva = LoadImage("taustagraffiti"); 146 154 TileMap ruudut = TileMap.FromFile("kentta.txt"); 147 155 ruudut['='] = LuoPalikka; … … 157 165 { 158 166 PhysicsObject palikka = PhysicsObject.CreateStaticObject(50, 50); 159 palikka.Image = LoadImage (" seina");167 palikka.Image = LoadImage ("tiili"); 160 168 return palikka; 161 169 } … … 164 172 { 165 173 GameObject valeseina = new GameObject(50, 50); 166 valeseina.Image = LoadImage(" valeseina");174 valeseina.Image = LoadImage("tiili"); 167 175 return valeseina; 168 176 } … … 179 187 { 180 188 PhysicsObject maali = PhysicsObject.CreateStaticObject(50.0, 50.0); 189 181 190 maali.Image = LoadImage("maali2"); 182 191 AddCollisionHandler(maali, Tormays2); … … 190 199 if (kohde == pelaaja1) 191 200 192 MessageDisplay.Add("Sait pisteen!!!");201 //MessageDisplay.Add("Sait pisteen!!!"); 193 202 pisteLaskuri.Value += 1; 194 203 tahti.Destroy(); … … 196 205 void Tormays2(PhysicsObject maali, PhysicsObject kohde) 197 206 { 198 if (kohde == pelaaja1 && pisteLaskuri.Value >= 80)207 if (kohde == pelaaja1 && pisteLaskuri.Value >= 20) 199 208 { 200 209 ClearAll(); 210 PlaySound("maali"); 201 211 MessageDisplay.Add("Voitit pelin!!!"); 202 212 Valikko(); … … 207 217 PhysicsObject LuoPelaaja1() 208 218 { 209 pelaaja1 = new PlatformCharacter(40, 40); 210 pelaaja1.Mass = 4.0; 211 pelaaja1.Image = LoadImage("norsu"); 219 pelaaja1 = new PlatformCharacter(50, 40); 220 pelaaja1.Mass = 5.0; 221 pelaaja1.Image = LoadImage("lintu-1 kavelee"); 222 //pelaaja1.CanRotate = true; 223 212 224 return (PhysicsObject)pelaaja1; 213 225 } 214 226 215 227 216 //PhysicsObject LuoPelaaja2()217 //{218 //pelaaja2 = new PlatformCharacter(40, 40);219 //pelaaja2.Mass = 4.0;220 //pelaaja2.Image = LoadImage("norsu2");221 //return (PhysicsObject)pelaaja2;222 //}223 228 /*PhysicsObject LuoPelaaja2() 229 { 230 pelaaja2 = new PlatformCharacter(40, 40); 231 pelaaja2.Mass = 4.0; 232 pelaaja2.Image = LoadImage("norsu2"); 233 return (PhysicsObject)pelaaja2; 234 } 235 */ 224 236 225 237 void lisaaNappaimet() … … 233 245 Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "Hyppää", pelaaja1, hyppyVoima); 234 246 235 Keyboard.Listen(Key.Down, ButtonState.Down, HeitaKranaatti, "Heitä kranaatti", pelaaja1);247 //Keyboard.Listen(Key.Down, ButtonState.Down, HeitaKranaatti, "Heitä kranaatti", pelaaja1); 236 248 237 249 //Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, -nopeus); … … 247 259 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 248 260 ControllerOne.Listen(Button.LeftTrigger, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyVoima); 249 ControllerOne.Listen(Button.RightTrigger, ButtonState.Pressed, HeitaKranaatti, "heittää kranaatin", pelaaja1);261 //ControllerOne.Listen(Button.RightTrigger, ButtonState.Pressed, HeitaKranaatti, "heittää kranaatin", pelaaja1); 250 262 } 251 263 … … 254 266 void liikuta(PlatformCharacter hahmo, double nopeus) 255 267 { 268 if (hahmo.FacingDirection == Direction.Left) 269 { 270 hahmo.Image = LoadImage("lintu-1 kavelee2"); 271 } 272 273 else if (hahmo.FacingDirection == Direction.Right) 274 { 275 hahmo.Image = LoadImage("lintu-1 kavelee"); 276 } 277 278 256 279 hahmo.Walk(nopeus); 280 281 257 282 } 258 283 259 284 void hyppaa(PlatformCharacter hahmo, double voima) 260 285 { 286 if (hahmo.FacingDirection == Direction.Up) 287 { 288 hahmo.Image = LoadImage("lintu-1 hyppaa"); 289 } 261 290 hahmo.Jump(voima); 262 291 } -
2010/31/rimapuha/NorsuPeli/NorsuPeli/kentta.txt
r1663 r1691 1 ======================================================================= ============2 = *= =3 =****====****************=**=*********=====***** =4 ===== ==== == =5 = 6 = =====7 = 1 =======================================================================++++++++++++ 2 = *= + 3 =****====****************=**=*********=====***** + 4 =====++++==== == + 5 =++++++++++++==== =========================== = 6 =++++++++++++++++====++++++++++++++++= = 7 =++++++++++++++++++++++++++++++++++++= * = 8 8 ====================================== ======== ** === = 9 =+++++++++++++++++++++++++= ======== =******= === *** =9 ++++++++++++++++++++++++++= ======== =******= === *** = 10 10 =========================== = == == ******= *** = 11 11 =* == = = == ============= = 12 12 =============================== = = ====== = 13 =+++++++++++++++++++++++++++++======== = === =13 +++++++++++++++++++++++++++++++======= = === = 14 14 ====================================== = === = 15 15 = = === ** **= 16 16 = ***** = ======== **=+ 17 = ================ **= =+18 = =++++++++++++ === ****==++19 = =++++++++ =====*= =========17 = ================ **=++ 18 = =+++++++++++++== ****=+++ 19 = =+++++++++====*= ========= 20 20 = ==========* = === = 21 21 = 0 === * = 22 ================================================ ** =========== = =23 = * ===================== = =+24 = * ======= * = =++25 = ===== ==== =+++++= =======================22 ================================================ ** =========== =+ 23 = * ===================== =++ 24 = * ======= * =+++ 25 = ===== ====++++++= =====================++ 26 26 =* =+++++++++= *=+ 27 == * * ======= =+++++++++===================== **=+28 + == ================ =++++++++++++================== *==+29 ++ == =++++++++++++=*** * * * * **==++30 +++ == ======================================================31 ++++ == 21* =27 += * * ======= =++++++++++==================== **=+ 28 ++= ================ =+++++++++++++================= *=++ 29 +++= =++++++++++++=*** * * * * **=+++ 30 ++++= ==================================== ===== ======= 31 +++++= 21 = * * = 32 32 +++++==============================================================================
Note: See TracChangeset
for help on using the changeset viewer.