- Timestamp:
- 2015-06-30 11:17:17 (8 years ago)
- Location:
- 2015/27/TapaniS/ProjectStar/ProjectStar/ProjectStar
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/TapaniS/ProjectStar/ProjectStar/ProjectStar/ProjectStar.cs
r6565 r6567 9 9 public class ProjectStar : PhysicsGame 10 10 { 11 IntMeter pisteLaskuri; 12 11 13 Image tasoKuva = LoadImage("monttu"); 12 14 Image taustaKuva = LoadImage("Pemppe3"); … … 21 23 { 22 24 //Level.Background.Image = taustaKuva; 23 24 Level.Size = new Vector(1500, 1000); 25 26 Level.Size = new Vector(1500, 1000); 25 27 //Level.CreateBorders(); 26 28 //Camera.ZoomToLevel(); 27 29 28 ukko = new PlatformCharacter( 40.0, 40.0); 30 ukko = new PlatformCharacter(40.0, 40.0); 31 32 PhysicsObject aloitus = new PhysicsObject(100.0, 20.0); 33 Add(aloitus); 34 aloitus.IgnoresGravity = true; 35 Add(ukko); 36 ukko.Color = Color.Purple; 37 AddCollisionHandler(ukko, "piste", PelaajaSaaPisteen); 29 38 30 39 for (int i = 0; i < 20; i++) … … 34 43 35 44 36 Add(ukko);37 ukko.Color = Color.Purple;38 39 PhysicsObject aloitus = new PhysicsObject(100.0, 20.0);40 Add(aloitus);41 aloitus.IgnoresGravity = true;42 43 45 PhysicsObject piste = new PhysicsObject(20, 20); 44 46 piste.IgnoresGravity = true; … … 58 60 Level.Background.Image = taustaKuva; 59 61 //Camera.ZoomToLevel(); 60 Level.CreateBorders(1, 1, 2, 1.0, Color.Transparent); 62 Level.CreateBorders(1, 1, 2, 1.0, Color.Transparent); 61 63 //Level.Size = new Vector(1650, 1050); 62 64 //Level.Background.FitToLevel(); 63 65 64 66 LiikutaUkkoa(); 65 67 68 LuoPistelaskuri(); 69 66 70 // TODO: Kirjoita ohjelmakoodisi tähän 67 71 … … 88 92 } 89 93 90 void Pelaajaosuu()91 {92 93 }94 95 IntMeter pisteLaskuri;96 94 97 95 void LuoPistelaskuri() 98 96 { 97 pisteLaskuri = new IntMeter(0); 98 99 99 Label pisteNaytto = new Label(); 100 100 pisteNaytto.X = Screen.Left + 100; … … 105 105 pisteNaytto.BindTo(pisteLaskuri); 106 106 Add(pisteNaytto); 107 LuoPistelaskuri();108 107 pisteNaytto.Title = "Pisteet"; 109 108 … … 111 110 } 112 111 112 void PelaajaSaaPisteen(PhysicsObject ukko, PhysicsObject piste) 113 { 114 pisteLaskuri.Value++; 115 piste.Destroy(); 116 } 113 117 }
Note: See TracChangeset
for help on using the changeset viewer.