Changeset 8938 for 2017/27/OttoK/1v1MeBitch
- Timestamp:
- 2017-07-05 15:02:01 (4 years ago)
- Location:
- 2017/27/OttoK/1v1MeBitch
- Files:
-
- 15 added
- 6 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/27/OttoK/1v1MeBitch/1v1MeBitch/1v1MeBitchContent/1v1MeBitchContent.contentproj
r8889 r8938 80 80 </Compile> 81 81 </ItemGroup> 82 <ItemGroup> 83 <Compile Include="takajeejee.png"> 84 <Name>takajeejee</Name> 85 <Importer>TextureImporter</Importer> 86 <Processor>TextureProcessor</Processor> 87 </Compile> 88 </ItemGroup> 82 89 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 83 90 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/_1v1MeBitch.cs
r8889 r8938 19 19 Image pelaaja1kuva = LoadImage("pelaaja1"); 20 20 Image pelaaja2kuva = LoadImage("pelaaja2"); 21 Image tikkaankuva = LoadImage("tikas"); 22 Image taustakuva = LoadImage("takajeejee"); 21 23 22 24 public override void Begin() … … 26 28 LuoKentta(); 27 29 LisaaNappaimet(); 28 IsFullScreen = true;30 IsFullScreen = false; 29 31 30 32 pelaaja1.Ammuslaskuri = LuoAmmuslaskuri(Screen.Right - 100, Screen.Bottom + 100); 31 pelaaja2.Ammuslaskuri = LuoAmmuslaskuri(Screen.Left + 100, Screen.Bottom + 100);33 pelaaja2.Ammuslaskuri = LuoAmmuslaskuri(Screen.Left + 100, Screen.Bottom + 100); 32 34 33 35 Camera.ZoomToLevel(); … … 44 46 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 45 47 Level.CreateBorders(); 46 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 47 } 48 48 Level.Background.Image = taustakuva; 49 50 Timer ajastin = new Timer(); 51 ajastin.Interval = 2; 52 ajastin.Timeout += LuoShrine; 53 ajastin.Start(); 54 } 49 55 void LisaaTaso(Vector paikka, double leveys, double korkeus) 50 56 { … … 62 68 tikas.AloitusPaikka = paikka; 63 69 tikas.MakeStatic(); 64 tikas.Color = Color.B rown;70 tikas.Color = Color.Beige; 65 71 tikas.Position = paikka; 66 72 tikas.Tag = "tikas"; … … 75 81 pelaaja.Mass = 4.0; 76 82 pelaaja.Color = vari; 83 pelaaja.Ammu = Ammu1; 84 pelaaja.Tag = "pelaaja"; 77 85 Add(pelaaja); 78 86 … … 82 90 Add(elamaPalkki); 83 91 92 AddCollisionHandler<Pelaaja, PhysicsObject>(pelaaja, "shrine", PowerUp); 84 93 return pelaaja; 85 94 } … … 88 97 { 89 98 pelaaja1 = LisaaPelaaja(paikka, leveys, korkeus, Color.HotPink, new Vector(Screen.Right - 150, Screen.Top - 20)); 90 pelaaja1.Image = pelaaja1kuva; 99 pelaaja1.Image = pelaaja1kuva; 91 100 } 92 101 … … 163 172 } 164 173 } 174 165 175 void Ammu(Pelaaja hahmo) 166 176 { … … 168 178 return; 169 179 180 hahmo.Ammu(hahmo); 181 } 182 183 void Ammu1(Pelaaja hahmo) 184 { 170 185 PhysicsObject ohjus = new PhysicsObject(40, 12); 171 186 ohjus.Position = hahmo.Position; 172 ohjus.X += hahmo.FacingDirection.GetVector().X * 45;187 ohjus.X += hahmo.FacingDirection.GetVector().X * 60; 173 188 ohjus.Color = hahmo.Color; 174 189 ohjus.Image = ohjuksenKuva; … … 180 195 hahmo.Ammuslaskuri.AddValue(-1); 181 196 182 ohjus.Hit(hahmo.FacingDirection.GetVector() * 1000); 183 197 ohjus.Hit(hahmo.FacingDirection.GetVector() * 1200); 184 198 if (ohjus.Velocity.X < 0) ohjus.Angle += Angle.FromDegrees(180); 185 186 AddCollisionHandler(ohjus, delegate(PhysicsObject a, PhysicsObject b) 199 AddCollisionHandler(ohjus, delegate (PhysicsObject a, PhysicsObject b) 187 200 { 188 201 TuhoaOhjus(a, b, hahmo); 189 202 }); 203 } 204 void Ammu2(Pelaaja hahmo) 205 { 206 PhysicsObject laaseri = new PhysicsObject(70, 5); 207 laaseri.Position = hahmo.Position; 208 laaseri.X += hahmo.FacingDirection.GetVector().X * 70; 209 laaseri.Color = hahmo.Color; 210 laaseri.CollisionIgnoreGroup = 1; 211 laaseri.IgnoresGravity = true; 212 laaseri.IgnoresCollisionResponse = true; 213 Add(laaseri); 214 215 hahmo.Ammuslaskuri.AddValue(-1); 216 217 laaseri.Hit(hahmo.FacingDirection.GetVector() * 4000); 218 if (laaseri.Velocity.X < 0) laaseri.Angle += Angle.FromDegrees(180); 219 AddCollisionHandler(laaseri, delegate (PhysicsObject a, PhysicsObject b) 220 { 221 TuhoaLaser(a, b, hahmo); 222 }); 223 } 224 void Ammu3(Pelaaja hahmo) 225 { 226 190 227 } 191 228 void TuhoaOhjus(PhysicsObject ohjus, PhysicsObject kohde, PhysicsObject ampuja) … … 201 238 { 202 239 Pelaaja kohdePelaaja = rajahdyksenKohde as Pelaaja; 203 if (kohdePelaaja != null && kohdePelaaja != ampuja)240 if (kohdePelaaja != null && kohdePelaaja != ampuja) 204 241 { 205 242 kohdePelaaja.ElamaLaskuri.Value--; … … 211 248 } 212 249 } 213 250 void LuoShrine() 251 { 252 PhysicsObject shrine = new PhysicsObject(40, 40); 253 Vector powerupPiste = Level.GetRandomPosition(); 254 shrine.Position = powerupPiste; 255 shrine.Color = Color.Red; 256 shrine.Shape = Shape.Circle; 257 shrine.IgnoresGravity = true; 258 shrine.Tag = "shrine"; 259 Add(shrine); 260 } 261 void PowerUp(Pelaaja pelaaja, PhysicsObject shrine) 262 { 263 shrine.Destroy(); 264 265 Action<Pelaaja> vanha = pelaaja.Ammu; 266 while(pelaaja.Ammu == vanha) 267 pelaaja.Ammu = RandomGen.SelectOne<Action<Pelaaja>>(Ammu1, Ammu2, Ammu3); 268 } 269 void TuhoaLaser(PhysicsObject laaseri, PhysicsObject kohde, PhysicsObject ampuja) 270 { 271 if (kohde.Tag != "pelaaja") return; 272 Pelaaja p = (Pelaaja)kohde; 273 p.ElamaLaskuri.AddValue(-2); 274 laaseri.Destroy(); 275 276 if (p.IsDestroyed || p.IsDestroying) Timer.SingleShot(2.0, ConfirmExit); 277 } 214 278 } -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/_1v1MeBitch.csproj.Debug.cachefile
r8889 r8938 4 4 Content\pelaaja1.xnb 5 5 Content\pelaaja2.xnb 6 Content\t ikas.xnb6 Content\takajeejee.xnb -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r8889 r8938 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\pelaaja1.xnb</Output> 38 <Time>2017-07-0 4T14:03:45.9961381+03:00</Time>38 <Time>2017-07-05T10:30:03.9879055+03:00</Time> 39 39 </Item> 40 40 <Item> … … 45 45 <Options>None</Options> 46 46 <Output>C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\pelaaja2.xnb</Output> 47 <Time>2017-07-04T14:03:53.1528537+03:00</Time> 47 <Time>2017-07-05T10:30:08.6465687+03:00</Time> 48 </Item> 49 <Item> 50 <Source>takajeejee.png</Source> 51 <Name>takajeejee</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\takajeejee.xnb</Output> 56 <Time>2017-07-05T12:27:07.6224226+03:00</Time> 48 57 </Item> 49 58 <BuildSuccessful>true</BuildSuccessful> -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/obj/x86/Debug/_1v1MeBitch.csproj.FileListAbsolute.txt
r8889 r8938 12 12 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\pelaaja1.xnb 13 13 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\pelaaja2.xnb 14 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\takajeejee.xnb -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r8889 r8938 4 4 Content\pelaaja1.xnb 5 5 Content\pelaaja2.xnb 6 Content\takajeejee.xnb
Note: See TracChangeset
for help on using the changeset viewer.