Changeset 8723
- Timestamp:
- 2017-06-15 13:55:21 (6 years ago)
- Location:
- 2017/24/AaroM/Asteroids/Asteroids
- Files:
-
- 4 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/24/AaroM/Asteroids/Asteroids/Asteroids/Asteroids.cs
r8701 r8723 11 11 Spaceship spaceship2; 12 12 Spaceship spaceship1; 13 Spaceship spaceship3; 13 14 IntMeter spaceship1Terveys; 14 15 IntMeter spaceship2Terveys; 16 IntMeter spaceship3Terveys; 15 17 AssaultRifle ufonAse; 16 18 … … 24 26 Pieniasteroidi(-165, -234); 25 27 Pieniasteroidi(445, 234); 28 Pieniasteroidi(500, 400); 26 29 Spaceship1(-150.0, 0.0); 27 30 Spaceship2(150.0, 0.0); 31 Spaceship3(-150.0, -150); 28 32 Liikkumiskomennot(); 29 33 Ufo(450, -450); … … 102 106 ufo.Image = LoadImage("munufo"); 103 107 Add(ufo); 104 ufonAse = new AssaultRifle( 30, 10);108 ufonAse = new AssaultRifle(60, 20); 105 109 ufonAse.Ammo.Value = 1000; 106 110 ufonAse.ProjectileCollision = AmmusOsui; 107 111 ufonAse.FireRate = 5.0; 108 ufonAse.Shoot(); 112 ufonAse.IsVisible = false; 113 Timer ajastin = new Timer(); 114 ajastin.Interval = 1.0; 115 ajastin.Timeout += Ammu; 116 ajastin.Start(); 109 117 ufo.Add(ufonAse); 118 } 119 120 void Ammu() 121 { 122 PhysicsObject panos = ufonAse.Shoot(); 123 124 if (panos != null) 125 { 126 panos.Image = LoadImage("laser"); 127 panos.Size = new Vector(20, 20); 128 panos.MaximumLifetime = new TimeSpan(0, 0, 10); 129 } 110 130 } 111 131 … … 135 155 Add(spaceship2); 136 156 } 157 158 159 void Spaceship3(double X, double Y) 160 { 161 spaceship3 = new Spaceship(50.0, 50.0); 162 spaceship3.X = X; 163 spaceship3.Y = X; 164 spaceship3.Image = LoadImage("spaceship 3"); 165 spaceship3.Tag = "The Bandit"; 166 AddCollisionHandler(spaceship3, Spaceship3Tormasi); 167 spaceship3Terveys = new IntMeter(3); 168 Add(spaceship3); 169 170 } 171 172 173 137 174 void Liikkumiskomennot() 138 175 { … … 146 183 Keyboard.Listen(Key.W, ButtonState.Down, Liikutaspaceship1, null, new Vector(0, 100)); 147 184 Keyboard.Listen(Key.S, ButtonState.Down, Liikutaspaceship1, null, new Vector(0, -100)); 185 186 Keyboard.Listen(Key.H, ButtonState.Down, Liikutaspaceship3, null, new Vector(-100, 0)); 187 Keyboard.Listen(Key.K, ButtonState.Down, Liikutaspaceship3, null, new Vector(100, 0)); 188 Keyboard.Listen(Key.U, ButtonState.Down, Liikutaspaceship3, null, new Vector(0, 100)); 189 Keyboard.Listen(Key.J, ButtonState.Down, Liikutaspaceship3, null, new Vector(0, -100)); 148 190 } 149 191 void Liikutaspaceship2(Vector vektori) … … 156 198 spaceship1.Push(vektori); 157 199 } 200 201 void Liikutaspaceship3(Vector vektori) 202 { 203 spaceship3.Push(vektori); 204 } 205 158 206 159 207 … … 177 225 178 226 } 179 void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 180 { 181 Spaceship alus = (Spaceship)kohde; 182 alus.ElamaLaskuri.Value--; 183 184 } 227 228 void Spaceship3Tormasi(PhysicsObject tormaaja, PhysicsObject kohde) 229 { 230 if (kohde.Tag.Equals("pahis")) 231 spaceship3Terveys.Value--; 232 233 if (spaceship3Terveys.Value <= 0) 234 spaceship3.Destroy(); 235 } 236 237 238 239 240 void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 241 { 242 if (kohde.Tag == "Phantom Falcon" || kohde.Tag == "Arwing" || kohde.Tag == "The Bandit") 243 { 244 Spaceship alus = (Spaceship)kohde; 245 alus.ElamaLaskuri.Value--; 246 } 247 248 } 185 249 186 250 -
2017/24/AaroM/Asteroids/Asteroids/Asteroids/Asteroids.csproj.Debug.cachefile
r8701 r8723 9 9 Content\space xd.xnb 10 10 Content\spacemusic.xnb 11 Content\laser.xnb 12 Content\spaceship 3.xnb 11 13 Content\spacemusic.wma -
2017/24/AaroM/Asteroids/Asteroids/Asteroids/obj/x86/Debug/Asteroids.csproj.FileListAbsolute.txt
r8701 r8723 18 18 C:\MyTemp\AaroM\Asteroids\Asteroids\Asteroids\bin\x86\Debug\Content\spacemusic.xnb 19 19 C:\MyTemp\AaroM\Asteroids\Asteroids\Asteroids\bin\x86\Debug\Content\spacemusic.wma 20 C:\MyTemp\AaroM\Asteroids\Asteroids\Asteroids\bin\x86\Debug\Content\laser.xnb 21 C:\MyTemp\AaroM\Asteroids\Asteroids\Asteroids\bin\x86\Debug\Content\spaceship 3.xnb -
2017/24/AaroM/Asteroids/Asteroids/Asteroids/obj/x86/Debug/ContentPipeline-{093C8DB8-B433-4224-8809-5BA07E2A4E45}.xml
r8701 r8723 93 93 <Time>2017-06-15T11:05:46.7374736+03:00</Time> 94 94 </Item> 95 <Item> 96 <Source>laser.png</Source> 97 <Name>laser</Name> 98 <Importer>TextureImporter</Importer> 99 <Processor>TextureProcessor</Processor> 100 <Options>None</Options> 101 <Output>C:\MyTemp\AaroM\Asteroids\Asteroids\Asteroids\bin\x86\Debug\Content\laser.xnb</Output> 102 <Time>2017-06-15T13:19:58.5962935+03:00</Time> 103 </Item> 104 <Item> 105 <Source>spaceship 3.png</Source> 106 <Name>spaceship 3</Name> 107 <Importer>TextureImporter</Importer> 108 <Processor>TextureProcessor</Processor> 109 <Options>None</Options> 110 <Output>C:\MyTemp\AaroM\Asteroids\Asteroids\Asteroids\bin\x86\Debug\Content\spaceship 3.xnb</Output> 111 <Time>2017-06-15T13:34:49.4365716+03:00</Time> 112 </Item> 95 113 <BuildSuccessful>true</BuildSuccessful> 96 114 <Settings> -
2017/24/AaroM/Asteroids/Asteroids/Asteroids/obj/x86/Debug/cachefile-{093C8DB8-B433-4224-8809-5BA07E2A4E45}-targetpath.txt
r8701 r8723 10 10 Content\spacemusic.xnb 11 11 Content\spacemusic.wma 12 Content\laser.xnb 13 Content\spaceship 3.xnb -
2017/24/AaroM/Asteroids/Asteroids/AsteroidsContent/AsteroidsContent.contentproj
r8701 r8723 115 115 </Compile> 116 116 </ItemGroup> 117 <ItemGroup> 118 <Compile Include="laser.png"> 119 <Name>laser</Name> 120 <Importer>TextureImporter</Importer> 121 <Processor>TextureProcessor</Processor> 122 </Compile> 123 </ItemGroup> 124 <ItemGroup> 125 <Compile Include="spaceship 3.png"> 126 <Name>spaceship 3</Name> 127 <Importer>TextureImporter</Importer> 128 <Processor>TextureProcessor</Processor> 129 </Compile> 130 </ItemGroup> 117 131 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 118 132 <!-- 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.