Changeset 1060
- Timestamp:
- 2010-07-05 14:21:11 (13 years ago)
- Location:
- 2010/24/sijoseha/EfektiDemo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/24/sijoseha/EfektiDemo/EfektiDemo.csproj
r1040 r1060 57 57 </PropertyGroup> 58 58 <ItemGroup> 59 <Reference Include="Jypeli2, Version=2.3. 0.0, Culture=neutral, processorArchitecture=x86">59 <Reference Include="Jypeli2, Version=2.3.1.0, Culture=neutral, processorArchitecture=x86"> 60 60 <SpecificVersion>False</SpecificVersion> 61 <HintPath>..\ Jypeli\bin\x86\Debug\Jypeli2.dll</HintPath>61 <HintPath>..\lib\Jypeli2.dll</HintPath> 62 62 </Reference> 63 63 <Reference Include="Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> -
2010/24/sijoseha/EfektiDemo/Ohjelma.cs
r1004 r1060 10 10 using (Peli game = new Peli()) 11 11 { 12 game.IsFullScreen = true; 12 13 game.Run(); 13 14 } -
2010/24/sijoseha/EfektiDemo/Peli.cs
r1040 r1060 10 10 ExplosionSystem rajahdys1, rajahdys2, rajahdys3, rajahdys4; 11 11 Flames liekki1, liekki2; 12 PhysicsObject kuula; 12 13 protected override void Begin() 13 14 { 14 PhysicsObjectkuula = new PhysicsObject(20, 20);15 kuula = new PhysicsObject(20, 20); 15 16 kuula.Position = new Vector(0, 0); 17 kuula.IsVisible = false; 16 18 Add(kuula); 17 19 Level.BackgroundColor = Color.Black; … … 19 21 Image glow = LoadImage("Red"); 20 22 Image glow2 = LoadImage("Yellow"); 21 rajahdys1 = new ExplosionSystem(expl, glow,1000);23 rajahdys1 = new ExplosionSystem(expl, 1000); 22 24 rajahdys2 = new ExplosionSystem(expl, 1000); 23 25 rajahdys3 = new ExplosionSystem(glow, 1000); 24 rajahdys4 = new ExplosionSystem(glow2, 10);26 rajahdys4 = new ExplosionSystem(glow2, 4); 25 27 liekki1 = new Flames(glow, glow2, 400, Angle.Degrees(270)); 26 28 liekki2 = new Flames(glow2, 400, Angle.Degrees(270)); 27 liekki1.Position = new Vector(-200, 0); 29 liekki1.Position = new Vector(-100, 0); 30 liekki1.MaxVelocity = 0; 31 liekki1.MinVelocity = 0; 32 liekki2.Position = new Vector(100, 0); 28 33 rajahdys2.MinLifetime = 0.2; 29 34 rajahdys2.MaxLifetime = 0.4; … … 38 43 rajahdys4.MinVelocity = 1; 39 44 rajahdys4.MaxVelocity = 2; 40 Add(rajahdys1); 41 //Add(rajahdys2); 45 //Add(rajahdys1); 46 Add(rajahdys2); 47 rajahdys2.SourceObject = kuula; 42 48 //Add(rajahdys3); 43 49 //Add(rajahdys4); 44 Add(liekki1);50 //Add(liekki1); 45 51 //liekki1.SourceObject = kuula; 46 52 //Add(liekki2); 47 53 48 ps = new ParticleSystem(glow, 10);54 ps = new ParticleSystem(glow, glow2, 100, true); 49 55 ps.MaxAcceleration = 1; 50 ps.MaxLifetime = 1;56 ps.MaxLifetime = 0.6; 51 57 ps.MaxRotation = 0; 52 58 ps.MaxRotationSpeed = 0; … … 54 60 ps.MaxVelocity = 10; 55 61 ps.MinAcceleration = 1; 56 ps.MinLifetime = 1;62 ps.MinLifetime = 0.4; 57 63 ps.MinRotation = 0; 58 64 ps.MinRotationSpeed = 0; 59 ps.MinScale = 1;65 ps.MinScale = 0.5; 60 66 ps.MinVelocity = 10; 61 //Add(ps); 67 Add(ps); 68 //ps.SourceObject = kuula; 62 69 63 70 Timer t = new Timer(); 64 t.Interval = 1;71 t.Interval = 0.01; 65 72 t.Trigger += new Timer.TriggerHandler(t_Trigger1); 66 73 Add(t); … … 90 97 void t_Trigger1(Timer sender) 91 98 { 92 ps.AddEffect( 0, 0, 4);99 ps.AddEffect(RandomGen.NextDouble(Level.Left, Level.Right), RandomGen.NextDouble(Level.Top, Level.Bottom), 2); 93 100 rajahdys1.AddEffect(RandomGen.NextDouble(Level.Left, Level.Right), RandomGen.NextDouble(Level.Top, Level.Bottom), 30); 94 101 rajahdys3.AddEffect(RandomGen.NextDouble(Level.Left, Level.Right), RandomGen.NextDouble(Level.Top, Level.Bottom), 30); … … 110 117 rajahdys4.AddEffect(RandomGen.NextDouble(Level.Left, Level.Right), RandomGen.NextDouble(Level.Top, Level.Bottom), 1); 111 118 } 119 protected override void Update(Time time) 120 { 121 kuula.Position = Mouse.PositionOnWorld; 122 base.Update(time); 123 } 112 124 }
Note: See TracChangeset
for help on using the changeset viewer.