Changeset 1382
- Timestamp:
- 2010-07-28 14:56:14 (13 years ago)
- Location:
- 2010/30/jumakall
- Files:
-
- 13 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/jumakall/The_Bus_Game_codetesting/Content/Content.contentproj
r1363 r1382 1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 2 2 <PropertyGroup> 3 3 <ProjectGuid>1700fd4b-6c18-4f1e-9161-155a5e8bd7fd</ProjectGuid> … … 34 34 <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> 35 35 </ItemGroup> 36 <ItemGroup> 37 <Compile Include="reittivalitsin.png"> 38 <Name>reittivalitsin</Name> 39 <Importer>TextureImporter</Importer> 40 <Processor>TextureProcessor</Processor> 41 </Compile> 42 </ItemGroup> 36 43 </Project> -
2010/30/jumakall/The_Bus_Game_codetesting/Peli.cs
r1363 r1382 6 6 public class Peli : PhysicsGame 7 7 { 8 Image osotinkuva = LoadImage("reittivalitsin"); 8 9 9 10 PhysicsObject osoitin; 11 PhysicsObject pallo; 12 double palloja; 13 double vaihda; 10 14 11 15 protected override void Begin() … … 13 17 osoitin = LuoOsoitin(); 14 18 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Sulje"); 19 pallo = LuoPallo(); 20 21 Mouse.Listen(MouseButton.Left, ButtonState.Down, Pam, "Luo räjähdys"); 22 Camera.ZoomToLevel(); 23 Gravity = new Vector(0.0, -500.0); 24 PhysicsObject vasenReuna = Level.CreateLeftBorder(); 25 vasenReuna.Restitution = 1.0; 26 vasenReuna.IsVisible = false; 27 PhysicsObject oikeaReuna = Level.CreateRightBorder(); 28 oikeaReuna.Restitution = 1.0; 29 oikeaReuna.IsVisible = false; 30 PhysicsObject ylaReuna = Level.CreateTopBorder(); 31 ylaReuna.Restitution = 1.0; 32 ylaReuna.IsVisible = false; 33 PhysicsObject alaReuna = Level.CreateBottomBorder(); 34 alaReuna.Restitution = 1.0; 35 alaReuna.IsVisible = false; 36 palloja = 0; 37 vaihda = 0; 15 38 } 16 39 … … 18 41 { 19 42 base.Update(time); 43 44 if (vaihda == 10) 45 { 46 Level.BackgroundColor = RandomGen.NextColor(); 47 vaihda = 0; 48 } 49 vaihda++; 50 if (palloja <= 100) 51 { 52 LuoPallo(); 53 palloja++; 54 } 20 55 if (osoitin != null) 21 56 { … … 29 64 PhysicsObject LuoOsoitin() 30 65 { 31 PhysicsObject osoitin = new PhysicsObject( 10.0, 10.0);66 PhysicsObject osoitin = new PhysicsObject(25.0, 25.0); 32 67 osoitin.Shape = Shapes.Circle; 33 68 osoitin.Color = Color.White; … … 35 70 osoitin.Y = Mouse.PositionOnScreen.Y; 36 71 osoitin.Restitution = 1.0; 72 osoitin.Image = osotinkuva; 37 73 38 74 osoitin.IgnoresCollisionResponse = true; … … 45 81 return osoitin; 46 82 } 83 84 PhysicsObject LuoPallo() 85 { 86 PhysicsObject pallo = new PhysicsObject(20.00, 20.00); 87 pallo.Shape = Shapes.Circle; 88 pallo.Position = RandomGen.NextVector(Level.Right, Level.Bottom, Level.Left, Level.Top); 89 // RandomGen.NextDouble(Level.Right, Level.Left); RandomGen.NextDouble(Level.Top, Level.Bottom); 90 /*pallo.X = 0.0; 91 pallo.Y = 0.0;*/ 92 pallo.Color = RandomGen.NextColor(); 93 94 Add(pallo); 95 96 return pallo; 97 } 98 99 void Pam() 100 { 101 Explosion rajahdys = new Explosion(100.0); 102 rajahdys.Position = Mouse.PositionOnScreen; 103 Add(rajahdys); 104 105 //Lisäasetukset 106 // 107 //rajahdys.Speed = 500.0; 108 //rajahdys.Force = 10000; 109 //rajahdys.ShockwaveColor = Color.Yellow; 110 } 47 111 }
Note: See TracChangeset
for help on using the changeset viewer.