- Timestamp:
- 2010-07-29 11:33:28 (13 years ago)
- Location:
- 2010/30/jyniinin
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/jyniinin/SeppoPeli/Content/Content.contentproj
r1376 r1402 76 76 </ItemGroup> 77 77 <ItemGroup> 78 < Compile Include="kenttä 1.txt">78 <None Include="kenttä 1.txt"> 79 79 <Name>kenttä 1</Name> 80 80 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 81 </None> 82 </ItemGroup> 83 <ItemGroup> 84 <Compile Include="Koti Maali.png"> 85 <Name>Koti Maali</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 81 88 </Compile> 82 89 </ItemGroup> -
2010/30/jyniinin/SeppoPeli/Peli.cs
r1376 r1402 7 7 class Tasohyppely : PhysicsGame 8 8 { 9 10 Image paikallaanVasemmalle = LoadImage("Seppo 2"); 11 Image paikallaanOikealle; 12 13 Image[] kavelyVasemmalle = LoadImages("seppo 4"); 14 Image[] kavelyOikealle; 15 16 17 18 9 19 const double nopeus = 200; 10 20 const double hyppyVoima = 4000; 11 21 12 22 PlatformCharacter Seppo; 13 PlatformCharacter vihollinen;23 PlatformCharacter norsu; 14 24 PlatformCharacter tahti; 25 PlatformCharacter maali; 26 15 27 16 28 … … 18 30 19 31 protected override void Begin() 32 20 33 { 21 34 Gravity = new Vector(0, -1000); 35 36 Image paikallaanVasemmalle = LoadImage("heppu1"); 37 Image paikallaanOikealle; 38 39 Image[] kavelyVasemmalle = LoadImages("heppu1", "heppu2", "heppu3"); 40 Image[] kavelyOikealle; 41 42 43 22 44 23 45 luoKentta(); … … 45 67 lisaaTaso(-200, -350); 46 68 lisaaTaso(0, -200); 47 69 48 70 49 71 lisaaPelaajat(); 50 72 LisaaViholliset(); 73 51 74 } 75 52 76 53 77 void lisaaTaso(double x, double y) … … 62 86 void lisaaPelaajat() 63 87 { 64 Seppo = new PlatformCharacter( 20,50);88 Seppo = new PlatformCharacter(30,50); 65 89 Seppo.Mass = 4.0; 66 90 Seppo.Image = LoadImage("Seppo"); … … 69 93 70 94 Add(Seppo); 95 96 maali = new PlatformCharacter(120, 130); 97 maali.Mass = 4.0; 98 maali.Image = LoadImage("Koti Maali"); 99 maali.X = 200; 100 maali.Y = Level.Bottom + 120; 101 102 Add(maali); 71 103 } 72 104 void LisaaViholliset() 73 105 { 74 vihollinen = new PlatformCharacter(80, 80); 75 vihollinen.Mass = 8.0; 76 vihollinen.Image = LoadImage("norsu"); 77 vihollinen.X = 40; 78 vihollinen.Y = Level.Bottom + 420; 106 norsu = new PlatformCharacter(80, 80); 107 norsu.Mass = 8.0; 108 norsu.Image = LoadImage("norsu"); 109 norsu.X = 40; 110 norsu.Y = Level.Bottom + 420; 111 79 112 80 Add(vihollinen); 113 114 Add(norsu); 81 115 82 116 tahti = new PlatformCharacter(40, 40); 83 tahti.Mass = 0.5;117 tahti.Mass = 10.0; 84 118 tahti.Image = LoadImage("tahti"); 85 119 tahti.X = 100; 86 120 tahti.Y = Level.Bottom + 320; 121 tahti.AngularVelocity = 5.0; 87 122 88 123 Add(tahti); 89 124 90 125 } 91 92 93 94 95 96 97 126 98 127 … … 111 140 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", Seppo, nopeus); 112 141 ControllerOne.Listen(Button.A, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", Seppo, hyppyVoima); 142 ControllerOne.Listen(Button.Start, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 143 113 144 } 114 145 … … 120 151 void hyppaa(PlatformCharacter hahmo, double voima) 121 152 { 122 hahmo.Jump(voima );153 hahmo.Jump(voima ); 123 154 } 124 155
Note: See TracChangeset
for help on using the changeset viewer.