Changeset 8889 for 2017/27/OttoK/1v1MeBitch
- Timestamp:
- 2017-07-04 14:57:28 (6 years ago)
- Location:
- 2017/27/OttoK/1v1MeBitch
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/27/OttoK/1v1MeBitch/1v1MeBitch/1v1MeBitchContent/1v1MeBitchContent.contentproj
r8831 r8889 46 46 </ItemGroup> 47 47 <ItemGroup> 48 <Compile Include="maali.wav">49 <Name>maali</Name>50 <Importer>WavImporter</Importer>51 <Processor>SoundEffectProcessor</Processor>52 </Compile>53 <Compile Include="norsu.png">54 <Name>norsu</Name>55 <Importer>TextureImporter</Importer>56 <Processor>TextureProcessor</Processor>57 </Compile>58 <Compile Include="tahti.png">59 <Name>tahti</Name>60 <Importer>TextureImporter</Importer>61 <Processor>TextureProcessor</Processor>62 </Compile>63 48 <Compile Include="kentta1.txt"> 64 49 <Name>kentta1</Name> 65 50 <Importer>TextFileImporter</Importer> 66 51 <Processor>TextFileContentProcessor</Processor> 52 </Compile> 53 </ItemGroup> 54 <ItemGroup> 55 <Compile Include="ohjus.png"> 56 <Name>ohjus</Name> 57 <Importer>TextureImporter</Importer> 58 <Processor>TextureProcessor</Processor> 59 </Compile> 60 </ItemGroup> 61 <ItemGroup> 62 <Compile Include="dednotbigsuprise.wav"> 63 <Name>dednotbigsuprise</Name> 64 <Importer>WavImporter</Importer> 65 <Processor>SoundEffectProcessor</Processor> 66 </Compile> 67 </ItemGroup> 68 <ItemGroup> 69 <Compile Include="pelaaja1.png"> 70 <Name>pelaaja1</Name> 71 <Importer>TextureImporter</Importer> 72 <Processor>TextureProcessor</Processor> 73 </Compile> 74 </ItemGroup> 75 <ItemGroup> 76 <Compile Include="pelaaja2.png"> 77 <Name>pelaaja2</Name> 78 <Importer>TextureImporter</Importer> 79 <Processor>TextureProcessor</Processor> 67 80 </Compile> 68 81 </ItemGroup> -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/1v1MeBitchContent/kentta1.txt
r8839 r8889 1 ########################################## 2 # # 3 # # 4 # # 5 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 6 # # 7 # # 8 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 9 # # 10 # # 11 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 12 # # 13 # # 14 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 15 # # 16 # # 17 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 18 # # 19 # # 20 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 21 # # 22 # M N # 23 ########################################## 1 ####################################### 2 # # 3 # # 4 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 5 # # 6 # # 7 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 8 # # 9 # # 10 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 11 # # 12 # # 13 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 14 # # 15 # # 16 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 17 # # 18 # # 19 # TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT # 20 # # 21 # M N # 22 ####################################### -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/_1v1MeBitch.cs
r8839 r8889 7 7 using Jypeli.Widgets; 8 8 9 public class Tikas : PhysicsObject10 {11 public Tikas(double leveys, double korkeus) : base(leveys, korkeus)12 {13 }14 15 public Vector AloitusPaikka;16 }17 18 class Pelaaja: PlatformCharacter19 {20 private IntMeter elamaLaskuri = new IntMeter(8, 0, 8 );21 public IntMeter ElamaLaskuri { get { return elamaLaskuri; } }22 23 public Pelaaja(double leveys, double korkeus)24 : base(leveys, korkeus)25 {26 elamaLaskuri.LowerLimit += delegate { this.Destroy(); };27 }28 }29 30 9 public class _1v1MeBitch : PhysicsGame 31 10 { … … 37 16 Pelaaja pelaaja2; 38 17 39 //Image pelaajanKuva = LoadImage("") 18 Image ohjuksenKuva = LoadImage("ohjus"); 19 Image pelaaja1kuva = LoadImage("pelaaja1"); 20 Image pelaaja2kuva = LoadImage("pelaaja2"); 40 21 41 22 public override void Begin() … … 46 27 LisaaNappaimet(); 47 28 IsFullScreen = true; 29 30 pelaaja1.Ammuslaskuri = LuoAmmuslaskuri(Screen.Right - 100, Screen.Bottom + 100); 31 pelaaja2.Ammuslaskuri = LuoAmmuslaskuri(Screen.Left +100, Screen.Bottom + 100); 48 32 49 33 Camera.ZoomToLevel(); … … 73 57 void LisaaTikas(Vector paikka, double leveys, double korkeus) 74 58 { 75 Tikas k = new Tikas(leveys, korkeus); 76 k.MakeOneWay(); 77 k.AloitusPaikka = paikka; 78 k.MakeStatic(); 79 k.Color = Color.Brown; 80 k.Position = paikka; 81 k.Tag = "tikas"; 82 Add(k); 59 //Luodaan tikkaat. 60 Tikas tikas = new Tikas(leveys, korkeus); 61 tikas.MakeOneWay(); 62 tikas.AloitusPaikka = paikka; 63 tikas.MakeStatic(); 64 tikas.Color = Color.Brown; 65 tikas.Position = paikka; 66 tikas.Tag = "tikas"; 67 Add(tikas); 83 68 } 84 69 … … 87 72 { 88 73 Pelaaja pelaaja = new Pelaaja(leveys, korkeus); 89 //pelaaja.CollisionIgnoreGroup = group;90 74 pelaaja.Position = paikka; 91 75 pelaaja.Mass = 4.0; 92 76 pelaaja.Color = vari; 93 //pelaaja1.Image = pelaajanKuva;94 77 Add(pelaaja); 95 78 … … 105 88 { 106 89 pelaaja1 = LisaaPelaaja(paikka, leveys, korkeus, Color.HotPink, new Vector(Screen.Right - 150, Screen.Top - 20)); 107 108 90 pelaaja1.Image = pelaaja1kuva; 109 91 } 110 92 … … 112 94 { 113 95 pelaaja2 = LisaaPelaaja(paikka, leveys, korkeus, Color.JungleGreen, new Vector(Screen.Left + 150, Screen.Top - 20)); 96 pelaaja2.Image = pelaaja2kuva; 114 97 } 115 98 … … 123 106 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 124 107 125 Keyboard.Listen(Key.Down, ButtonState.Down, Alas, "Pelaaja menee alas", pelaaja1, hyppyNopeus, "tikas");126 Keyboard.Listen(Key.S, ButtonState.Down, Alas, "Pelaaja menee alas", pelaaja2, hyppyNopeus, "tikas2");127 128 Keyboard.Listen(Key.NumPad0, ButtonState.Pressed, Ammu, "Ammu ohjus", pelaaja1);129 Keyboard.Listen(Key.Space, ButtonState.Pressed, Ammu, "Ammu ohjus", pelaaja2);130 131 108 Keyboard.Listen(Key.A, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja2, -nopeus); 132 109 Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja2, nopeus); 133 110 Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja2, hyppyNopeus); 134 111 135 136 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 137 138 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 139 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 140 ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 141 142 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 143 } 144 145 void Liikuta(PlatformCharacter hahmo, double nopeus) 112 Keyboard.Listen(Key.Down, ButtonState.Down, Alas, "Pelaaja menee alas", pelaaja1, hyppyNopeus, "tikas"); 113 Keyboard.Listen(Key.S, ButtonState.Down, Alas, "Pelaaja menee alas", pelaaja2, hyppyNopeus, "tikas2"); 114 115 Keyboard.Listen(Key.NumPad0, ButtonState.Pressed, Ammu, "Ammu ohjus", pelaaja1); 116 Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, Ammu, "Ammu ohjus", pelaaja2); 117 } 118 IntMeter LuoAmmuslaskuri(double sijaintix, double sijaintiy) 119 { 120 IntMeter ammuslaskuri = new IntMeter(4, 0, 4); 121 122 Label pisteNaytto = new Label(); 123 pisteNaytto.X = sijaintix; 124 pisteNaytto.Y = sijaintiy; 125 pisteNaytto.TextColor = Color.Black; 126 pisteNaytto.Color = Color.White; 127 pisteNaytto.BindTo(ammuslaskuri); 128 Add(pisteNaytto); 129 130 ammuslaskuri.LowerLimit += delegate 131 { 132 Timer.SingleShot(4.0, delegate 133 { 134 ammuslaskuri.Value = ammuslaskuri.MaxValue; 135 }); 136 }; 137 return ammuslaskuri; 138 } 139 140 void Liikuta(Pelaaja hahmo, double nopeus) 146 141 { 147 142 hahmo.Walk(nopeus); 148 143 } 149 150 void Hyppaa(PlatformCharacter hahmo, double nopeus) 144 void Hyppaa(Pelaaja hahmo, double nopeus) 151 145 { 152 146 hahmo.Jump(nopeus); 153 147 } 154 void Alas(P latformCharacterhahmo, double nopeus, string tag)148 void Alas(Pelaaja hahmo, double nopeus, string tag) 155 149 { 156 150 List<GameObject> tikkaat = GetObjectsAt(new Vector(hahmo.X, hahmo.Bottom - 5)); … … 164 158 } 165 159 } 166 167 160 if (!hahmo.IsAboutToFall() && voiPudota) 168 161 { 169 162 hahmo.Y -= 50; 170 163 } 171 172 //List<GameObject> tikkaat = GetObjectsWithTag(tag); 173 //foreach(GameObject tikas in tikkaat) 174 //{ 175 // Tikas p = (Tikas)tikas; 176 // p.Y += 2000; 177 // Timer.SingleShot(0.5, delegate { p.Position = p.AloitusPaikka; }); 178 //} 179 } 180 void Ammu(PlatformCharacter hahmo) 181 { 182 if (hahmo.IsDestroyed) 164 } 165 void Ammu(Pelaaja hahmo) 166 { 167 if (hahmo.IsDestroyed || hahmo.Ammuslaskuri.Value == 0) 183 168 return; 184 169 185 170 PhysicsObject ohjus = new PhysicsObject(40, 12); 186 //ohjus.MakeStatic();187 171 ohjus.Position = hahmo.Position; 188 172 ohjus.X += hahmo.FacingDirection.GetVector().X * 45; 189 173 ohjus.Color = hahmo.Color; 174 ohjus.Image = ohjuksenKuva; 190 175 ohjus.CollisionIgnoreGroup = 1; 191 176 ohjus.IgnoresGravity = true; … … 193 178 Add(ohjus); 194 179 195 //ohjus.Velocity = hahmo.FacingDirection.GetVector() * 600; 196 ohjus.Hit(hahmo.FacingDirection.GetVector() * 600); 180 hahmo.Ammuslaskuri.AddValue(-1); 181 182 ohjus.Hit(hahmo.FacingDirection.GetVector() * 1000); 183 184 if (ohjus.Velocity.X < 0) ohjus.Angle += Angle.FromDegrees(180); 197 185 198 186 AddCollisionHandler(ohjus, delegate(PhysicsObject a, PhysicsObject b) … … 206 194 { 207 195 208 Explosion rajahdys = new Explosion( 80);209 rajahdys.Force = 5;196 Explosion rajahdys = new Explosion(110); 197 rajahdys.Force = 15; 210 198 rajahdys.Position = ohjus.Position; 211 199 Add(rajahdys); … … 216 204 { 217 205 kohdePelaaja.ElamaLaskuri.Value--; 206 207 if (kohdePelaaja.IsDestroyed || kohdePelaaja.IsDestroying) Timer.SingleShot(2.0, ConfirmExit); 218 208 } 219 209 }; … … 221 211 } 222 212 } 213 223 214 } -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/_1v1MeBitch.csproj
r8831 r8889 112 112 <ItemGroup> 113 113 <Compile Include="Ohjelma.cs" /> 114 <Compile Include="Pelaaja.cs" /> 115 <Compile Include="Tikas.cs" /> 114 116 <Compile Include="_1v1MeBitch.cs" /> 115 117 <Compile Include="Properties\AssemblyInfo.cs" /> -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/_1v1MeBitch.csproj.Debug.cachefile
r8831 r8889 1 Content\maali.xnb2 Content\norsu.xnb3 Content\tahti.xnb4 1 Content\kentta1.xnb 2 Content\dednotbigsuprise.xnb 3 Content\ohjus.xnb 4 Content\pelaaja1.xnb 5 Content\pelaaja2.xnb 6 Content\tikas.xnb -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r8839 r8889 2 2 <XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 3 3 <Asset Type="Pipeline:BuildItemCollection"> 4 <Item>5 <Source>maali.wav</Source>6 <Name>maali</Name>7 <Importer>WavImporter</Importer>8 <Processor>SoundEffectProcessor</Processor>9 <Options>None</Options>10 <Output>C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\maali.xnb</Output>11 <Time>2017-07-03T10:14:34.8397899+03:00</Time>12 </Item>13 <Item>14 <Source>norsu.png</Source>15 <Name>norsu</Name>16 <Importer>TextureImporter</Importer>17 <Processor>TextureProcessor</Processor>18 <Options>None</Options>19 <Output>C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\norsu.xnb</Output>20 <Time>2017-07-03T10:14:34.84079+03:00</Time>21 </Item>22 <Item>23 <Source>tahti.png</Source>24 <Name>tahti</Name>25 <Importer>TextureImporter</Importer>26 <Processor>TextureProcessor</Processor>27 <Options>None</Options>28 <Output>C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\tahti.xnb</Output>29 <Time>2017-07-03T10:14:34.8417901+03:00</Time>30 </Item>31 4 <Item> 32 5 <Source>kentta1.txt</Source> … … 36 9 <Options>None</Options> 37 10 <Output>C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2017-07-03T13:20:04.5413505+03:00</Time> 11 <Time>2017-07-04T10:25:41.2345501+03:00</Time> 12 </Item> 13 <Item> 14 <Source>dednotbigsuprise.wav</Source> 15 <Name>dednotbigsuprise</Name> 16 <Importer>WavImporter</Importer> 17 <Processor>SoundEffectProcessor</Processor> 18 <Options>None</Options> 19 <Output>C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\dednotbigsuprise.xnb</Output> 20 <Time>2017-07-04T12:42:23.2418927+03:00</Time> 21 </Item> 22 <Item> 23 <Source>ohjus.png</Source> 24 <Name>ohjus</Name> 25 <Importer>TextureImporter</Importer> 26 <Processor>TextureProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\ohjus.xnb</Output> 29 <Time>2017-07-04T12:35:03.5639293+03:00</Time> 30 </Item> 31 <Item> 32 <Source>pelaaja1.png</Source> 33 <Name>pelaaja1</Name> 34 <Importer>TextureImporter</Importer> 35 <Processor>TextureProcessor</Processor> 36 <Options>None</Options> 37 <Output>C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\pelaaja1.xnb</Output> 38 <Time>2017-07-04T14:03:45.9961381+03:00</Time> 39 </Item> 40 <Item> 41 <Source>pelaaja2.png</Source> 42 <Name>pelaaja2</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 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> 39 48 </Item> 40 49 <BuildSuccessful>true</BuildSuccessful> -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/obj/x86/Debug/_1v1MeBitch.csproj.FileListAbsolute.txt
r8831 r8889 7 7 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\obj\x86\Debug\_1v1MeBitch.exe 8 8 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\obj\x86\Debug\_1v1MeBitch.pdb 9 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\maali.xnb10 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\norsu.xnb11 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\tahti.xnb12 9 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\kentta1.xnb 10 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\dednotbigsuprise.xnb 11 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\ohjus.xnb 12 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\pelaaja1.xnb 13 C:\MyTemp\OttoK\1v1MeBitch\1v1MeBitch\_1v1MeBitch\bin\x86\Debug\Content\pelaaja2.xnb -
2017/27/OttoK/1v1MeBitch/1v1MeBitch/_1v1MeBitch/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r8831 r8889 1 Content\maali.xnb2 Content\norsu.xnb3 Content\tahti.xnb4 1 Content\kentta1.xnb 2 Content\dednotbigsuprise.xnb 3 Content\ohjus.xnb 4 Content\pelaaja1.xnb 5 Content\pelaaja2.xnb
Note: See TracChangeset
for help on using the changeset viewer.