- Timestamp:
- 2015-07-24 12:09:07 (8 years ago)
- Location:
- 2015/30/CamillaT
- Files:
-
- 17 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/30/CamillaT/YouCombat/YouCombat/YouCombat/YouCombat.cs
r6991 r7023 12 12 Ihminen rauski; 13 13 Ihminen miisas; 14 //PlatformCharacter soikku; 14 //Ihminen soikku; 15 //Ihminen herba; 16 //Ihminen lakko; 17 //Ihminen j0p; 18 //Ihminen pinsku 15 19 16 20 Image tubecon = LoadImage("TubeCombat - tausta"); … … 18 22 Image miisasinKuva = LoadImage("TubeCombat - Miisas"); 19 23 Image soikunKuva = LoadImage("TubeCombat - Soikku"); 24 Image tietoKuva = LoadImage("TubeCombat - Tietoa"); 25 //Image herbanKuva = LoadImage("TubeCombat - Herba "); 26 //Image lakonKuva = LoadImage("TubeCombat - Lakko "); 27 //Image j0pinKuva = LoadImage("TubeCombat - J0P "); 28 //Image pinskunKuva = LoadImage("TubeCombat - Pinsku"); 29 30 Image rauskinUlti = LoadImage ("TubeCombat - Käsi"); 31 Image miisasUlti = LoadImage("TubeCombat - MiisasUlti"); 20 32 21 33 Ihminen pelaaja1; … … 34 46 public override void Begin() 35 47 { 36 // TODO Maisema valmis. Hahmoille hyppy ja hyökkäys animaatiot??? Nosta alarajaa! Menuvalikko ja musiikki! 48 // TODO Lisää hahmoja, niiden liikkeet, uusia taustoja, enemmän efektejä ja erillaisia efekti musiikkeja ja eri kenttiin eri musat: ) 49 AlkuValikko(); 50 } 51 52 void AloitaPeli() 53 { 54 37 55 LuoKentta(); 38 56 Hahmot(); … … 42 60 pelaaja2 = miisas; 43 61 HahmojenOhjaus(); 44 62 LuoHelaBars(); 63 45 64 } 46 65 … … 63 82 64 83 Gravity = new Vector(0.0, -700.0); 84 85 65 86 } 66 87 … … 94 115 //Add(herba); 95 116 117 } 118 119 void LuoHelaBars() 120 { 121 ProgressBar elamaPalkki1 = new ProgressBar(350, 150); 122 elamaPalkki1.X = Screen.Right - 200; 123 elamaPalkki1.Y = Screen.Top - 100; 124 elamaPalkki1.BindTo(rauski.ElamaLaskuri); 125 elamaPalkki1.Image = LoadImage ("ElamaPalkki1-0prossaa"); 126 elamaPalkki1.BarImage = LoadImage("ElamaPalkki1"); 127 Add(elamaPalkki1); 128 129 ProgressBar elamaPalkki2 = new ProgressBar(350, 150); 130 elamaPalkki2.X = Screen.Left + 200; 131 elamaPalkki2.Y = Screen.Top - 100; 132 elamaPalkki2.BindTo(miisas.ElamaLaskuri); 133 elamaPalkki2.Image = LoadImage("ElamaPalkki-0prossaa"); 134 elamaPalkki2.BarImage = LoadImage("ElamaPalkki"); 135 Add(elamaPalkki2); 96 136 } 97 137 … … 116 156 117 157 118 //Miisasken hyppy ja Ulti.158 //Miisasken hyppy.2 119 159 120 160 } … … 127 167 Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Hyppy Ylos", pelaaja1, hyppynopeus); 128 168 Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liiku Oikealle", pelaaja1, nopeus); 129 Keyboard.Listen(Key.S, ButtonState.Pressed, Hyokkaus, "Hyokkaa Eteen", pelaaja1, pelaaja2); 130 Keyboard.Listen(Key.E, ButtonState.Pressed, RauskiinaHyokkays, "Hyokkaa Eteen", pelaaja1, pelaaja2); 131 132 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liiku Vasemmalle", pelaaja2, -nopeus); 133 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Hyppy Ylos", pelaaja2, hyppynopeus); 134 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liiku Oikealle", pelaaja2, nopeus); 135 Keyboard.Listen(Key.Enter, ButtonState.Pressed, Liikuta, "Hyokkaa Eteen", pelaaja2, nopeus); 169 Keyboard.Listen(Key.S, ButtonState.Pressed, Hyokkaus, "Hyokkaa Eteen", pelaaja1, pelaaja2, new Animation[] {rauskinHyokkays, new Animation(rauskinKuva)}, 25); 170 Keyboard.Listen(Key.E, ButtonState.Pressed, RauskiinaHyokkays, "Hyokkaa Eteen", pelaaja1, pelaaja2); 171 Keyboard.Listen(Key.LeftShift, ButtonState.Pressed, Ulti, "Ulti Eteen", pelaaja1, pelaaja2, rauskinUlti); 172 173 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liiku Vasemmalle", pelaaja2, -nopeus); 174 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Hyppy Ylos", pelaaja2, hyppynopeus); 175 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liiku Oikealle", pelaaja2, nopeus); 176 Keyboard.Listen(Key.Enter, ButtonState.Pressed, Hyokkaus, "Hyokkaa Eteen", pelaaja2, pelaaja1, new Animation[] {miisasHyokkays, new Animation(miisasinKuva)}, 25); 177 Keyboard.Listen(Key.Space, ButtonState.Pressed, Ulti, "Ulti Eteen", pelaaja2, pelaaja1, miisasUlti); 136 178 137 179 //Korjaa Miisasin eka hyökkays ja ultit molemmille!!!!!! … … 155 197 } 156 198 157 void Hyokkaus(PlatformCharacter pelaaja, Ihminen hyokkayksenKohde) 158 { 159 pelaaja.AnimIdle = rauskinHyokkays; 199 void Hyokkaus(PlatformCharacter pelaaja, Ihminen hyokkayksenKohde, Animation[] animaatiot, int vahingonMaara) 200 { 201 Animation hyokkaysanim = animaatiot[0]; 202 Animation paikallaananim = animaatiot[1]; 203 204 pelaaja.AnimIdle = hyokkaysanim; 205 pelaaja.AnimIdle.StopOnLastFrame = true; 206 207 // Tässä Lisätään tavallinen animaatio päälle kun hyökkäys on ohi. 208 pelaaja.AnimIdle.Played += delegate 209 { 210 pelaaja.AnimIdle = paikallaananim; 211 hyokkayksenKohde.OtaVahinkoa(vahingonMaara); 212 213 214 }; 215 216 } 217 218 219 void RauskiinaHyokkays(PlatformCharacter pelaaja, Ihminen hyokkayksenKohde) 220 { 221 pelaaja.AnimIdle = rauskiinaHyokkays; 160 222 pelaaja.AnimIdle.StopOnLastFrame = true; 161 223 … … 164 226 { 165 227 pelaaja.AnimIdle = new Animation(rauskinKuva); 166 hyokkayksenKohde.OtaVahinkoa( );228 hyokkayksenKohde.OtaVahinkoa(25); 167 229 168 230 … … 171 233 } 172 234 173 174 void RauskiinaHyokkays(PlatformCharacter pelaaja, Ihminen hyokkayksenKohde) 175 { 176 pelaaja.AnimIdle = rauskiinaHyokkays; 177 pelaaja.AnimIdle.StopOnLastFrame = true; 178 179 // Tässä Lisätään tavallinen animaatio päälle kun hyökkäys on ohi. 180 pelaaja.AnimIdle.Played += delegate 181 { 182 pelaaja.AnimIdle = new Animation(rauskinKuva); 183 hyokkayksenKohde.OtaVahinkoa(); 184 185 186 }; 187 235 void Ulti(Ihminen hyokkaaja, Ihminen uhri, Image ultiKuva) 236 { 237 GameObject ulti = new GameObject(Screen.Width, Screen.Height); 238 Add(ulti); 239 ulti.Image = ultiKuva; 240 Timer.SingleShot(2.0, delegate { ulti.Destroy(); uhri.OtaVahinkoa(50); }); 241 188 242 } 189 243 … … 206 260 Keyboard.Listen(Key.P, ButtonState.Pressed, Pause, "Pysäyttää pelin"); 207 261 208 } 209 262 263 264 } 265 266 void AloitaAlusta() 267 { 268 ClearAll(); 269 LuoKentta(); 270 HahmojenOhjaus(); 271 } 272 273 void AlkuValikko() 274 { 275 Level.Background.Color = Color.Black; 276 MultiSelectWindow alkuValikko = new MultiSelectWindow("TubeCombat", "Aloita peli", "Lopeta", "Tietoa"); 277 alkuValikko.SelectionColor = Color.Blue; 278 alkuValikko.Color = Color.Red; 279 Add(alkuValikko); 280 alkuValikko.AddItemHandler(0, AloitaPeli); 281 alkuValikko.AddItemHandler(1, Exit); 282 alkuValikko.AddItemHandler(2, Tietoa); 283 284 } 285 286 void Tietoa() 287 { 288 GameObject tiedot = new GameObject(tietoKuva); 289 Add(tiedot); 290 291 Timer.SingleShot(4, delegate { ClearAll(); AlkuValikko(); }); 292 } 210 293 211 294 } … … 214 297 class Ihminen : PlatformCharacter 215 298 { 216 private IntMeter elamaLaskuri = new IntMeter( 3, 0, 3);299 private IntMeter elamaLaskuri = new IntMeter(100, 0, 200); 217 300 public IntMeter ElamaLaskuri { get { return elamaLaskuri; } } 218 301 … … 227 310 228 311 229 public void OtaVahinkoa( )312 public void OtaVahinkoa(int vahinko) 230 313 { 231 314 // AddCollisionHandler(pelaaja1, Pelaaja1Tormasi); 232 elamaLaskuri.Value- -;315 elamaLaskuri.Value-=vahinko; 233 316 234 317 } 235 } 236 237 public class Peli : PhysicsGame 238 { 239 DoubleMeter elamaLaskuri; 240 241 public override void Begin() 242 { 243 //... 244 } 245 246 void LuoElamaLaskuri() 247 { 248 elamaLaskuri = new DoubleMeter(10); 249 elamaLaskuri.MaxValue = 10; 250 elamaLaskuri.LowerLimit += ElamaLoppui; 251 252 ProgressBar elamaPalkki = new ProgressBar(150, 20); 253 elamaPalkki.X = Screen.Left + 150; 254 elamaPalkki.Y = Screen.Top - 20; 255 elamaPalkki.BindTo(elamaLaskuri); 256 Add(elamaPalkki); 257 } 258 259 void ElamaLoppui() 260 { 261 MessageDisplay.Add("Elämät loppuivat, Pelaaja1 voitti!."); 262 } 318 319 320 321 322 263 323 264 324 -
2015/30/CamillaT/YouCombat/YouCombat/YouCombat/YouCombat.csproj.Debug.cachefile
r6991 r7023 29 29 Content\MiisasHyokkays\MiisasHyokkays3.xnb 30 30 Content\MiisasHyokkays.xnb 31 Content\TubeCombat - MiisasUlti.xnb 32 Content\TubeCombat - KÀsi.xnb 33 Content\ElamaPalkki.xnb 34 Content\ElamaPalkki-0prossaa.xnb 35 Content\ElamaPalkki1.xnb 36 Content\ElamaPalkki1-0prossaa.xnb 37 Content\TubeCombat - Tietoa.xnb 31 38 Content\TaustaMusa.wma 32 39 Content\Rauski.anim -
2015/30/CamillaT/YouCombat/YouCombat/YouCombat/obj/x86/Debug/YouCombat.csproj.FileListAbsolute.txt
r6991 r7023 43 43 C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays\MiisasHyokkays3.xnb 44 44 C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays.xnb 45 C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - KÀsi.xnb 46 C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - MiisasUlti.xnb 47 C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki.xnb 48 C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki-0prossaa.xnb 49 C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki1.xnb 50 C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki1-0prossaa.xnb 51 C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - Tietoa.xnb -
2015/30/CamillaT/YouCombat/YouCombat/YouCombat/obj/x86/Debug/cachefile-{66C8E644-CC23-4609-AD73-46EEDD2FF150}-targetpath.txt
r6991 r7023 30 30 Content\MiisasHyokkays\MiisasHyokkays3.xnb 31 31 Content\MiisasHyokkays.xnb 32 Content\TubeCombat - MiisasUlti.xnb 33 Content\TubeCombat - KÀsi.xnb 34 Content\ElamaPalkki.xnb 35 Content\ElamaPalkki-0prossaa.xnb 36 Content\ElamaPalkki1.xnb 37 Content\ElamaPalkki1-0prossaa.xnb 38 Content\TubeCombat - Tietoa.xnb 32 39 Content\Rauski.anim 33 40 Content\Miisas.anim -
2015/30/CamillaT/YouCombat/YouCombat/YouCombatContent/MiisasHyokkays.anim
r6982 r7023 1 FPS = 2 -
2015/30/CamillaT/YouCombat/YouCombat/YouCombatContent/YouCombatContent.contentproj
r6991 r7023 229 229 </Compile> 230 230 </ItemGroup> 231 <ItemGroup> 232 <Compile Include="TubeCombat - MiisasUlti.png"> 233 <Name>TubeCombat - MiisasUlti</Name> 234 <Importer>TextureImporter</Importer> 235 <Processor>TextureProcessor</Processor> 236 </Compile> 237 </ItemGroup> 238 <ItemGroup> 239 <Compile Include="TubeCombat - Käsi.png"> 240 <Name>TubeCombat - Käsi</Name> 241 <Importer>TextureImporter</Importer> 242 <Processor>TextureProcessor</Processor> 243 </Compile> 244 </ItemGroup> 245 <ItemGroup> 246 <Compile Include="ElamaPalkki.png"> 247 <Name>ElamaPalkki</Name> 248 <Importer>TextureImporter</Importer> 249 <Processor>TextureProcessor</Processor> 250 </Compile> 251 </ItemGroup> 252 <ItemGroup> 253 <Compile Include="ElamaPalkki-0prossaa.png"> 254 <Name>ElamaPalkki-0prossaa</Name> 255 <Importer>TextureImporter</Importer> 256 <Processor>TextureProcessor</Processor> 257 </Compile> 258 </ItemGroup> 259 <ItemGroup> 260 <Compile Include="ElamaPalkki1.png"> 261 <Name>ElamaPalkki1</Name> 262 <Importer>TextureImporter</Importer> 263 <Processor>TextureProcessor</Processor> 264 </Compile> 265 </ItemGroup> 266 <ItemGroup> 267 <Compile Include="ElamaPalkki1-0prossaa.png"> 268 <Name>ElamaPalkki1-0prossaa</Name> 269 <Importer>TextureImporter</Importer> 270 <Processor>TextureProcessor</Processor> 271 </Compile> 272 </ItemGroup> 273 <ItemGroup> 274 <Compile Include="TubeCombat - Tietoa.png"> 275 <Name>TubeCombat - Tietoa</Name> 276 <Importer>TextureImporter</Importer> 277 <Processor>TextureProcessor</Processor> 278 </Compile> 279 </ItemGroup> 231 280 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 232 281 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/30/CamillaT/YouCombat/YouCombat/YouCombatContent/obj/x86/Debug/ContentPipeline.xml
r6991 r7023 286 286 <Options>None</Options> 287 287 <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays.xnb</Output> 288 <Time>2015-07-2 3T14:46:54.1276418+03:00</Time>288 <Time>2015-07-24T10:32:11.2960346+03:00</Time> 289 289 <Request>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays\MiisasHyokkays1.xnb</Request> 290 290 <Request>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays\MiisasHyokkays2.xnb</Request> 291 291 <Request>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\MiisasHyokkays\MiisasHyokkays3.xnb</Request> 292 </Item> 293 <Item> 294 <Source>TubeCombat - MiisasUlti.png</Source> 295 <Name>TubeCombat - MiisasUlti</Name> 296 <Importer>TextureImporter</Importer> 297 <Processor>TextureProcessor</Processor> 298 <Options>None</Options> 299 <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - MiisasUlti.xnb</Output> 300 <Time>2015-07-24T10:04:33.8895296+03:00</Time> 301 </Item> 302 <Item> 303 <Source>TubeCombat - Käsi.png</Source> 304 <Name>TubeCombat - Käsi</Name> 305 <Importer>TextureImporter</Importer> 306 <Processor>TextureProcessor</Processor> 307 <Options>None</Options> 308 <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - Käsi.xnb</Output> 309 <Time>2015-07-24T10:08:28.2497296+03:00</Time> 310 </Item> 311 <Item> 312 <Source>ElamaPalkki.png</Source> 313 <Name>ElamaPalkki</Name> 314 <Importer>TextureImporter</Importer> 315 <Processor>TextureProcessor</Processor> 316 <Options>None</Options> 317 <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki.xnb</Output> 318 <Time>2015-07-24T10:25:12.6221296+03:00</Time> 319 </Item> 320 <Item> 321 <Source>ElamaPalkki-0prossaa.png</Source> 322 <Name>ElamaPalkki-0prossaa</Name> 323 <Importer>TextureImporter</Importer> 324 <Processor>TextureProcessor</Processor> 325 <Options>None</Options> 326 <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki-0prossaa.xnb</Output> 327 <Time>2015-07-24T10:25:28.4405296+03:00</Time> 328 </Item> 329 <Item> 330 <Source>ElamaPalkki1.png</Source> 331 <Name>ElamaPalkki1</Name> 332 <Importer>TextureImporter</Importer> 333 <Processor>TextureProcessor</Processor> 334 <Options>None</Options> 335 <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki1.xnb</Output> 336 <Time>2015-07-24T10:30:44.2152292+03:00</Time> 337 </Item> 338 <Item> 339 <Source>ElamaPalkki1-0prossaa.png</Source> 340 <Name>ElamaPalkki1-0prossaa</Name> 341 <Importer>TextureImporter</Importer> 342 <Processor>TextureProcessor</Processor> 343 <Options>None</Options> 344 <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\ElamaPalkki1-0prossaa.xnb</Output> 345 <Time>2015-07-24T10:30:27.1684634+03:00</Time> 346 </Item> 347 <Item> 348 <Source>TubeCombat - Tietoa.png</Source> 349 <Name>TubeCombat - Tietoa</Name> 350 <Importer>TextureImporter</Importer> 351 <Processor>TextureProcessor</Processor> 352 <Options>None</Options> 353 <Output>C:\MyTemp\CamillaT\YouCombat\YouCombat\YouCombat\bin\x86\Debug\Content\TubeCombat - Tietoa.xnb</Output> 354 <Time>2015-07-24T11:53:17.7930017+03:00</Time> 292 355 </Item> 293 356 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.