Changeset 9214
- Timestamp:
- 2017-07-28 12:17:52 (6 years ago)
- Location:
- 2017/utsjoki/ÁndeN/msPaint
- Files:
-
- 11 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/utsjoki/ÁndeN/msPaint/msPaint/msPaint/msPaint.cs
r9176 r9214 13 13 Image taustaKuva = LoadImage("tausta"); 14 14 15 Vector nopeusYlos = new Vector(0, 250);16 Vector nopeusAlas = new Vector(0, - 250);17 Vector nopeusVasen = new Vector(- 250, 0);18 Vector nopeusOikea = new Vector( 250, 0);15 Vector nopeusYlos = new Vector(0, 500); 16 Vector nopeusAlas = new Vector(0, -500); 17 Vector nopeusVasen = new Vector(-500, 0); 18 Vector nopeusOikea = new Vector(500, 0); 19 19 20 20 PhysicsObject pelaaja1; … … 25 25 PhysicsObject yläReuna; 26 26 PhysicsObject alaReuna; 27 28 SoundEffect splash = LoadSoundEffect("splash"); 27 29 28 30 … … 48 50 kentta.SetTileMethod('x', LuoRuutu); 49 51 kentta.Execute(50, 50); 52 LuoSanko1(); 53 LuoSanko2(); 50 54 51 55 pelaaja1 = LuoPelaaja1(RandomGen.NextDouble(Level.Left, Level.Right), RandomGen.NextDouble(Level.Bottom, Level.Top)); … … 55 59 vasenReuna.Tag = "vasen"; 56 60 vasenReuna.IsVisible = false; 61 vasenReuna.IgnoresCollisionResponse = true; 57 62 58 63 oikeaReuna = Level.CreateRightBorder(); 59 64 oikeaReuna.Tag = "oikea"; 60 65 oikeaReuna.IsVisible = false; 66 oikeaReuna.IgnoresCollisionResponse = true; 61 67 62 68 yläReuna = Level.CreateTopBorder(); 63 69 yläReuna.Tag = "ylä"; 64 70 yläReuna.IsVisible = false; 71 yläReuna.IgnoresCollisionResponse = true; 65 72 66 73 alaReuna = Level.CreateBottomBorder(); 67 74 alaReuna.Tag = "ala"; 68 75 alaReuna.IsVisible = false; 76 alaReuna.IgnoresCollisionResponse = true; 77 78 MediaPlayer.Play("moonlight3rd"); 69 79 70 80 Level.Background.Image = taustaKuva; … … 78 88 PhysicsObject LuoPelaaja1(double x, double y) 79 89 { 80 PhysicsObject pelaaja1 = new PhysicsObject(60.0, 100.0);90 PhysicsObject pelaaja1 = new PhysicsObject(60.0, 60.0); 81 91 pelaaja1.Shape = Shape.Rectangle; 82 92 pelaaja1.X = x; 83 93 pelaaja1.Y = y; 84 //pelaaja1.LinearDamping = 0.4;94 pelaaja1.IsVisible = false; 85 95 Add(pelaaja1); 86 96 pelaaja1.Image = LoadImage("pelaaja1"); … … 90 100 AddCollisionHandler(pelaaja1, "ylä", osuuYlös); 91 101 AddCollisionHandler(pelaaja1, "ala", osuuAlas); 102 AddCollisionHandler(pelaaja1, "sanko1", osuuSanko1); 103 AddCollisionHandler(pelaaja1, "sanko2", osuuSanko2); 104 GameObject kuva = new GameObject(60, 100); 105 kuva.Image = LoadImage("pelaaja1"); 106 kuva.Y = 30; 107 pelaaja1.Add(kuva); 92 108 93 109 … … 122 138 PhysicsObject LuoPelaaja2(double x, double y) 123 139 { 124 PhysicsObject pelaaja2 = new PhysicsObject(60.0, 100.0);140 PhysicsObject pelaaja2 = new PhysicsObject(60.0, 60.0); 125 141 pelaaja2.Shape = Shape.Rectangle; 126 142 pelaaja2.X = x; 127 143 pelaaja2.Y = y; 128 //pelaaja2.LinearDamping = 0.4;144 pelaaja2.IsVisible = false; 129 145 Add(pelaaja2); 130 146 pelaaja2.Image = LoadImage("pelaaja2"); … … 134 150 AddCollisionHandler(pelaaja2, "ylä", osuuYlös); 135 151 AddCollisionHandler(pelaaja2, "ala", osuuAlas); 152 AddCollisionHandler(pelaaja2, "sanko1", osuuSanko1); 153 AddCollisionHandler(pelaaja2, "sanko2", osuuSanko2); 154 GameObject kuva = new GameObject(60, 100); 155 kuva.Image = LoadImage("pelaaja2"); 156 kuva.Y = 30; 157 pelaaja2.Add(kuva); 136 158 137 159 Timer ajastin = new Timer(); … … 143 165 } 144 166 167 void LuoSanko1() 168 { 169 170 PhysicsObject sanko = new PhysicsObject(50, 60); 171 sanko.X = RandomGen.NextDouble(Level.Left, Level.Right); 172 sanko.Y = RandomGen.NextDouble(Level.Bottom, Level.Top); 173 sanko.Image = LoadImage("sanko1"); 174 Add(sanko); 175 sanko.IgnoresCollisionResponse = true; 176 sanko.MakeStatic(); 177 sanko.Tag = "sanko1"; 178 179 180 } 181 182 void LuoSanko2() 183 { 184 PhysicsObject sanko = new PhysicsObject(50, 60); 185 sanko.X = RandomGen.NextDouble(Level.Left, Level.Right); 186 sanko.Y = RandomGen.NextDouble(Level.Bottom, Level.Top); 187 sanko.Image = LoadImage("sanko2"); 188 Add(sanko); 189 sanko.IgnoresCollisionResponse = true; 190 sanko.MakeStatic(); 191 sanko.Tag = "sanko2"; 192 } 193 194 void osuuSanko1(PhysicsObject pelaaja, PhysicsObject sanko) 195 { 196 for (int y = -2; y < 3; y++) 197 { 198 for (int x = -2; x < 3; x++) 199 { 200 MaalaaPaikka(pelaaja1, sanko.Position + new Vector(x, y) * 40); 201 } 202 } 203 204 sanko.X = RandomGen.NextDouble(Level.Left, Level.Right); 205 sanko.Y = RandomGen.NextDouble(Level.Bottom, Level.Top); 206 207 splash.Play(); 208 } 209 210 void osuuSanko2(PhysicsObject pelaaja, PhysicsObject sanko) 211 { 212 for (int y = -2; y < 3; y++) 213 { 214 for (int x = -2; x < 3; x++) 215 { 216 MaalaaPaikka(pelaaja2, sanko.Position + new Vector(x, y) * 40); 217 } 218 } 219 220 splash.Play(); 221 222 sanko.X = RandomGen.NextDouble(Level.Left, Level.Right); 223 sanko.Y = RandomGen.NextDouble(Level.Bottom, Level.Top); 224 } 225 226 void MaalaaPaikka(PhysicsObject pelaaja, Vector paikka) 227 { 228 GameObject ruutu = GetObjectAt(paikka); 229 230 if(pelaaja==pelaaja1) 231 { 232 ruutu.Image = LoadImage("splat1"); 233 } 234 if (pelaaja == pelaaja2) 235 { 236 ruutu.Image = LoadImage("splat2"); 237 } 238 } 239 145 240 void Maalaa(PhysicsObject pelaaja) 146 241 { 147 GameObject ruutu = GetObjectAt(pelaaja.Position+(pelaaja.Angle + Angle.FromDegrees(90)).GetVector()*-50); 148 149 if(pelaaja==pelaaja1) 150 { 151 ruutu.Image = LoadImage("splat1"); 152 } 153 if (pelaaja == pelaaja2) 154 { 155 ruutu.Image = LoadImage("splat2"); 156 } 242 MaalaaPaikka(pelaaja, pelaaja.Position + (pelaaja.Angle + Angle.FromDegrees(90)).GetVector() * 0); 157 243 } 158 244 … … 176 262 void AsetaNopeus(PhysicsObject pelaaja, Vector nopeus, Angle kulma) 177 263 { 178 //pelaaja.Push(nopeus);179 264 pelaaja.Velocity = nopeus; 180 265 pelaaja.Angle = kulma; -
2017/utsjoki/ÁndeN/msPaint/msPaint/msPaint/msPaint.csproj.Debug.cachefile
r9133 r9214 5 5 Content\splat2.xnb 6 6 Content\kentta.xnb 7 Content\sanko1.xnb 8 Content\sanko2.xnb 9 Content\moonlight3rd.xnb 10 Content\splash.xnb 11 Content\moonlight3rd.wma -
2017/utsjoki/ÁndeN/msPaint/msPaint/msPaint/obj/x86/Debug/ContentPipeline-{62FA8DE1-8CD3-4372-AEDC-37B1B391D730}.xml
r9176 r9214 56 56 <Time>2017-07-26T14:14:36.2586002+03:00</Time> 57 57 </Item> 58 <Item> 59 <Source>sanko1.png</Source> 60 <Name>sanko1</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\sanko1.xnb</Output> 65 <Time>2017-07-28T10:14:31.0193577+03:00</Time> 66 </Item> 67 <Item> 68 <Source>sanko2.png</Source> 69 <Name>sanko2</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\sanko2.xnb</Output> 74 <Time>2017-07-28T10:14:46.3714466+03:00</Time> 75 </Item> 76 <Item> 77 <Source>moonlight3rd.mp3</Source> 78 <Name>moonlight3rd</Name> 79 <Importer>Mp3Importer</Importer> 80 <Processor>SongProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\moonlight3rd.xnb</Output> 83 <Extra>C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\moonlight3rd.wma</Extra> 84 <Time>2017-07-28T10:27:26.7151169+03:00</Time> 85 </Item> 86 <Item> 87 <Source>splash.wav</Source> 88 <Name>splash</Name> 89 <Importer>WavImporter</Importer> 90 <Processor>SoundEffectProcessor</Processor> 91 <Options>None</Options> 92 <Output>C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\splash.xnb</Output> 93 <Time>2017-07-28T10:37:19.6808653+03:00</Time> 94 </Item> 58 95 <BuildSuccessful>true</BuildSuccessful> 59 96 <Settings> -
2017/utsjoki/ÁndeN/msPaint/msPaint/msPaint/obj/x86/Debug/cachefile-{62FA8DE1-8CD3-4372-AEDC-37B1B391D730}-targetpath.txt
r9133 r9214 5 5 Content\splat2.xnb 6 6 Content\kentta.xnb 7 Content\sanko1.xnb 8 Content\sanko2.xnb 9 Content\moonlight3rd.xnb 10 Content\moonlight3rd.wma 11 Content\splash.xnb -
2017/utsjoki/ÁndeN/msPaint/msPaint/msPaint/obj/x86/Debug/msPaint.csproj.FileListAbsolute.txt
r9133 r9214 13 13 C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\splat2.xnb 14 14 C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\kentta.xnb 15 C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\sanko1.xnb 16 C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\sanko2.xnb 17 C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\moonlight3rd.xnb 18 C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\moonlight3rd.wma 19 C:\MyTemp\msPaint\msPaint\msPaint\bin\x86\Debug\Content\splash.xnb -
2017/utsjoki/ÁndeN/msPaint/msPaint/msPaintContent/msPaintContent.contentproj
r9133 r9214 83 83 </Compile> 84 84 </ItemGroup> 85 <ItemGroup> 86 <Compile Include="sanko1.png"> 87 <Name>sanko1</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 </Compile> 91 </ItemGroup> 92 <ItemGroup> 93 <Compile Include="sanko2.png"> 94 <Name>sanko2</Name> 95 <Importer>TextureImporter</Importer> 96 <Processor>TextureProcessor</Processor> 97 </Compile> 98 </ItemGroup> 99 <ItemGroup> 100 <Compile Include="moonlight3rd.mp3"> 101 <Name>moonlight3rd</Name> 102 <Importer>Mp3Importer</Importer> 103 <Processor>SongProcessor</Processor> 104 </Compile> 105 </ItemGroup> 106 <ItemGroup> 107 <Compile Include="splash.wav"> 108 <Name>splash</Name> 109 <Importer>WavImporter</Importer> 110 <Processor>SoundEffectProcessor</Processor> 111 </Compile> 112 </ItemGroup> 85 113 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 86 114 <!-- 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.