Changeset 7381 for 2016/24/EemeliN
- Timestamp:
- 2016-06-16 14:56:30 (7 years ago)
- Location:
- 2016/24/EemeliN/Test
- Files:
-
- 10 added
- 4 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/24/EemeliN/Test/Test/Test/Test.cs
r7331 r7381 12 12 PlatformCharacter Pelaaja2; 13 13 int kenttaNro = 1; 14 14 15 SoundEffect jungle = LoadSoundEffect("Jungle"); 15 16 16 17 Image pahisKuva = LoadImage("t04_evilrat"); … … 19 20 private Image[] Animaatio2 = LoadImages("Pelaaja2", "Pelaaja2a"); 20 21 22 Image kuva = LoadImage("Deagle"); 23 Image kuva2 = LoadImage("Cannon"); 24 25 21 26 public override void Begin() 22 27 { 23 LuoKentta("Kenttä");24 28 SeuraavaKentta(); 25 26 Gravity = new Vector(0, -500); 27 28 AsetaOhjaimet(); 29 30 Level.CreateBorders(); 31 SmoothTextures = true; 32 33 Pelaaja1.Restitution = 1.0; 34 Pelaaja1.Restitution = 1.0; 35 36 GameObject tausta = new GameObject(Level.Width, Level.Height); 37 tausta.Image = LoadImage("Tausta"); 38 Add(tausta, -3); 39 40 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 41 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 42 43 Camera.Follow(Pelaaja1, Pelaaja2); 44 Camera.StayInLevel = true; 45 Camera.FollowXMargin = 600; 46 Camera.FollowYMargin = 200; 29 TaustaMusiikki(); 30 31 47 32 } 48 33 … … 56 41 ruudut.SetTileMethod(Color.FromHexCode("FF6A00"), LuoMaali); 57 42 ruudut.SetTileMethod(Color.FromHexCode("B682FF"), LuoKanuunaVasen); 58 ruudut.SetTileMethod(Color.FromHexCode("FF006E"), LuoKanuunaOikea); 59 ruudut.SetTileMethod(Color.Yellow, LuoTaso2); 43 ruudut.SetTileMethod(Color.FromHexCode("82FFD9"), LuoKanuunaOikea); 44 ruudut.SetTileMethod(Color.FromHexCode("EE00FF"), LuoAse); 45 //ruudut.SetTileMethod(Color.FromHexCode("FFB7B5"), SpawnPoint); 60 46 ruudut.Execute(40, 40); 47 61 48 } 62 49 … … 69 56 else if (kenttaNro > 2) Exit(); 70 57 71 //ColorTileMap ruudut = ColorTileMap.FromLevelAsset(KentanNimi2); 72 //ruudut.SetTileMethod(Color.Yellow, LuoTaso2); 58 Gravity = new Vector(0, -800); 73 59 74 60 AsetaOhjaimet(); 75 61 76 } 77 78 62 Level.CreateBorders(); 63 SmoothTextures = false; 64 65 Pelaaja1.Restitution = 1.0; 66 Pelaaja1.Restitution = 1.0; 67 68 GameObject tausta = new GameObject(Level.Width, Level.Height); 69 tausta.Image = LoadImage("Tausta"); 70 Add(tausta, -3); 71 72 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 73 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 74 75 Camera.Follow(Pelaaja1, Pelaaja2); 76 Camera.StayInLevel = true; 77 Camera.FollowXMargin = 600; 78 Camera.FollowYMargin = 200; 79 80 81 AsetaOhjaimet(); 82 83 } 84 85 79 86 80 87 void AsetaOhjaimet() … … 98 105 void LuoPelaaja(Vector paikka, double leveys, double korkeus) 99 106 { 107 Image olionKuva = LoadImage("Abina"); 108 Image pelaaja2Kuva = LoadImage("pelaaja2"); 109 100 110 Pelaaja1 = new PlatformCharacter(leveys * 0.9, korkeus * 0.9); 101 111 Pelaaja1.Shape = Shape.Circle; 102 112 Pelaaja1.Position = paikka; 103 113 Pelaaja1.Image = olionKuva; 104 114 Add(Pelaaja1); 105 Pelaaja1.Shape = Shape.Circle;106 Image olionKuva = LoadImage("Abina");107 Pelaaja1.Image = olionKuva;108 115 109 116 Pelaaja2 = new PlatformCharacter(leveys * 0.9, korkeus * 0.9); … … 111 118 Pelaaja2.Position = paikka; 112 119 Pelaaja2.Shape = Shape.Circle; 113 Pelaaja2.Image = LoadImage("pelaaja2"); 120 Pelaaja2.Image = pelaaja2Kuva; 121 114 122 115 123 Pelaaja1.AnimWalk = new Animation(Animaatio); … … 124 132 Pelaaja1.CollisionIgnoreGroup = 100; 125 133 Pelaaja2.CollisionIgnoreGroup = 100; 126 127 } 128 134 AddCollisionHandler(Pelaaja1, "TormaaMaaliin", TormasiMaaliin); 135 AddCollisionHandler(Pelaaja2, "TormaaMaaliin", TormasiMaaliin); 136 137 AddCollisionHandler(Pelaaja1, "vihunammus", Kuolema); 138 AddCollisionHandler(Pelaaja2, "vihunammus", Kuolema); 139 } 140 void Kuolema(PhysicsObject Pelaaja, PhysicsObject ammus) 141 { 142 Pelaaja.Destroy(); 143 144 if (Pelaaja2.IsDestroying) 145 { 146 Camera.Follow(Pelaaja2); 147 } 148 if (Pelaaja1.IsDestroying) 149 { 150 Camera.Follow(Pelaaja1); 151 } 152 } 129 153 130 154 … … 144 168 taso.CollisionIgnoreGroup = 1; 145 169 taso.Image = LoadImage("MeteoriteBrick"); 146 Add(taso); 170 171 172 147 173 148 174 } … … 150 176 void LuoMaali(Vector paikka, double leveys, double korkeus) 151 177 { 152 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys *3, korkeus*3);178 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys * 3, korkeus * 3); 153 179 taso.Position = paikka; 154 180 taso.CollisionIgnoreGroup = 1; 155 181 taso.Image = LoadImage("Maali"); 182 taso.Tag = "TormaaMaaliin"; 156 183 Add(taso); 157 184 … … 176 203 Flame liekki = new Flame(LoadImage("Flame")); 177 204 liekki.Position = paikka; 178 liekki.MaxLifetime = 3;205 liekki.MaxLifetime = 2.5; 179 206 liekki.MaxScale = 100; 180 207 Add(liekki); 181 208 182 //int pMaxMaara = 50;183 184 185 } 186 187 188 209 int pMaxMaara = 500; 210 211 212 } 213 214 215 189 216 190 217 void LuoPahis(Vector paikka, double leveys, double korkeus) … … 201 228 void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 202 229 { 203 //ammus.Destroy(); 230 231 //AddCollisionHandler(Pelaaja1, ammus, KohteetTormaavat); 232 ammus.Destroy(); 233 Pelaaja1.Destroy(); 234 Pelaaja2.Destroy(); 204 235 } 205 236 … … 212 243 Add(tykkiTorni); 213 244 214 Image kuva = LoadImage("Deagle"); 245 215 246 Vector koko = new Vector(kuva.Width, kuva.Height) * 0.2; 216 247 … … 239 270 kuula.Image = LoadImage("t04_evilrat"); 240 271 kuula.Size *= 3; 272 kuula.Tag = "vihunammus"; 241 273 //boostaa ylös päälläseisottaessa jos kuulan koko = 130=D 242 274 //.CollisionIgnoreGroup = 30; … … 261 293 { 262 294 ammus.Destroy(); 263 //ammus.CollisionIgnoreGroup = 30; 264 } 295 ammus.CollisionIgnoreGroup = 30; 296 } 297 298 299 void LuoAse(Vector paikka, double leveys, double korkeus) 300 { 301 PhysicsObject Ase = new PhysicsObject(leveys, korkeus); 302 Ase.Image = null; 303 Ase.Position = paikka; 304 Ase.MakeStatic(); 305 Cannon tykki = new Cannon(50, 10); 306 //tykki.ProjectileCollision = AmmusOsui; 307 tykki.Ammo.Value = 500; 308 tykki.InfiniteAmmo = true; 309 tykki.Power.Value = 2000; 310 tykki.Power.DefaultValue = 2000; 311 tykki.FireRate = 5.0; 312 //Ase.AmmoIgnoresGravity = true; 313 tykki.AmmoIgnoresGravity = false; 314 tykki.MaxAmmoLifetime = TimeSpan.FromSeconds(2); 315 tykki.AttackSound = null; 316 tykki.Image = kuva2; 317 Ase.X = 10.0; 318 Ase.Y = -5.0; 319 Add(Ase); 320 } 321 322 void TaustaMusiikki() 323 { 324 325 326 MediaPlayer.Play("jungle"); 327 MediaPlayer.Volume = 10.0; 328 } 329 330 void KohteetTormaavat(PhysicsObject tormaaja, PhysicsObject kohde) 331 { 332 MessageDisplay.Add("Bump!"); 333 } 334 265 335 } 336 337 -
2016/24/EemeliN/Test/Test/Test/Test.csproj.Debug.cachefile
r7331 r7381 1 1 Content\Abina.xnb 2 Content\KenttÀ.xnb3 2 Content\pelaaja2.xnb 4 3 Content\Maa.xnb … … 8 7 Content\Flame.xnb 9 8 Content\t04_evilrat.xnb 10 Content\KenttÀ.2.xnb11 9 Content\MeteoriteBrick.xnb 12 10 Content\Maali.xnb 13 11 Content\Deagle.xnb 12 Content\KenttÀ.xnb 13 Content\KenttÀ2.xnb 14 Content\Cannon.xnb 15 Content\Jungle.xnb 16 Content\Jungle.wma -
2016/24/EemeliN/Test/Test/Test/obj/x86/Debug/ContentPipeline-{C4CAFCB8-EF75-4B1C-85B1-17BBB278D09E}.xml
r7331 r7381 10 10 <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Abina.xnb</Output> 11 11 <Time>2016-06-13T11:41:39.3147992+03:00</Time> 12 </Item>13 <Item>14 <Source>Kenttä.png</Source>15 <Name>Kenttä</Name>16 <Importer>TextureImporter</Importer>17 <Processor>TextureProcessor</Processor>18 <Options>None</Options>19 <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Kenttä.xnb</Output>20 <Time>2016-06-15T13:55:04.5793618+03:00</Time>21 12 </Item> 22 13 <Item> … … 72 63 <Options>None</Options> 73 64 <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Flame.xnb</Output> 74 <Time>2016-06-1 4T13:51:38.5495536+03:00</Time>65 <Time>2016-06-16T10:06:59.171879+03:00</Time> 75 66 </Item> 76 67 <Item> … … 82 73 <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\t04_evilrat.xnb</Output> 83 74 <Time>2016-06-15T11:09:37.0554971+03:00</Time> 84 </Item>85 <Item>86 <Source>Kenttä.2.png</Source>87 <Name>Kenttä.2</Name>88 <Importer>TextureImporter</Importer>89 <Processor>TextureProcessor</Processor>90 <Options>None</Options>91 <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Kenttä.2.xnb</Output>92 <Time>2016-06-15T11:35:16.5509097+03:00</Time>93 75 </Item> 94 76 <Item> … … 118 100 <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Deagle.xnb</Output> 119 101 <Time>2016-06-15T13:49:01.3544212+03:00</Time> 102 </Item> 103 <Item> 104 <Source>Kenttä.png</Source> 105 <Name>Kenttä</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Kenttä.xnb</Output> 110 <Time>2016-06-16T14:47:41.6687399+03:00</Time> 111 </Item> 112 <Item> 113 <Source>Kenttä2.png</Source> 114 <Name>Kenttä2</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Kenttä2.xnb</Output> 119 <Time>2016-06-16T11:26:37.4190939+03:00</Time> 120 </Item> 121 <Item> 122 <Source>Cannon.png</Source> 123 <Name>Cannon</Name> 124 <Importer>TextureImporter</Importer> 125 <Processor>TextureProcessor</Processor> 126 <Options>None</Options> 127 <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Cannon.xnb</Output> 128 <Time>2016-06-16T11:37:32.739415+03:00</Time> 129 </Item> 130 <Item> 131 <Source>Jungle.mp3</Source> 132 <Name>Jungle</Name> 133 <Importer>Mp3Importer</Importer> 134 <Processor>SongProcessor</Processor> 135 <Options>None</Options> 136 <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Jungle.xnb</Output> 137 <Extra>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Jungle.wma</Extra> 138 <Time>2016-06-15T10:36:43.044764+03:00</Time> 120 139 </Item> 121 140 <BuildSuccessful>true</BuildSuccessful> -
2016/24/EemeliN/Test/Test/Test/obj/x86/Debug/Test.csproj.FileListAbsolute.txt
r7331 r7381 8 8 C:\MyTemp\EemeliN\Test\Test\Test\obj\x86\Debug\Test.csprojResolveAssemblyReference.cache 9 9 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Abina.xnb 10 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\KenttÀ.xnb11 10 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\pelaaja2.xnb 12 11 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Maa.xnb … … 16 15 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Flame.xnb 17 16 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\t04_evilrat.xnb 18 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\KenttÀ.2.xnb19 17 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\MeteoriteBrick.xnb 20 18 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Maali.xnb 21 19 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Deagle.xnb 20 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\KenttÀ.xnb 21 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\KenttÀ2.xnb 22 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Cannon.xnb 23 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Jungle.xnb 24 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Jungle.wma -
2016/24/EemeliN/Test/Test/Test/obj/x86/Debug/cachefile-{C4CAFCB8-EF75-4B1C-85B1-17BBB278D09E}-targetpath.txt
r7331 r7381 1 1 Content\Abina.xnb 2 Content\KenttÀ.xnb3 2 Content\pelaaja2.xnb 4 3 Content\Maa.xnb … … 8 7 Content\Flame.xnb 9 8 Content\t04_evilrat.xnb 10 Content\KenttÀ.2.xnb11 9 Content\MeteoriteBrick.xnb 12 10 Content\Maali.xnb 13 11 Content\Deagle.xnb 12 Content\KenttÀ.xnb 13 Content\KenttÀ2.xnb 14 Content\Cannon.xnb 15 Content\Jungle.xnb 16 Content\Jungle.wma -
2016/24/EemeliN/Test/Test/TestContent/TestContent.contentproj
r7331 r7381 102 102 </ItemGroup> 103 103 <ItemGroup> 104 <Compile Include="Kenttä.2.png">105 <Name>Kenttä.2</Name>106 <Importer>TextureImporter</Importer>107 <Processor>TextureProcessor</Processor>108 </Compile>109 </ItemGroup>110 <ItemGroup>111 104 <Compile Include="MeteoriteBrick.png"> 112 105 <Name>MeteoriteBrick</Name> … … 122 115 </Compile> 123 116 </ItemGroup> 124 <ItemGroup /> 117 <ItemGroup> 118 <Folder Include="NewFolder1\" /> 119 </ItemGroup> 125 120 <ItemGroup> 126 121 <Compile Include="Deagle.png"> … … 131 126 </ItemGroup> 132 127 <ItemGroup> 133 <Compile Include=" NewFolder1\Kenttä.png">128 <Compile Include="Kenttä.png"> 134 129 <Name>Kenttä</Name> 135 130 <Importer>TextureImporter</Importer> 136 131 <Processor>TextureProcessor</Processor> 132 </Compile> 133 </ItemGroup> 134 <ItemGroup> 135 <Compile Include="Kenttä2.png"> 136 <Name>Kenttä2</Name> 137 <Importer>TextureImporter</Importer> 138 <Processor>TextureProcessor</Processor> 139 </Compile> 140 </ItemGroup> 141 <ItemGroup> 142 <Compile Include="Cannon.png"> 143 <Name>Cannon</Name> 144 <Importer>TextureImporter</Importer> 145 <Processor>TextureProcessor</Processor> 146 </Compile> 147 </ItemGroup> 148 <ItemGroup> 149 <Compile Include="Jungle.mp3"> 150 <Name>Jungle</Name> 151 <Importer>Mp3Importer</Importer> 152 <Processor>SongProcessor</Processor> 137 153 </Compile> 138 154 </ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.