- Timestamp:
- 2013-07-23 14:43:26 (10 years ago)
- Location:
- 2013/30/VilleF
- Files:
-
- 6 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/30/VilleF/FysiikkaPeli1/FysiikkaPeli1/FysiikkaPeli1/FysiikkaPeli1.cs
r4517 r4577 35 35 void LuoKentta() 36 36 { 37 pallo = new PhysicsObject( 300.0, 300.0);38 pallo.Shape = Shape. Hexagon;37 pallo = new PhysicsObject(100.0, 100.0); 38 pallo.Shape = Shape.Rectangle; 39 39 AddCollisionHandler(pallo, KasittelePallonTormays); 40 40 pallo.KineticFriction = 0.0; 41 pallo.MomentOfInertia = Double.PositiveInfinity;42 41 pallo.Image = havu; 43 42 pallo.X = -200.0; … … 62 61 63 62 PhysicsObject alaReuna = Level.CreateBottomBorder(); 64 alaReuna.Restitution = 1 0.0;63 alaReuna.Restitution = 1.9; 65 64 alaReuna.IsVisible = false; 66 65 alaReuna.KineticFriction = 0.0; … … 83 82 { 84 83 IntMeter laskuri = new IntMeter(0); 85 laskuri.MaxValue = 0;84 laskuri.MaxValue = 10; 86 85 Label naytto = new Label(); 87 86 naytto.BindTo(laskuri); … … 96 95 void AloitaPeli() 97 96 { 98 Vector impulssi = new Vector( 1000,0);97 Vector impulssi = new Vector(2000,0); 99 98 pallo.Hit(impulssi); 100 99 } … … 105 104 maila.X = x; 106 105 maila.Y = y; 107 maila.Restitution = 1 0.0;106 maila.Restitution = 1.9; 108 107 Add(maila); 109 108 return maila; -
2013/30/VilleF/Lentokone/Lentokone/Lentokone/Lentokone.cs
r4568 r4577 9 9 public class Lentokone : PhysicsGame 10 10 { 11 private Animation havuLento; 11 12 12 13 13 14 14 15 Image pommi = LoadImage("pommi"); 15 16 Image maisema = LoadImage("havutausta"); 16 17 Image havusaurus = LoadImage("havusaurus"); … … 18 19 Vector nopeusAlas = new Vector(0, -1000); 19 20 PhysicsObject pelaaja; 21 22 23 24 public override void Begin() 25 { 26 // havuLento = LoadAnimation("havuLento"); 27 Level.Width = 1920; 28 Level.Height = 1080; 29 //SetWindowSize(1024, 800, false); 20 30 21 31 22 32 23 33 24 public override void Begin() 25 { 26 27 Level.Width = 1024; 28 Level.Height = 800; 29 SetWindowSize(1024, 800, false); 30 31 32 33 34 Level.Width = 800; 35 Level.Height = 600; 36 SetWindowSize(800, 600, false); 34 37 35 38 36 LuoKentta(); … … 40 38 LiikutaPelaajaa(); 41 39 Camera.ZoomToLevel(); 42 //TiputaPommi();40 TiputaPommi(); 43 41 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 44 42 … … 46 44 47 45 Keyboard.Listen(Key.Left, ButtonState.Down, 48 LiikutaPelaajaa, null, -1);46 LiikutaPelaajaa, null, -1); 49 47 Keyboard.Listen(Key.Right, ButtonState.Down, 50 48 LiikutaPelaajaa, null, 1); … … 57 55 Keyboard.Listen(Key.Down, ButtonState.Released, 58 56 KaannaPelaajaa, null, 0.0); 57 Keyboard.Listen(Key.Space, ButtonState.Down, TiputaPommi, "Ammu"); 59 58 } 60 void KaannaPelaajaa(double kaannos) 59 void TiputaPommi() 60 { 61 // pommi = new PhysicsObject(100.0, 100.0); 62 // pommi.Shape = Shape.FromImage(pommi); 63 //pommi.Image = pommi; 64 //Add(pommi); 65 } 66 void KaannaPelaajaa(double kaannos) 61 67 { 62 68 pelaaja.AngularVelocity = kaannos; … … 90 96 pelaaja.MirrorImage(); 91 97 Add(pelaaja); 92 98 AddCollisionHandler(pelaaja, CollisionHandler.ExplodeBoth(200, true)); 93 99 } 94 100 void LiikutaPelaajaa() -
2013/30/VilleF/Lentokone/Lentokone/LentokoneContent/LentokoneContent.contentproj
r4567 r4577 67 67 </ItemGroup> 68 68 <ItemGroup> 69 <Compile Include="havu saurus\havusaurus01.png">70 <Name>havu saurus01</Name>69 <Compile Include="havuLento\havuLento01.png"> 70 <Name>havuLento01</Name> 71 71 <Importer>TextureImporter</Importer> 72 72 <Processor>TextureProcessor</Processor> 73 73 </Compile> 74 <Compile Include="havusaurus\Havusaurus02.png"> 75 <Name>Havusaurus02</Name> 74 </ItemGroup> 75 <ItemGroup> 76 <Compile Include="havuLento\havuLento02.png"> 77 <Name>havuLento02</Name> 78 <Importer>TextureImporter</Importer> 79 <Processor>TextureProcessor</Processor> 80 </Compile> 81 </ItemGroup> 82 <ItemGroup> 83 <Compile Include="havuLento.anim"> 84 <Name>havuLento</Name> 85 <Importer>AnimationImporter</Importer> 86 <Processor>AnimationContentProcessor</Processor> 87 </Compile> 88 </ItemGroup> 89 <ItemGroup> 90 <Compile Include="pommi.png"> 91 <Name>pommi</Name> 76 92 <Importer>TextureImporter</Importer> 77 93 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.