- Timestamp:
- 2010-07-29 14:54:44 (13 years ago)
- Location:
- 2010/30/jyniinin/SeppoPeli
- Files:
-
- 5 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/jyniinin/SeppoPeli/Content/Content.contentproj
r1402 r1413 18 18 <XnaPlatform>Windows</XnaPlatform> 19 19 </PropertyGroup> 20 <ItemGroup>21 <Compile Include="norsu.png">22 <Name>norsu</Name>23 <Importer>TextureImporter</Importer>24 <Processor>TextureProcessor</Processor>25 </Compile>26 </ItemGroup>27 <ItemGroup>28 <Compile Include="tahti.png">29 <Name>tahti</Name>30 <Importer>TextureImporter</Importer>31 <Processor>TextureProcessor</Processor>32 </Compile>33 </ItemGroup>34 <ItemGroup>35 <Compile Include="maali.wav">36 <Name>maali</Name>37 <Importer>WavImporter</Importer>38 <Processor>SoundEffectProcessor</Processor>39 </Compile>40 </ItemGroup>41 20 <ItemGroup> 42 21 <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.AudioImporters, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> … … 75 54 </Compile> 76 55 </ItemGroup> 77 <ItemGroup>78 <None Include="kenttä 1.txt">79 <Name>kenttä 1</Name>80 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>81 </None>82 </ItemGroup>83 <ItemGroup>84 <Compile Include="Koti Maali.png">85 <Name>Koti Maali</Name>86 <Importer>TextureImporter</Importer>87 <Processor>TextureProcessor</Processor>88 </Compile>89 </ItemGroup>90 56 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 91 57 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2010/30/jyniinin/SeppoPeli/Peli.cs
r1402 r1413 8 8 { 9 9 10 Image paikallaanVasemmalle = LoadImage("Seppo 2");11 Image paikallaanOikealle;12 13 Image[] kavelyVasemmalle = LoadImages("seppo 4");14 Image[] kavelyOikealle;15 16 17 18 10 19 11 const double nopeus = 200; 20 const double hyppyVoima = 4000;12 const double hyppyVoima =3000; 21 13 22 14 PlatformCharacter Seppo; … … 24 16 PlatformCharacter tahti; 25 17 PlatformCharacter maali; 18 PlatformCharacter AntiSeppo; 26 19 27 20 … … 34 27 Gravity = new Vector(0, -1000); 35 28 36 Image paikallaanVasemmalle = LoadImage("heppu1");37 Image paikallaanOikealle;38 39 Image[] kavelyVasemmalle = LoadImages("heppu1", "heppu2", "heppu3");40 Image[] kavelyOikealle;41 42 43 29 44 30 … … 47 33 48 34 Camera.Follow(Seppo); 49 Camera.ZoomFactor = 2.0;35 50 36 Camera.StayInLevel = true; 51 37 … … 65 51 66 52 67 lisaaTaso(-200, -350); 68 lisaaTaso(0, -200); 53 lisaaTaso(-200, -200); 54 lisaaTaso(100, -200); 55 lisaaTaso(100, 200); 56 lisaaTaso(-200, 200); 57 lisaaTaso(-50, 0); 69 58 70 59 71 60 lisaaPelaajat(); 72 LisaaViholliset();73 61 74 62 } … … 86 74 void lisaaPelaajat() 87 75 { 88 Seppo = new PlatformCharacter(30, 50);76 Seppo = new PlatformCharacter(30,60); 89 77 Seppo.Mass = 4.0; 90 78 Seppo.Image = LoadImage("Seppo"); 91 Seppo.X = 0;92 Seppo.Y = Level.Bottom +120;79 Seppo.X = -200; 80 Seppo.Y = 120; 93 81 94 82 Add(Seppo); 95 83 96 maali = new PlatformCharacter(120, 130); 97 maali.Mass = 4.0; 98 maali.Image = LoadImage("Koti Maali"); 99 maali.X = 200; 100 maali.Y = Level.Bottom + 120; 84 101 85 102 Add(maali); 86 AntiSeppo = new PlatformCharacter(30,60); 87 AntiSeppo.Mass = 4.0; 88 AntiSeppo.Image = LoadImage("Seppo 2"); 89 AntiSeppo.X = 100; 90 AntiSeppo.Y = 120; 91 92 Add(AntiSeppo); 93 94 103 95 } 104 void LisaaViholliset() 105 { 106 norsu = new PlatformCharacter(80, 80); 107 norsu.Mass = 8.0; 108 norsu.Image = LoadImage("norsu"); 109 norsu.X = 40; 110 norsu.Y = Level.Bottom + 420; 96 111 97 112 113 114 Add(norsu);115 116 tahti = new PlatformCharacter(40, 40);117 tahti.Mass = 10.0;118 tahti.Image = LoadImage("tahti");119 tahti.X = 100;120 tahti.Y = Level.Bottom + 320;121 tahti.AngularVelocity = 5.0;122 123 Add(tahti);124 125 }126 98 127 99 128 100 void lisaaNappaimet() 129 101 { 130 Keyboard.Listen(Key. F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet");102 Keyboard.Listen(Key.CapsLock, ButtonState.Pressed, Begin, ""); 131 103 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu pelistä"); 132 133 Keyboard.Listen(Key.Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", Seppo, -nopeus);134 Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu oikealle", Seppo, nopeus);135 Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "Hyppää", Seppo, hyppyVoima);136 137 104 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 138 139 105 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, liikuta, "Pelaaja liikkuu vasemmalle", Seppo, -nopeus); 140 106 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", Seppo, nopeus); 141 ControllerOne.Listen(Button.A, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", Seppo, hyppyVoima); 142 ControllerOne.Listen(Button.Start, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 107 ControllerOne.Listen(Button.A, ButtonState.Down, rajahdys3, ""); 108 ControllerOne.Listen(Button.DPadUp, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", Seppo, hyppyVoima); 109 ControllerOne.Listen(Button.X, ButtonState.Pressed, rajahdys, ""); 110 111 ControllerTwo.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 112 ControllerTwo.Listen(Button.DPadLeft, ButtonState.Down, liikuta, "Pelaaja liikkuu vasemmalle", AntiSeppo, -nopeus); 113 ControllerTwo.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", AntiSeppo, nopeus); 114 ControllerTwo.Listen(Button.A, ButtonState.Down, rajahdys4, ""); 115 ControllerTwo.Listen(Button.DPadUp, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", AntiSeppo, hyppyVoima); 116 ControllerTwo.Listen(Button.X, ButtonState.Pressed, rajahdys2, ""); 117 118 119 ControllerOne.Listen(Button.Start, ButtonState.Pressed, restartti, "Aloita peli uudelleen"); 120 ControllerTwo.Listen(Button.Start, ButtonState.Pressed, restartti, "Aloita peli uudelleen"); 121 143 122 144 123 } … … 154 133 } 155 134 156 135 void rajahdys() 136 { 137 Explosion rajahdys = new Explosion(500.00); 138 rajahdys.Position = Seppo.Position; 139 Add(rajahdys); 140 rajahdys.Speed = 500.0; 141 rajahdys.Force = 1000; 142 ControllerOne.Vibrate(99, 99, 99, 99, 0.1); 143 144 145 } 146 void rajahdys2() 147 { 148 Explosion rajahdys = new Explosion(500.00); 149 rajahdys.Position = AntiSeppo.Position; 150 Add(rajahdys); 151 rajahdys.Speed = 500.0; 152 rajahdys.Force = 1000; 153 ControllerTwo.Vibrate(99, 99, 99, 99, 0.1); 154 } 155 156 157 void rajahdys3() 158 { 159 Explosion rajahdys = new Explosion(500.00); 160 rajahdys.Position = Seppo.Position; 161 Add(rajahdys); 162 rajahdys.Speed = 500.0; 163 rajahdys.Force = 200; 164 ControllerOne.Vibrate(99, 99, 99, 99, 0.1); 165 166 } 167 168 169 170 void rajahdys4() 171 { 172 Explosion rajahdys = new Explosion(500.00); 173 rajahdys.Position = AntiSeppo.Position; 174 Add(rajahdys); 175 rajahdys.Speed = 500.0; 176 rajahdys.Force = 200; 177 ControllerTwo.Vibrate(99, 99, 99, 99, 0.1); 178 } 179 180 void restartti() 181 { 182 183 Seppo.X = -200; 184 Seppo.Y = 120; 185 186 AntiSeppo.X = 100; 187 AntiSeppo.Y = 120; 188 189 } 190 191 157 192 } 193 158 194 159 195
Note: See TracChangeset
for help on using the changeset viewer.