- Timestamp:
- 2015-06-10 11:31:28 (8 years ago)
- Location:
- 2015/24/OttoK/Grand Theft Norsu II
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II.csproj.Debug.cachefile
r5951 r5977 6 6 Content\auto1kuva.xnb 7 7 Content\kursori1.xnb 8 Content\panos.xnb 8 9 Content\kentta1.txt -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/Grand_Theft_Norsu_II.cs
r5951 r5977 15 15 const double hyppyNopeus = 1000; 16 16 const int RUUDUN_KOKO = 42; 17 GameObject tahtain; 17 18 18 19 PlatformCharacter pelaaja1; … … 22 23 Image auto1kuva = LoadImage("auto1kuva"); 23 24 Image kursorinkuva = LoadImage("kursori1"); 25 Image panoksenkuba = LoadImage("panos"); 24 26 double hyppykerroin = 1.0; 27 AssaultRifle pelaajan1Ase; 28 Grenade kranaatti; 29 30 25 31 26 32 SoundEffect maaliAani = LoadSoundEffect("maali"); … … 33 39 SetWindowSize(1024, 768, true); 34 40 Gravity = new Vector(0, -1000); 35 36 Mouse.IsCursorVisible = true; 41 42 43 44 Mouse.IsCursorVisible = false; 37 45 Vector paikkaRuudulla = Mouse.PositionOnScreen; 38 46 Vector paikkaKentalla = Mouse.PositionOnWorld; 39 47 tahtain = new GameObject(50, 50); 48 tahtain.Image = kursorinkuva; 49 Add(tahtain); 40 50 41 51 LuoKentta(); … … 72 82 taso.Position = paikka; 73 83 taso.Color = Color.Green; 84 taso.IgnoresExplosions = true; 74 85 Add(taso); 75 86 } … … 92 103 pelaaja1.Image = pelaajanKuva; 93 104 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 105 pelaajan1Ase = new AssaultRifle(30, 10); 106 107 //Ammusten määrä aluksi: 108 pelaajan1Ase.Ammo.Value = 1000; 109 110 //Mitä tapahtuu kun ammus osuu johonkin? 111 pelaajan1Ase.ProjectileCollision = AmmusOsui; 112 113 pelaaja1.Add(pelaajan1Ase); 94 114 Add(pelaaja1); 115 116 95 117 96 118 … … 121 143 Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 122 144 Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 123 Keyboard.Listen(Key.Space, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus);124 145 Keyboard.Listen(Key.F2, ButtonState.Down, AvaaKirjoitusIkkuna, "Avaa kirjoitusikkunan"); 125 146 Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, AsetaHyppykerroin, "Korkeampi hyppy", 1.5); … … 127 148 //Mouse.Listen(MouseButton.Left, ButtonState.Pressed, TarkistaHiirenPainallus, "Objektin kohdalla toiminto"); 128 149 Keyboard.Listen(Key.F, ButtonState.Pressed, UlosAutosta, "Mene ulos autosta"); 150 Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaajan1Ase); 151 Keyboard.Listen(Key.E, ButtonState.Pressed, HeitaKranaatti, "Heita kranaatti", pelaaja1); 152 153 //ammus.Destroy(); 154 129 155 130 156 Mouse.ListenWheel(ZoomaaKenttaa, ""); 157 Mouse.ListenMovement(0.0, TahtaaAseella, ""); 158 Mouse.ListenMovement(0.0, KuunteleLiiketta, null); 159 //kranaatti.Explosion.AddShockwaveHandler("vihollinen", KranaattiOsui); 131 160 132 161 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); … … 141 170 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 142 171 } 143 172 144 173 void Liikuta(PlatformCharacter hahmo, double nopeus) 145 174 { … … 189 218 string vastaus = ikkuna.InputBox.Text; 190 219 191 if (vastaus == " gravity0")220 if (vastaus == "/gravity0") 192 221 { 193 222 Gravity = new Vector(0, 0); 194 223 } 195 else if (vastaus == " gravity1")224 else if (vastaus == "/gravity1") 196 225 { 197 226 Gravity = new Vector(0, -1000); 198 227 } 199 else if (vastaus == " createcar")228 else if (vastaus == "/createcar") 200 229 { 201 230 LuoAuto(pelaaja1.Position, 0, 0); 202 231 } 203 else if (vastaus == " canrotate")232 else if (vastaus == "/canrotate") 204 233 { 205 234 pelaaja1.CanRotate = true; 206 235 207 236 } 208 else if (vastaus == " cantrotate")237 else if (vastaus == "/cantrotate") 209 238 { 210 239 pelaaja1.CanRotate = false; 211 240 } 212 else if (vastaus == " superspeed")241 else if (vastaus == "/superspeed") 213 242 { 214 243 nopeus = 1500; … … 216 245 LisaaNappaimet(); 217 246 } 218 else if (vastaus == " normalspeed")247 else if (vastaus == "/normalspeed") 219 248 { 220 249 nopeus = 750; … … 222 251 LisaaNappaimet(); 223 252 } 224 else if (vastaus == "showcodes") 225 { 226 MessageDisplay.Add("gravity0, gravity1, createcar, canrotate, cantrotate, superspeed, normalspeed."); 227 } 228 253 else if (vastaus == "/showcodes") 254 { 255 MessageDisplay.Add("/gravity0, /gravity1, /createcar, /canrotate, /cantrotate, /superspeed, /normalspeed."); 256 } 257 258 229 259 } 230 260 … … 310 340 311 341 } 342 void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 343 { 344 ammus.Destroy(); 345 346 } 347 348 void AmmuAseella(AssaultRifle ase) 349 { 350 PhysicsObject ammus = ase.Shoot(); 351 352 353 if(ammus != null) 354 { 355 AddCollisionHandler(ammus, "auto", TuhoaAuto); 356 //ammus.Size *= 3; 357 ammus.Image = panoksenkuba; 358 //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 359 } 360 } 361 void TahtaaAseella(AnalogState hiirenLiike) 362 { 363 Vector suunta = (Mouse.PositionOnWorld - pelaajan1Ase.AbsolutePosition).Normalize(); 364 pelaajan1Ase.Angle = suunta.Angle; 365 } 366 void KuunteleLiiketta(AnalogState hiirenTila) 367 { 368 369 370 Vector hiirenLiike = hiirenTila.MouseMovement; 371 //if (hiirenLiike.Magnitude > 0) 372 //{ 373 374 tahtain.X = Mouse.PositionOnWorld.X; 375 tahtain.Y = Mouse.PositionOnWorld.Y; 376 //} 377 378 //tahtain.Move(hiirenTila.StateVector * 30); 379 380 } 381 void HeitaKranaatti(PlatformCharacter pelaaja) 382 { 383 Grenade kranu = new Grenade(4.0); 384 pelaaja.Throw(kranu, Angle.FromDegrees(30), 10000); 385 kranu.Explosion.ShockwaveReachesObject += KranaattiOsui; 386 } 387 388 void KranaattiOsui(IPhysicsObject rajahdyksenKohde, Vector v) 389 { 390 rajahdyksenKohde.Destroy(); 391 } 392 393 void TuhoaAuto(PhysicsObject ammus, PhysicsObject auto) 394 { 395 ammus.Destroy(); 396 Flame liekki = new Flame(); 397 liekki.Position = new Vector(10, 10); 398 Add(liekki); 399 400 } 312 401 } -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/bin/x86/Debug/Content/kentta1.txt
r5951 r5977 3 3 #..........................................................................................................................# 4 4 #..........................................................................................................................# 5 #.......########..................###.........................########.....................................................# 5 6 #..........................................................................................................................# 6 7 #..........................................................................................................................# 7 #..........................................................................................................................# 8 #.....................................##########...........................................................................# 9 #..........................................................................................................................# 8 #.....................................##########...............................#######.....................................# 9 #.................##########.........................................................................#######...............# 10 10 #.....................................................###......N...........................................................# 11 #.........................................................#######..........................................................# 12 #..........................................................................................................................# 13 #............................................................................########......................................# 11 #.##############..........................................#######........................#########.........................# 12 #.....................................###########..........................................................................# 13 #...................#############............................................########......................................# 14 #..................................................................#####...................................................# 15 #..........................................................####...................................####..######.............# 16 #.............................########.....................................................................................# 17 #...........................................................##############......................#######....................# 18 #................#######...................########...........................##########...................................# 19 #.......###................................................................................................................# 14 20 #..........................................................................................................................# 15 21 #..........................................................................................................................# 16 #..........................................................................................................................# 17 #..........................................................................................................................# 18 #..........................................................................................................................# 19 #..........................................................................................................................# 20 #............................................................................###...........................................# 21 #........................................................................####..............................................# 22 ############################################################################################################################# 22 ############################################################################################################################ -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/obj/x86/Debug/Grand Theft Norsu II.csproj.FileListAbsolute.txt
r5951 r5977 29 29 C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\auto1kuva.xnb 30 30 C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\kursori1.xnb 31 C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\panos.xnb -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r5951 r5977 6 6 Content\auto1kuva.xnb 7 7 Content\kursori1.xnb 8 Content\panos.xnb 8 9 Content\kentta1.txt -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu IIContent/Grand Theft Norsu IIContent.contentproj
r5951 r5977 89 89 </Compile> 90 90 </ItemGroup> 91 <ItemGroup> 92 <Compile Include="panos.png"> 93 <Name>panos</Name> 94 <Importer>TextureImporter</Importer> 95 <Processor>TextureProcessor</Processor> 96 </Compile> 97 </ItemGroup> 91 98 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 92 99 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu IIContent/kentta1.txt
r5951 r5977 3 3 #..........................................................................................................................# 4 4 #..........................................................................................................................# 5 #.......########..................###.........................########.....................................................# 5 6 #..........................................................................................................................# 6 7 #..........................................................................................................................# 7 #..........................................................................................................................# 8 #.....................................##########...........................................................................# 9 #..........................................................................................................................# 8 #.....................................##########...............................#######.....................................# 9 #.................##########.........................................................................#######...............# 10 10 #.....................................................###......N...........................................................# 11 #.........................................................#######..........................................................# 12 #..........................................................................................................................# 13 #............................................................................########......................................# 11 #.##############..........................................#######........................#########.........................# 12 #.....................................###########..........................................................................# 13 #...................#############............................................########......................................# 14 #..................................................................#####...................................................# 15 #..........................................................####...................................####..######.............# 16 #.............................########.....................................................................................# 17 #...........................................................##############......................#######....................# 18 #................#######...................########...........................##########...................................# 19 #.......###................................................................................................................# 14 20 #..........................................................................................................................# 15 21 #..........................................................................................................................# 16 #..........................................................................................................................# 17 #..........................................................................................................................# 18 #..........................................................................................................................# 19 #..........................................................................................................................# 20 #............................................................................###...........................................# 21 #........................................................................####..............................................# 22 ############################################################################################################################# 22 ############################################################################################################################ -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu IIContent/obj/x86/Debug/ContentPipeline-.xml
r5951 r5977 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\kentta1.xnb</Output> 11 <Time>2015-06- 09T14:56:36.8658082+03:00</Time>11 <Time>2015-06-10T09:33:28.0736852+03:00</Time> 12 12 </Item> 13 13 <Item> … … 65 65 <Time>2015-06-09T13:18:40.3480394+03:00</Time> 66 66 </Item> 67 <Item> 68 <Source>panos.png</Source> 69 <Name>panos</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\panos.xnb</Output> 74 <Time>2015-06-10T10:32:54.6480024+03:00</Time> 75 </Item> 67 76 <BuildSuccessful>true</BuildSuccessful> 68 77 <Settings>
Note: See TracChangeset
for help on using the changeset viewer.