- Timestamp:
- 2013-06-27 14:51:24 (10 years ago)
- Location:
- 2013/26/MaxL/Keulaa2
- Files:
-
- 8 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/26/MaxL/Keulaa2/Keulaa/Keulaa/Keulaa.cs
r4255 r4266 9 9 public class Keulaa : PhysicsGame 10 10 { 11 List<PhysicsObject> tasot = new List<PhysicsObject>(); 12 11 13 Image moponKuva = LoadImage("RM125"); 12 14 Image rengaskuva = LoadImage("rengas"); … … 19 21 Image kyparanKuva = LoadImage("Kypara"); 20 22 Image vartalonKuva = LoadImage("Paita"); 23 Image maanKuva = LoadImage("Maa"); 24 Image maanAllaKuva = LoadImage("Maanalla"); 21 25 22 26 //PhysicsObject Vartalo; … … 33 37 Vector taakse = new Vector(-5500, 0); 34 38 double kaasu2 = -50; 35 36 39 40 Vector oikeaReuna; 41 Vector taustanReuna; 37 42 38 43 39 44 public override void Begin() 40 45 { 41 46 42 47 43 48 MultiSelectWindow alkuValikko = new MultiSelectWindow("Mopo peli", "Aloita", "Lopeta"); … … 45 50 LuoOhjaimet(); 46 51 LuoKentta(); 47 48 GameObject tausta = new GameObject(Screen.Width, Screen.Height); 49 tausta.Image = taustaKuva; 50 Add(tausta, -3); 51 Layers[-3].RelativeTransition = new Vector(0.5, 0.5); 52 GameObject tausta2 = new GameObject(Screen.Width, Screen.Height); 53 tausta2.Image = taustaKuva; 54 Add(tausta2, -3); 55 tausta2.X = tausta.Right; 56 GameObject pilvet = new GameObject(Screen.Width, Screen.Height); 57 pilvet.Image = pilvenKuva; 58 Add(tausta, -2); 59 Layers[-2].RelativeTransition = new Vector(0.2, 0.1); 52 LuoTausta(); 53 54 oikeaReuna = new Vector(Level.Right, -560); 55 taustanReuna = new Vector(Level.Right, -200); 56 57 Timer ajastin1 = new Timer(); 58 ajastin1.Interval = 0.1; 59 ajastin1.Timeout += LisaaTasoja; 60 ajastin1.Start(); 61 62 Timer ajastin2 = new Timer(); 63 ajastin2.Interval = 1.5; 64 ajastin2.Timeout += LisaaTaustoja; 65 ajastin2.Timeout += PoistaTasoja; 66 ajastin2.Start(); 67 68 69 60 70 61 71 Gravity = new Vector(0, -1000); 62 72 Camera.Follow(mopo); 63 64 73 74 65 75 66 76 } … … 106 116 //PhysicsObject Takarengas = new PhysicsObject(75, 75, Shape.Circle); 107 117 Takarengas.CollisionIgnoreGroup = 1; 108 Takarengas.AngularDamping = 0. 7;118 Takarengas.AngularDamping = 0.96; 109 119 Takarengas.KineticFriction = 1; 110 120 Takarengas.Image = trengaskuva; … … 124 134 } 125 135 136 void LisaaTasoja() 137 { 138 if (Vector.Distance(mopo.Position, oikeaReuna) < 1500) 139 { 140 LuoTaso(oikeaReuna, 140, 140); 141 oikeaReuna.X += 140; 142 } 143 144 145 } 146 147 void PoistaTasoja() 148 { 149 for (int i = 0; i < tasot.Count; i++) 150 { 151 if (tasot[i].Right < mopo.X - Screen.Width) 152 { 153 tasot[i].Destroy(); 154 tasot.Remove(tasot[i]); 155 } 156 157 } 158 159 } 160 void LisaaTaustoja() 161 { 162 LuoTausta(); 163 taustanReuna.X += -600; 164 165 } 166 126 167 void LuoAjaja() 127 168 { … … 129 170 Vartalo.Color = Color.Yellow; 130 171 Vartalo.Y = mopo.Top-10; 131 Vartalo.X = - 30;132 AxleJoint VartaloLiitos = new AxleJoint(mopo, Vartalo, new Vector(- 30, Vartalo.Bottom));172 Vartalo.X = -25; 173 AxleJoint VartaloLiitos = new AxleJoint(mopo, Vartalo, new Vector(-25, Vartalo.Bottom + 10)); 133 174 Vartalo.Mass = 2; 134 175 Vartalo.Image = vartalonKuva; … … 187 228 Keyboard.Listen(Key.Down, ButtonState.Released, JarruPois, "Jarru!", Eturengas); 188 229 230 Keyboard.Listen(Key.T, ButtonState.Pressed, Jarru, null, mopo, 0.0001); 231 Keyboard.Listen(Key.T, ButtonState.Released, JarruPois, null, mopo); 232 189 233 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Lopeta"); 190 234 } … … 203 247 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 204 248 taso.Position = paikka; 205 //taso.Image = groundImage;249 taso.Image = maanKuva; 206 250 //taso.CollisionIgnoreGroup = 1; 207 251 Add(taso); 208 252 taso.KineticFriction = 1; 209 PhysicsObject maa = Level.CreateBottomBorder(0.2, true); 210 maa.KineticFriction = 1; 253 //PhysicsObject maa = Level.CreateBottomBorder(0.2, true); 254 //maa.KineticFriction = 1; 255 256 tasot.Add(taso); 211 257 } 212 258 … … 220 266 221 267 ruudut.Execute(140, 140); 268 } 269 270 void LuoTausta() 271 { 272 //GameObject tausta = new GameObject(Screen.Width, Screen.Height); 273 //tausta.Image = taustaKuva; 274 //Add(tausta, -3); 275 Level.Background.Image = taustaKuva; 276 Level.Background.TileToLevel(); 277 //Layers[-3].RelativeTransition = new Vector(0.5, 0.5); 278 GameObject pilvet = new GameObject(Screen.Width, Screen.Height); 279 pilvet.Image = pilvenKuva; 280 Add(pilvet, -2); 281 Layers[-2].RelativeTransition = new Vector(0.5, 0.4); 222 282 } 223 283 -
2013/26/MaxL/Keulaa2/Keulaa/Keulaa/Keulaa.csproj.Debug.cachefile
r4255 r4266 10 10 Content\Kypara.xnb 11 11 Content\Paita.xnb 12 Content\Maa.xnb 13 Content\Maanalla.xnb -
2013/26/MaxL/Keulaa2/Keulaa/Keulaa/obj/x86/Debug/Keulaa.csproj.FileListAbsolute.txt
r4255 r4266 35 35 C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Kypara.xnb 36 36 C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Paita.xnb 37 C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Maa.xnb 38 C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Maanalla.xnb -
2013/26/MaxL/Keulaa2/Keulaa/Keulaa/obj/x86/Debug/cachefile-{716DCBB6-30E1-436E-8D82-85A469FEA5A5}-targetpath.txt
r4255 r4266 10 10 Content\Kypara.xnb 11 11 Content\Paita.xnb 12 Content\Maa.xnb 13 Content\Maanalla.xnb -
2013/26/MaxL/Keulaa2/Keulaa/KeulaaContent/KeulaaContent.contentproj
r4255 r4266 120 120 </Compile> 121 121 </ItemGroup> 122 <ItemGroup> 123 <Compile Include="Maa.png"> 124 <Name>Maa</Name> 125 <Importer>TextureImporter</Importer> 126 <Processor>TextureProcessor</Processor> 127 </Compile> 128 </ItemGroup> 129 <ItemGroup> 130 <Compile Include="Maanalla.png"> 131 <Name>Maanalla</Name> 132 <Importer>TextureImporter</Importer> 133 <Processor>TextureProcessor</Processor> 134 </Compile> 135 </ItemGroup> 122 136 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 123 137 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2013/26/MaxL/Keulaa2/Keulaa/KeulaaContent/obj/x86/Debug/ContentPipeline.xml
r4255 r4266 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Kentta.xnb</Output> 20 <Time>2013-06-27T 09:40:28.4410222+03:00</Time>20 <Time>2013-06-27T13:31:08.1482222+03:00</Time> 21 21 </Item> 22 22 <Item> … … 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Frame.xnb</Output> 38 <Time>2013-06-27T 09:40:28.5190222+03:00</Time>38 <Time>2013-06-27T12:04:46.5434222+03:00</Time> 39 39 </Item> 40 40 <Item> … … 72 72 <Options>None</Options> 73 73 <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\KeulaTausta.xnb</Output> 74 <Time>2013-06-27T 09:40:28.3786222+03:00</Time>74 <Time>2013-06-27T14:50:25.7512222+03:00</Time> 75 75 </Item> 76 76 <Item> … … 99 99 <Options>None</Options> 100 100 <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Paita.xnb</Output> 101 <Time>2013-06-27T10:51:57.3778222+03:00</Time> 101 <Time>2013-06-27T11:55:17.8208222+03:00</Time> 102 </Item> 103 <Item> 104 <Source>Maa.png</Source> 105 <Name>Maa</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Maa.xnb</Output> 110 <Time>2013-06-27T13:46:06.9112222+03:00</Time> 111 </Item> 112 <Item> 113 <Source>Maanalla.png</Source> 114 <Name>Maanalla</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\MaxL\Keulaa2\Keulaa\Keulaa\bin\x86\Debug\Content\Maanalla.xnb</Output> 119 <Time>2013-06-27T13:35:35.7462222+03:00</Time> 102 120 </Item> 103 121 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.