Changeset 7599 for 2016/26/JonniN
- Timestamp:
- 2016-06-30 14:59:31 (7 years ago)
- Location:
- 2016/26/JonniN/TankHero
- Files:
-
- 4 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/26/JonniN/TankHero/TankHero/TankHero/TankHero.cs
r7594 r7599 9 9 public class TankHero : PhysicsGame 10 10 { 11 11 12 Cannon torni; 13 Cannon botintorni; 12 14 Image leopard2a4 = LoadImage("leopard2a4"); 13 15 Image torninKuva = LoadImage("leopard2a4valmistorni"); … … 15 17 Image puuKuva = LoadImage("puu"); 16 18 Image hiekanKuva = LoadImage("hiekka"); 19 Image bottiRunko = LoadImage("t90runko"); 20 Image bottiTorni = LoadImage("t90torni"); 17 21 PhysicsObject pelaaja; 22 PhysicsObject botti; 23 Vector spawn = new Vector(-1400, -1300); 18 24 public override void Begin() 19 25 { … … 23 29 LuoKentta(); 24 30 LuoPelaaja(); 31 LuoBotti(); 25 32 LuoOhjaimet(); 26 33 MediaPlayer.Play("684240_Zound---Metallic"); 27 34 28 35 29 36 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); … … 36 43 pelaaja.Image = leopard2a4; 37 44 pelaaja.LinearDamping = 0.90; 38 pelaaja.AngularDamping = 0.95; 45 pelaaja.AngularDamping = 0.99; 46 pelaaja.Position = spawn; 47 pelaaja.Tag = "pelaaja1"; 39 48 Add(pelaaja); 40 49 Camera.Zoom(1.5); 41 50 Camera.Follow(pelaaja); 51 //Camera.ZoomToAllObjects(); 42 52 pelaaja.IgnoresExplosions = true; 43 53 … … 46 56 torni.Shape = Shape.FromImage(torninKuva); 47 57 torni.Image = torninKuva; 48 torni.Position = new Vector(- 9, -37);58 torni.Position = new Vector(-7, -37); 49 59 torni.Ammo.Value = 10000; 50 60 pelaaja.Add(torni); 51 61 62 } 63 void LuoBotti() 64 { 65 PhysicsObject botti = new PhysicsObject(150, 200); 66 botti.Image = bottiRunko; 67 botti.LinearDamping = 0.90; 68 botti.AngularDamping = 0.99; 69 Add(botti); 70 71 botintorni = new Cannon(100, 180); 72 botintorni.Image = bottiTorni; 73 botintorni.Position = new Vector(-10, 40); 74 botti.Add(botintorni); 75 76 FollowerBrain botinaivot = new FollowerBrain("pelaaja1"); 77 botinaivot.Speed = 200; 78 botinaivot.DistanceFar = 500; 79 botti.Brain = botinaivot; 80 botinaivot.Active = true; 81 82 botinaivot.TargetClose += mitaTapahtuuKunOllaanLahella; 83 84 85 86 } 87 void mitaTapahtuuKunOllaanLahella() 88 { 89 52 90 } 53 91 void LuoKentta() … … 58 96 ruudut.SetTileMethod(Color.FromHexCode("4CFF00"), LuoPuu); 59 97 ruudut.Execute(100, 100); 60 //Camera.ZoomToAllObjects();61 98 62 99 63 100 } 101 64 102 void LuoHiekka(Vector paikka, double leveys, double korkeus) 65 103 { 66 PhysicsObject hiekka = new PhysicsObject(100, 100);104 GameObject hiekka = new GameObject(100, 100); 67 105 hiekka.Image = hiekanKuva; 68 Add(hiekka); 106 hiekka.Position = paikka; 107 Add(hiekka); 69 108 } 70 109 void LuoPuu(Vector paikka, double leveys, double korkeus) … … 78 117 void LuoOhjaimet() 79 118 { 80 Keyboard.Listen(Key.W, ButtonState.Down, Aja, null, new Vector(0, 1 000));81 Keyboard.Listen(Key.S, ButtonState.Down, Aja, null, new Vector(0, - 700));119 Keyboard.Listen(Key.W, ButtonState.Down, Aja, null, new Vector(0, 1200)); 120 Keyboard.Listen(Key.S, ButtonState.Down, Aja, null, new Vector(0, -400)); 82 121 Keyboard.Listen(Key.A, ButtonState.Down, Kaanny, null, 1); 83 122 Keyboard.Listen(Key.D, ButtonState.Down, Kaanny, null, -1); … … 108 147 { 109 148 ammus.Destroy(); 110 149 kohde.Destroy(); 111 150 112 151 } -
2016/26/JonniN/TankHero/TankHero/TankHero/TankHero.csproj.Debug.cachefile
r7594 r7599 5 5 Content\puu.xnb 6 6 Content\hiekka.xnb 7 Content\t90torni.xnb 8 Content\t90runko.xnb 7 9 Content\684240_Zound---Metallic.wma -
2016/26/JonniN/TankHero/TankHero/TankHero/obj/x86/Debug/ContentPipeline-{B903E94D-9570-46DD-8789-F8147DB1F21B}.xml
r7594 r7599 37 37 <Options>None</Options> 38 38 <Output>C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\kartta.xnb</Output> 39 <Time>2016-06-30T1 0:31:58.1042918+03:00</Time>39 <Time>2016-06-30T12:31:04.9423918+03:00</Time> 40 40 </Item> 41 41 <Item> … … 56 56 <Output>C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\hiekka.xnb</Output> 57 57 <Time>2016-06-30T11:20:03.6432918+03:00</Time> 58 </Item> 59 <Item> 60 <Source>t90torni.png</Source> 61 <Name>t90torni</Name> 62 <Importer>TextureImporter</Importer> 63 <Processor>TextureProcessor</Processor> 64 <Options>None</Options> 65 <Output>C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\t90torni.xnb</Output> 66 <Time>2016-06-30T14:10:00.9054918+03:00</Time> 67 </Item> 68 <Item> 69 <Source>t90runko.png</Source> 70 <Name>t90runko</Name> 71 <Importer>TextureImporter</Importer> 72 <Processor>TextureProcessor</Processor> 73 <Options>None</Options> 74 <Output>C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\t90runko.xnb</Output> 75 <Time>2016-06-30T14:10:26.6927918+03:00</Time> 58 76 </Item> 59 77 <BuildSuccessful>true</BuildSuccessful> -
2016/26/JonniN/TankHero/TankHero/TankHero/obj/x86/Debug/TankHero.csproj.FileListAbsolute.txt
r7594 r7599 14 14 C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\puu.xnb 15 15 C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\hiekka.xnb 16 C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\t90torni.xnb 17 C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\t90runko.xnb -
2016/26/JonniN/TankHero/TankHero/TankHero/obj/x86/Debug/cachefile-{B903E94D-9570-46DD-8789-F8147DB1F21B}-targetpath.txt
r7594 r7599 6 6 Content\puu.xnb 7 7 Content\hiekka.xnb 8 Content\t90torni.xnb 9 Content\t90runko.xnb -
2016/26/JonniN/TankHero/TankHero/TankHeroContent/TankHeroContent.contentproj
r7594 r7599 87 87 </Compile> 88 88 </ItemGroup> 89 <ItemGroup> 90 <Compile Include="t90torni.png"> 91 <Name>t90torni</Name> 92 <Importer>TextureImporter</Importer> 93 <Processor>TextureProcessor</Processor> 94 </Compile> 95 </ItemGroup> 96 <ItemGroup> 97 <Compile Include="t90runko.png"> 98 <Name>t90runko</Name> 99 <Importer>TextureImporter</Importer> 100 <Processor>TextureProcessor</Processor> 101 </Compile> 102 </ItemGroup> 89 103 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 90 104 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.