- Timestamp:
- 2016-06-23 13:12:58 (7 years ago)
- Location:
- 2016/25/AaroV
- Files:
-
- 17 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/25/AaroV/Tankz/Tankz/Tankz/Tankz.cs
r7489 r7498 12 12 Tankki tankki2; 13 13 Tankki tankki3; 14 SoundEffect tykinaani = LoadSoundEffect("Explosion28"); 15 Image tankinkuva = LoadImage("epicTankkipohja"); 16 Image tankintykki = LoadImage("epitankkiTykki"); 17 Image TankinAmmus = LoadImage("Ammus"); 14 18 public override void Begin() 15 19 { … … 42 46 if (tankki.ElamaLaskuri.Value == 0) return; 43 47 Vector suunta = Vector.FromLengthAndAngle(tankki.tykki.Width, tankki.tykki.AbsoluteAngle); 44 PhysicsObject ammus = new PhysicsObject(1 0, 2);48 PhysicsObject ammus = new PhysicsObject(17, 5); 45 49 ammus.Position = tankki.Position + suunta; 46 50 ammus.CollisionIgnoreGroup = tankki.CollisionIgnoreGroup; 47 51 ammus.Angle = tankki.tykki.AbsoluteAngle ; 48 52 Add(ammus); 53 ammus.Image = TankinAmmus; 49 54 ammus.Tag = "ammus"; 50 55 AddCollisionHandler(ammus, CollisionHandler.DestroyObject); 51 56 ammus.LifetimeLeft = TimeSpan.FromSeconds(4); 52 ammus.Velocity = Vector.FromLengthAndAngle(850, tankki.tykki.AbsoluteAngle ) ; 57 ammus.Velocity = Vector.FromLengthAndAngle(875, tankki.tykki.AbsoluteAngle ) ; 58 tykinaani.Play(); 53 59 } 54 60 Tankki Luotankki(Double X, Double Y,int tormausryhma) { 55 Tankki tankki = new Tankki( 30, 30);61 Tankki tankki = new Tankki(60, 30,tankintykki); 56 62 tankki.CollisionIgnoreGroup = tormausryhma; 57 63 Add(tankki); … … 59 65 tankki.Y = Y; 60 66 tankki.Mass = 5; 61 67 tankki.Image = tankinkuva; 62 68 63 69 AddCollisionHandler(tankki, "ammus", tankkiinosui); … … 69 75 Tankki pelaaja = (Tankki)tankki; 70 76 pelaaja.ElamaLaskuri.Value--; 71 77 78 int tankkeja = 0; 79 tankkeja += this.tankki.ElamaLaskuri.Value > 0 ? 1 : 0; 80 tankkeja += this.tankki2.ElamaLaskuri.Value > 0 ? 1 : 0; 81 82 tankkeja += this.tankki3.ElamaLaskuri.Value > 0 ? 1 : 0; 83 84 if(tankkeja <= 1) 85 { 86 ClearAll(); 87 Begin(); 88 } 89 90 72 91 } 73 92 } … … 79 98 public GameObject tykki { get; set; } 80 99 public Double kulma { get; set; } 81 public Tankki(double leveys, double korkeus )100 public Tankki(double leveys, double korkeus,Image tykinkuva) 82 101 : base(leveys, korkeus) 83 102 { 84 103 elamaLaskuri.LowerLimit += delegate { this.Destroy(); }; 85 104 tykki = new GameObject(this.Width / 1.5, this.Width / 5.0); 105 tykki.Image = tykinkuva; 86 106 Add(tykki); 87 107 IsUpdated = true; … … 90 110 public override void Update(Time time) 91 111 { 92 tykki.Position = Vector.FromLengthAndAngle(tykki.Width * 1, Angle.FromDegrees(kulma));112 tykki.Position = new Vector(0, 10) + Vector.FromLengthAndAngle(tykki.Width * 0.52, Angle.FromDegrees(kulma)); 93 113 tykki.Angle = Angle.FromDegrees(kulma); 94 114 95 115 base.Update(time); 96 116 117 97 118 } 98 119 } -
2016/25/AaroV/Tankz/Tankz/Tankz/Tankz.csproj
r7473 r7498 19 19 <ApplicationIcon>Game.ico</ApplicationIcon> 20 20 <Thumbnail>GameThumbnail.png</Thumbnail> 21 <PublishUrl>publish\</PublishUrl> 21 <IsWebBootstrapper>false</IsWebBootstrapper> 22 <ReferencePath>$(registry:HKEY_LOCAL_MACHINE\Software\Jypeli@Install_Dir)\lib\x86</ReferencePath> 23 <PublishUrl>C:\Users\ohjelmointi\Documents\AaroV\TankZInstall\</PublishUrl> 22 24 <Install>true</Install> 23 25 <InstallFrom>Disk</InstallFrom> … … 29 31 <UpdateRequired>false</UpdateRequired> 30 32 <MapFileExtensions>true</MapFileExtensions> 33 <AutorunEnabled>true</AutorunEnabled> 31 34 <ApplicationRevision>0</ApplicationRevision> 32 35 <ApplicationVersion>1.0.0.%2a</ApplicationVersion> 33 <IsWebBootstrapper>false</IsWebBootstrapper>34 36 <UseApplicationTrust>false</UseApplicationTrust> 37 <PublishWizardCompleted>true</PublishWizardCompleted> 35 38 <BootstrapperEnabled>true</BootstrapperEnabled> 36 <ReferencePath>$(registry:HKEY_LOCAL_MACHINE\Software\Jypeli@Install_Dir)\lib\x86</ReferencePath>37 39 </PropertyGroup> 38 40 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> … … 60 62 <PlatformTarget>x86</PlatformTarget> 61 63 <XnaCompressContent>true</XnaCompressContent> 64 </PropertyGroup> 65 <PropertyGroup> 66 <ManifestCertificateThumbprint>2BBA2FD43373C686824B8E2E3D78C782842BE4CD</ManifestCertificateThumbprint> 67 </PropertyGroup> 68 <PropertyGroup> 69 <ManifestKeyFile>Tankz_TemporaryKey.pfx</ManifestKeyFile> 70 </PropertyGroup> 71 <PropertyGroup> 72 <GenerateManifests>true</GenerateManifests> 73 </PropertyGroup> 74 <PropertyGroup> 75 <SignManifests>true</SignManifests> 62 76 </PropertyGroup> 63 77 <ItemGroup> … … 152 166 </BootstrapperPackage> 153 167 </ItemGroup> 168 <ItemGroup> 169 <None Include="Tankz_TemporaryKey.pfx" /> 170 </ItemGroup> 154 171 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 155 172 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> -
2016/25/AaroV/Tankz/Tankz/Tankz/obj/x86/Debug/ContentPipeline-{05F528B4-78AE-4163-AFAA-5A3FFD0B61AC}.xml
r7473 r7498 2 2 <XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 3 3 <Asset Type="Pipeline:BuildItemCollection"> 4 <Item> 5 <Source>epicTankkipohja.png</Source> 6 <Name>epicTankkipohja</Name> 7 <Importer>TextureImporter</Importer> 8 <Processor>TextureProcessor</Processor> 9 <Options>None</Options> 10 <Output>C:\Users\ohjelmointi\Documents\AaroV\Tankz\Tankz\Tankz\bin\x86\Debug\Content\epicTankkipohja.xnb</Output> 11 <Time>2016-06-23T10:48:12.1056394+03:00</Time> 12 </Item> 13 <Item> 14 <Source>epitankkiTykki.png</Source> 15 <Name>epitankkiTykki</Name> 16 <Importer>TextureImporter</Importer> 17 <Processor>TextureProcessor</Processor> 18 <Options>None</Options> 19 <Output>C:\Users\ohjelmointi\Documents\AaroV\Tankz\Tankz\Tankz\bin\x86\Debug\Content\epitankkiTykki.xnb</Output> 20 <Time>2016-06-23T10:46:19.4411846+03:00</Time> 21 </Item> 22 <Item> 23 <Source>Explosion28.wav</Source> 24 <Name>Explosion28</Name> 25 <Importer>WavImporter</Importer> 26 <Processor>SoundEffectProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\Users\ohjelmointi\Documents\AaroV\Tankz\Tankz\Tankz\bin\x86\Debug\Content\Explosion28.xnb</Output> 29 <Time>2016-06-23T11:06:45.8777583+03:00</Time> 30 </Item> 31 <Item> 32 <Source>Ammus.jpg</Source> 33 <Name>Ammus</Name> 34 <Importer>TextureImporter</Importer> 35 <Processor>TextureProcessor</Processor> 36 <Options>None</Options> 37 <Output>C:\Users\ohjelmointi\Documents\AaroV\Tankz\Tankz\Tankz\bin\x86\Debug\Content\Ammus.xnb</Output> 38 <Time>2016-06-23T11:38:08.9049095+03:00</Time> 39 </Item> 4 40 <BuildSuccessful>true</BuildSuccessful> 5 41 <Settings> … … 16 52 <Assemblies> 17 53 <Assembly> 54 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 55 <Value>2016-03-29T10:06:40+03:00</Value> 56 </Assembly> 57 <Assembly> 58 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</Key> 59 <Value>2011-09-01T16:22:30+03:00</Value> 60 </Assembly> 61 <Assembly> 62 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</Key> 63 <Value>2011-09-01T16:22:30+03:00</Value> 64 </Assembly> 65 <Assembly> 66 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</Key> 67 <Value>2011-09-01T16:22:30+03:00</Value> 68 </Assembly> 69 <Assembly> 70 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</Key> 71 <Value>2011-09-01T16:22:30+03:00</Value> 72 </Assembly> 73 <Assembly> 74 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</Key> 75 <Value>2011-09-01T16:22:30+03:00</Value> 76 </Assembly> 77 <Assembly> 78 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</Key> 79 <Value>2011-09-01T16:22:30+03:00</Value> 80 </Assembly> 81 <Assembly> 82 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 83 <Value>2016-03-29T10:06:38+03:00</Value> 84 </Assembly> 85 <Assembly> 18 86 <Key>C:\WINDOWS\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 19 87 <Value>2016-06-06T10:02:05.599392+03:00</Value> -
2016/25/AaroV/Tankz/Tankz/Tankz/obj/x86/Debug/Tankz.csproj.FileListAbsolute.txt
r7477 r7498 7 7 C:\Users\ohjelmointi\Documents\AaroV\Tankz\Tankz\Tankz\obj\x86\Debug\Tankz.pdb 8 8 C:\Users\ohjelmointi\Documents\AaroV\Tankz\Tankz\Tankz\obj\x86\Debug\Tankz.csprojResolveAssemblyReference.cache 9 C:\Users\ohjelmointi\Documents\AaroV\Tankz\Tankz\Tankz\bin\x86\Debug\Content\epicTankkipohja.xnb 10 C:\Users\ohjelmointi\Documents\AaroV\Tankz\Tankz\Tankz\bin\x86\Debug\Content\epitankkiTykki.xnb 11 C:\Users\ohjelmointi\Documents\AaroV\Tankz\Tankz\Tankz\bin\x86\Debug\Content\Explosion28.xnb 12 C:\Users\ohjelmointi\Documents\AaroV\Tankz\Tankz\Tankz\bin\x86\Debug\Content\Ammus.xnb -
2016/25/AaroV/Tankz/Tankz/TankzContent/TankzContent.contentproj
r7473 r7498 45 45 <Reference Include="AnimationExtension" /> 46 46 </ItemGroup> 47 <ItemGroup> 48 <Compile Include="epicTankkipohja.png"> 49 <Name>epicTankkipohja</Name> 50 <Importer>TextureImporter</Importer> 51 <Processor>TextureProcessor</Processor> 52 </Compile> 53 </ItemGroup> 54 <ItemGroup> 55 <Compile Include="epitankkiTykki.png"> 56 <Name>epitankkiTykki</Name> 57 <Importer>TextureImporter</Importer> 58 <Processor>TextureProcessor</Processor> 59 </Compile> 60 </ItemGroup> 61 <ItemGroup> 62 <Compile Include="Explosion28.wav"> 63 <Name>Explosion28</Name> 64 <Importer>WavImporter</Importer> 65 <Processor>SoundEffectProcessor</Processor> 66 </Compile> 67 </ItemGroup> 68 <ItemGroup> 69 <Compile Include="Ammus.jpg"> 70 <Name>Ammus</Name> 71 <Importer>TextureImporter</Importer> 72 <Processor>TextureProcessor</Processor> 73 </Compile> 74 </ItemGroup> 47 75 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 48 76 <!-- 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.