- Timestamp:
- 2010-06-15 15:57:31 (12 years ago)
- Location:
- 2010/24/vehakala/Lamari10
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/24/vehakala/Lamari10/Content/Content.contentproj
r871 r879 48 48 </Compile> 49 49 </ItemGroup> 50 <ItemGroup> 51 <Compile Include="pelaajapunainen1.png"> 52 <Name>pelaajapunainen1</Name> 53 <Importer>TextureImporter</Importer> 54 <Processor>TextureProcessor</Processor> 55 </Compile> 56 </ItemGroup> 50 57 </Project> -
2010/24/vehakala/Lamari10/Peli.cs
r871 r879 16 16 } 17 17 18 void LuoKentta()18 void LuoKentta() 19 19 { 20 20 Level.Width = 1024; … … 27 27 } 28 28 29 void LisaaPelaaja()29 void LisaaPelaaja() 30 30 { 31 31 pelaaja = new PhysicsObject(30.0, 30.0); 32 pelaaja.Image = LoadImage(" testiukko");32 pelaaja.Image = LoadImage("pelaajapunainen1"); 33 33 Add(pelaaja); 34 34 } 35 35 36 36 37 void AsetaOhjaimet()37 void AsetaOhjaimet() 38 38 { 39 39 Keyboard.Listen(Key.Right, ButtonState.Down, Kaanny, "Käännä pelaajaa", Angle.Degrees(-2)); 40 40 Keyboard.Listen(Key.Left, ButtonState.Down, Kaanny, "Käännä pelaajaa", Angle.Degrees(2)); 41 41 Keyboard.Listen(Key.Up, ButtonState.Down, Eteenpain, "Luistele eteenpain"); 42 Keyboard.Listen(Key.Down, ButtonState.Pressed, Pysayta, "ukko pysahtyy"); 43 Keyboard.Listen(Key.Escape, ButtonState.Pressed, lopeta, "peli sammuu"); 42 44 } 43 45 44 void Kaanny(Angle kulma)46 void Kaanny(Angle kulma) 45 47 { 46 48 pelaaja.Angle += kulma; 47 49 } 48 void Eteenpain()50 void Eteenpain() 49 51 { 50 52 51 53 52 pelaaja.Push(Vector.FromLengthAndAngle(500.0, pelaaja.Angle)); 54 pelaaja.Push(Vector.FromLengthAndAngle(50.0, pelaaja.Angle)); 55 56 } 57 void Pysayta() 58 { 59 pelaaja.Velocity = Vector.Zero; 60 } 61 void lopeta() 62 63 { 64 Exit(); 53 65 } 54 66 55 67 68 69 56 70 }
Note: See TracChangeset
for help on using the changeset viewer.