- Timestamp:
- 2017-07-04 15:00:25 (6 years ago)
- Location:
- 2017/27/JuusoM
- Files:
-
- 9 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/27/JuusoM/peli/peli/peli/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r8848 r8897 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2017-07-03T11:33:06.5413448+03:00</Time> 38 <Time>2017-07-04T09:41:19.071971+03:00</Time> 39 </Item> 40 <Item> 41 <Source>police.png</Source> 42 <Name>police</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\police.xnb</Output> 47 <Time>2017-07-04T13:50:40.3567478+03:00</Time> 48 </Item> 49 <Item> 50 <Source>kentta.png</Source> 51 <Name>kentta</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\kentta.xnb</Output> 56 <Time>2017-07-04T14:21:05.0710531+03:00</Time> 57 </Item> 58 <Item> 59 <Source>gangster.png</Source> 60 <Name>gangster</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\gangster.xnb</Output> 65 <Time>2017-07-04T14:09:38.3775893+03:00</Time> 39 66 </Item> 40 67 <BuildSuccessful>true</BuildSuccessful> -
2017/27/JuusoM/peli/peli/peli/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r8848 r8897 3 3 Content\tahti.xnb 4 4 Content\kentta1.xnb 5 Content\police.xnb 6 Content\kentta.xnb 7 Content\gangster.xnb -
2017/27/JuusoM/peli/peli/peli/obj/x86/Debug/peli.csproj.FileListAbsolute.txt
r8848 r8897 11 11 C:\MyTemp\JuusoM\peli\peli\peli\obj\x86\Debug\peli.exe 12 12 C:\MyTemp\JuusoM\peli\peli\peli\obj\x86\Debug\peli.pdb 13 C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\police.xnb 14 C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\kentta.xnb 15 C:\MyTemp\JuusoM\peli\peli\peli\bin\x86\Debug\Content\gangster.xnb -
2017/27/JuusoM/peli/peli/peli/peli.cs
r8848 r8897 9 9 public class peli : PhysicsGame 10 10 { 11 Vector nopeus = new Vector ( 200, 00);12 Vector nopeus1 = new Vector(00, 200);11 Vector nopeus = new Vector (8000, 00); 12 Vector nopeus1 = new Vector(00, 8000); 13 13 14 //const double hyppyNopeus = 750;14 15 15 const int RUUDUN_KOKO = 40; 16 16 17 17 PhysicsObject pelaaja1; 18 18 19 Image pelaajanKuva = LoadImage(" norsu");19 Image pelaajanKuva = LoadImage("police"); 20 20 Image tahtiKuva = LoadImage("tahti"); 21 Image gangsteri = LoadImage("gangster"); 21 22 22 23 SoundEffect maaliAani = LoadSoundEffect("maali"); … … 35 36 void LuoKentta() 36 37 { 37 38 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 39 kentta.SetTileMethod('#', LisaaTaso); 40 kentta.SetTileMethod('*', LisaaTahti); 41 kentta.SetTileMethod('N', LisaaPelaaja); 42 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 43 Level.CreateBorders(); 44 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 38 39 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("kentta"); 40 41 ruudut.SetTileMethod(Color.Black, LisaaTaso); 42 ruudut.SetTileMethod("4800FF", LisaaPelaaja); 43 ruudut.SetTileMethod("808080", LisaaGangsteri); 44 45 ruudut.Execute(20, 20); 46 47 48 Level.Background.CreateGradient(Color.AshGray, Color.AshGray); 45 49 Gravity = new Vector(0.0, -800.0); 46 50 } … … 50 54 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 51 55 taso.Position = paikka; 52 taso.Color = Color.Green; 56 taso.Color = Color.Gray; 57 taso.Tag = "seina"; 53 58 Add(taso); 54 59 } 55 60 61 62 void LisaaGangsteri(Vector paikka, double leveys, double korkeus) 63 { 64 65 PhysicsObject gangsta = new PhysicsObject(RUUDUN_KOKO / 2, RUUDUN_KOKO / 2); 66 gangsta.Position = paikka; 67 gangsta.Image = gangsteri; 68 gangsta.CanRotate = false; 69 gangsta.IgnoresGravity = true; 70 gangsta.LinearDamping = 0.7; 71 72 73 74 LabyrinthWandererBrain labyrinttiAivot = new LabyrinthWandererBrain(RUUDUN_KOKO); 75 labyrinttiAivot.Speed = 100.0; 76 labyrinttiAivot.LabyrinthWallTag = "seina"; 77 78 gangsta.Brain = labyrinttiAivot; 79 Add(gangsta); 80 } 56 81 void LisaaTahti(Vector paikka, double leveys, double korkeus) 57 82 { 83 58 84 PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys, korkeus); 59 85 tahti.IgnoresCollisionResponse = true; … … 73 99 pelaaja1.CanRotate = false; 74 100 pelaaja1.IgnoresGravity = true; 101 pelaaja1.LinearDamping = 0.7; 75 102 Add(pelaaja1); 76 103 } … … 82 109 83 110 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 84 Keyboard.Listen(Key.Left, ButtonState.Released, Liikuta, "Liikkuu vasemmalle", pelaaja1, new Vector (0,0));85 111 86 112 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 87 Keyboard.Listen(Key.Right, ButtonState.Released, Liikuta, "Liikkuu vasemmalle", pelaaja1, new Vector(0, 0));88 113 89 114 Keyboard.Listen(Key.Up, ButtonState.Down, Hyppaa, "Pelaaja hyppää", pelaaja1, nopeus1); 90 Keyboard.Listen(Key.Up, ButtonState.Released, Hyppaa, "Pelaaja hyppää", pelaaja1, new Vector (0,0));91 115 92 116 Keyboard.Listen(Key.Down, ButtonState.Down, Hyppaa, "Pelaaja hyppää", pelaaja1, -nopeus1); 93 Keyboard.Listen(Key.Down, ButtonState.Released, Hyppaa, "Pelaaja hyppää", pelaaja1, new Vector(0, 0)); 94 117 95 118 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 96 97 119 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, nopeus); 98 120 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 99 // ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 121 100 122 101 123 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); … … 104 126 void Liikuta(PhysicsObject hahmo, Vector nopeus) 105 127 { 106 hahmo.Move(nopeus); 128 if(nopeus.X < 0) 129 hahmo.TextureWrapSize = new Vector(-1, 1); 130 if (nopeus.X > 0) 131 hahmo.TextureWrapSize = new Vector(1, 1); 132 hahmo.Push(nopeus); 107 133 } 108 134 109 135 void Hyppaa(PhysicsObject hahmo, Vector nopeus1) 110 136 { 111 hahmo. Move(nopeus1);137 hahmo.Push(nopeus1); 112 138 } 113 139 -
2017/27/JuusoM/peli/peli/peli/peli.csproj.Debug.cachefile
r8848 r8897 3 3 Content\tahti.xnb 4 4 Content\kentta1.xnb 5 Content\police.xnb 6 Content\kentta.xnb 7 Content\gangster.xnb -
2017/27/JuusoM/peli/peli/peliContent/kentta1.txt
r8848 r8897 11 11 ## ## ## ## 12 12 13 * * * * 14 ## ## ## ## ## 15 13 * * * ******************* 14 ## ## ## ## ################### 16 15 N 17 ###################### 16 ############################################## -
2017/27/JuusoM/peli/peli/peliContent/peliContent.contentproj
r8848 r8897 67 67 </Compile> 68 68 </ItemGroup> 69 <ItemGroup> 70 <Compile Include="police.png"> 71 <Name>police</Name> 72 <Importer>TextureImporter</Importer> 73 <Processor>TextureProcessor</Processor> 74 </Compile> 75 </ItemGroup> 76 <ItemGroup> 77 <Compile Include="kentta.png"> 78 <Name>kentta</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 </Compile> 82 </ItemGroup> 83 <ItemGroup> 84 <Compile Include="gangster.png"> 85 <Name>gangster</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 </ItemGroup> 69 90 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 70 91 <!-- 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.