Changeset 1131 for 2010/27/jomiilri/Duel/Peli.cs
- Timestamp:
- 2010-07-07 11:32:02 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/jomiilri/Duel/Peli.cs
r1108 r1131 6 6 public class Peli : PhysicsGame 7 7 { 8 PhysicsObject pelaaja1; 8 PlatformCharacter p1; 9 PlatformCharacter p2; 10 9 11 10 12 const int ruudunLeveys = 32; … … 14 16 { 15 17 LuoKentta(); 18 AloitaPeli(); 19 IsFullScreen = true; 20 p1 = LuoHahmo(); 21 Add(p1); 22 LuoOhjaimet(); 16 23 } 17 24 25 void AloitaPeli() 26 { 27 GameObject alareuna = Level.CreateBottomBorder(); 28 GameObject ylareuna = Level.CreateTopBorder(); 29 alareuna.Image = LoadImage("tausta1"); 30 ylareuna.Image = LoadImage("tausta1"); 31 32 //Level.Background.Image = LoadImage("taustakuva1"); 33 //Level.Background.FitToLevel(); 34 35 Camera.ZoomToLevel(); 36 } 37 18 38 void LuoKentta() 19 39 { … … 28 48 PhysicsObject seina = PhysicsObject.CreateStaticObject(32.0, 32.0); 29 49 seina.Shape = Shapes.Rectangle; 30 seina. Color = Color.Gray;50 seina.Image = LoadImage("tausta1"); 31 51 return seina; 32 52 } 33 53 54 PlatformCharacter LuoHahmo() 55 { 56 PlatformCharacter ukko = new PlatformCharacter(32, 32); 57 58 return ukko; 59 } 60 61 void LiikutaPelaajaa() 62 { 63 64 } 65 66 void LuoOhjaimet() 67 { 68 Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, null); 69 Keyboard.Listen(Key.Right, ButtonState.Down, LiikutaPelaajaa, null); 70 Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaa, null); 71 Keyboard.Listen(Key.Down, ButtonState.Down, LiikutaPelaajaa, null); 72 } 73 34 74 }
Note: See TracChangeset
for help on using the changeset viewer.