- Timestamp:
- 2010-06-10 11:41:11 (13 years ago)
- Location:
- 2010/23/jopehell/TheTankTMR
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/jopehell/TheTankTMR/Content/Content.contentproj
r559 r654 1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 2 2 <PropertyGroup> 3 3 <ProjectGuid>7c83055b-09f6-47ca-8ef7-1078f9408293</ProjectGuid> … … 34 34 <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> 35 35 </ItemGroup> 36 <ItemGroup> 37 <Compile Include="tausta.png"> 38 <Name>tausta</Name> 39 <Importer>TextureImporter</Importer> 40 <Processor>TextureProcessor</Processor> 41 </Compile> 42 </ItemGroup> 43 <ItemGroup> 44 <Compile Include="tankki.png"> 45 <Name>tankki</Name> 46 <Importer>TextureImporter</Importer> 47 <Processor>TextureProcessor</Processor> 48 </Compile> 49 </ItemGroup> 50 <ItemGroup> 51 <Compile Include="orkki.png"> 52 <Name>orkki</Name> 53 <Importer>TextureImporter</Importer> 54 <Processor>TextureProcessor</Processor> 55 </Compile> 56 </ItemGroup> 36 57 </Project> -
2010/23/jopehell/TheTankTMR/Peli.cs
r628 r654 24 24 { 25 25 LuoKentta(); 26 LuoOrkki(0,0);27 26 LuoOhjaimet(); 28 27 … … 33 32 void LuoKentta() 34 33 { 35 Level.Background Color = Color.TransparentBlack;34 Level.Background.Image = LoadImage("tausta"); 36 35 Camera.ZoomToLevel(); 37 36 38 37 39 38 tankki1 = LuoTankki(Level.Left + 20.0, 0.0); 40 tankki2 = LuoTankki(Level.Right - 20.0, 0.0); 39 tankki2 = LuoTankki(Level.Left + 20.0, 0.0); 40 LisaaLaskurit(); 41 41 42 42 vasenReuna = Level.CreateLeftBorder(); … … 52 52 alaReuna.Restitution = 1.0; 53 53 alaReuna.IsVisible = false; 54 orkki = LuoOrkki(0, 0); 55 orkki = LuoOrkki(1, 1); 54 56 } 55 57 … … 58 60 PhysicsObject tankki = PhysicsObject.CreateStaticObject(30.0, 30.0); 59 61 60 tankki. Shape = Shapes.Rectangle;62 tankki.Image = LoadImage("tankki"); ; 61 63 tankki.X = x; 62 64 tankki.Y = y; 63 tankki.Restitution = 1.0;65 tankki.Restitution = 0.5; 64 66 Add( tankki ); 65 PlasmaCannon ase = new PlasmaCannon(20, 5); 66 tankki.Add(ase); 67 ase.Angle += Angle.Degrees(5); 68 ase.Use(); 69 ase.PlasmaParticleCollision = AmmuksenTormays; 67 PlasmaCannon Plasmatykki = new PlasmaCannon(20, 5); 68 tankki.Add(Plasmatykki); 69 Plasmatykki.Angle += Angle.Degrees(5); 70 Plasmatykki.Use(); 71 Plasmatykki.PlasmaParticleCollision = AmmuksenTormays; 72 Keyboard.Listen(Key.Space, ButtonState.Down, Plasmatykki.Use, "Ammu"); 73 74 70 75 return tankki; 71 76 72 77 } 73 74 voidLuoOrkki(double x,double y)78 79 PhysicsObject LuoOrkki(double x,double y) 75 80 { 76 81 PhysicsObject orkki = new PhysicsObject(30, 30); 77 orkki.Shape = Shapes.Rectangle; 82 83 orkki.Image = LoadImage("orkki"); 78 84 orkki.Restitution = 1.0; 79 85 orkki.X = 50; 80 86 orkki.Y = 50; 81 82 83 87 Add(orkki); 84 Vector impulssi = new Vector(10.0, 200.0);88 Vector impulssi = new Vector(10.0, 300.0); 85 89 orkki.Hit(impulssi); 86 87 90 AddCollisionHandler(orkki, VihollinenTormasi); 88 89 } 90 91 return orkki; 92 93 } 94 91 95 void LisaaLaskurit() 92 96 { … … 106 110 return laskuri; 107 111 } 108 void AmmuksenTormays(PhysicsObject kuula, PhysicsObject orkki)112 void AmmuksenTormays(PhysicsObject kuula, PhysicsObject orkki) 109 113 { 110 114 KillCount.Value += 1; 111 112 if (KillCount.Value == 2) 115 orkki.Destroy(); 116 Explosion rajahdys = new Explosion(50.0); 117 rajahdys.Position = orkki.Position; 118 Add(rajahdys); 119 120 rajahdys.Speed = 750.0; 121 rajahdys.Force = 100; 122 123 if (KillCount.Value == 6) 113 124 { 114 125 LuoOrkki(0,0); 115 126 } 127 116 128 } 117 129 void VihollinenTormasi(PhysicsObject orkki, PhysicsObject otus) … … 131 143 if (tankki1.IsDestroyed()) 132 144 { 145 133 146 } 134 147 } -
2010/23/jopehell/TheTankTMR/TheTankTMR.csproj
r559 r654 89 89 <Content Include="Game.ico" /> 90 90 <Content Include="GameThumbnail.png" /> 91 <Content Include="tausta.png" /> 91 92 </ItemGroup> 92 93 <ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.