Changeset 8922 for 2017/27/MikaelL/Avaruuspeli/Avaruuspeli
- Timestamp:
- 2017-07-05 13:37:29 (4 years ago)
- Location:
- 2017/27/MikaelL/Avaruuspeli/Avaruuspeli
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/27/MikaelL/Avaruuspeli/Avaruuspeli/Avaruuspeli/Avaruuspeli.cs
r8907 r8922 8 8 9 9 public class Avaruuspeli : PhysicsGame 10 { 10 { Image avaruusaluskuva = LoadImage("avaruusalus"); 11 11 Image kivenKuva = LoadImage("kivi"); 12 12 Image taustakuva = LoadImage("taustakuva"); 13 14 PhysicsObject pelaaja1; 15 PhysicsObject pelaaja2; 16 13 17 public override void Begin() 14 18 { … … 19 23 20 24 Level.Background.FitToLevel(); 25 Level.CreateBorders(); 26 pelaaja1 = LuoAvaruusalus(100, 100); 27 pelaaja2 = LuoAvaruusalus(10, 10); 21 28 22 29 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 23 30 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 31 32 Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, null, pelaaja1, new Vector(-1000, 0)); 33 Keyboard.Listen(Key.Right, ButtonState.Down, LiikutaPelaajaa, null,pelaaja1, new Vector(1000, 0)); 34 Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaa, null, pelaaja1, new Vector(0, 1000)); 35 Keyboard.Listen(Key.Down, ButtonState.Down,LiikutaPelaajaa, null,pelaaja1, new Vector(0, -1000)); 36 37 Keyboard.Listen(Key.A, ButtonState.Down, LiikutaPelaajaa, null,pelaaja2, new Vector(-1000, 0)); 38 Keyboard.Listen(Key.D, ButtonState.Down, LiikutaPelaajaa, null,pelaaja2, new Vector(1000, 0)); 39 Keyboard.Listen(Key.W, ButtonState.Down, LiikutaPelaajaa, null,pelaaja2, new Vector(0, 1000)); 40 Keyboard.Listen(Key.S, ButtonState.Down, LiikutaPelaajaa, null,pelaaja2, new Vector(0, -1000)); 41 42 43 44 45 46 47 48 49 24 50 25 51 LuoKivi(100, 50); … … 27 53 LuoKivi(29, 58); 28 54 LuoKivi(50, 79); 29 LuoKivi( 79, 600);55 LuoKivi(600, 600); 30 56 LuoKivi(600, 200); 31 57 LuoKivi(400, 129); 32 LuoKivi(50, 60 0);58 LuoKivi(50, 60); 33 59 34 LuoAvaruusalus(10, 10); 35 LuoAvaruusalus(100, 100); 60 36 61 37 62 38 63 39 64 } 65 66 void LiikutaPelaajaa(PhysicsObject pelaaja, Vector vektori) 67 { 68 pelaaja.Push(vektori); 69 } 70 71 72 73 40 74 41 75 void LuoKivi(double x, double y) … … 53 87 } 54 88 55 voidLuoAvaruusalus(double x, double y)89 PhysicsObject LuoAvaruusalus(double x, double y) 56 90 { 57 91 PhysicsObject avaruusalus = new PhysicsObject(40, 20); 92 avaruusalus.Image = avaruusaluskuva; 58 93 avaruusalus.Shape = Shape.Rectangle; 59 94 Add(avaruusalus); 60 95 avaruusalus.X = x; 61 96 avaruusalus.Y = y; 97 98 return avaruusalus; 62 99 } 63 100 } -
2017/27/MikaelL/Avaruuspeli/Avaruuspeli/Avaruuspeli/Avaruuspeli.csproj.Debug.cachefile
r8907 r8922 1 1 Content\taustakuva.xnb 2 2 Content\kivi.xnb 3 Content\avaruusalus.xnb -
2017/27/MikaelL/Avaruuspeli/Avaruuspeli/Avaruuspeli/obj/x86/Debug/Avaruuspeli.csproj.FileListAbsolute.txt
r8907 r8922 9 9 C:\MyTemp\MikaelL\Avaruuspeli\Avaruuspeli\Avaruuspeli\obj\x86\Debug\Avaruuspeli.pdb 10 10 C:\MyTemp\MikaelL\Avaruuspeli\Avaruuspeli\Avaruuspeli\bin\x86\Debug\Content\kivi.xnb 11 C:\MyTemp\MikaelL\Avaruuspeli\Avaruuspeli\Avaruuspeli\bin\x86\Debug\Content\avaruusalus.xnb -
2017/27/MikaelL/Avaruuspeli/Avaruuspeli/Avaruuspeli/obj/x86/Debug/ContentPipeline-{AD724EC1-5229-49D5-96B8-8FAD2BC51818}.xml
r8907 r8922 19 19 <Output>C:\MyTemp\MikaelL\Avaruuspeli\Avaruuspeli\Avaruuspeli\bin\x86\Debug\Content\kivi.xnb</Output> 20 20 <Time>2017-07-05T09:58:40.6863467+03:00</Time> 21 </Item> 22 <Item> 23 <Source>avaruusalus.png</Source> 24 <Name>avaruusalus</Name> 25 <Importer>TextureImporter</Importer> 26 <Processor>TextureProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\MyTemp\MikaelL\Avaruuspeli\Avaruuspeli\Avaruuspeli\bin\x86\Debug\Content\avaruusalus.xnb</Output> 29 <Time>2017-07-05T11:38:04.6874743+03:00</Time> 21 30 </Item> 22 31 <BuildSuccessful>true</BuildSuccessful> -
2017/27/MikaelL/Avaruuspeli/Avaruuspeli/Avaruuspeli/obj/x86/Debug/cachefile-{AD724EC1-5229-49D5-96B8-8FAD2BC51818}-targetpath.txt
r8907 r8922 1 1 Content\taustakuva.xnb 2 2 Content\kivi.xnb 3 Content\avaruusalus.xnb -
2017/27/MikaelL/Avaruuspeli/Avaruuspeli/AvaruuspeliContent/AvaruuspeliContent.contentproj
r8907 r8922 59 59 </Compile> 60 60 </ItemGroup> 61 <ItemGroup> 62 <Compile Include="avaruusalus.png"> 63 <Name>avaruusalus</Name> 64 <Importer>TextureImporter</Importer> 65 <Processor>TextureProcessor</Processor> 66 </Compile> 67 </ItemGroup> 61 68 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 62 69 <!-- 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.