Changeset 620
- Timestamp:
- 2010-06-09 14:55:24 (13 years ago)
- Location:
- 2010/23/leperoih
- Files:
-
- 43 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/leperoih/Tasohyppely2/Content/Content.contentproj
r570 r620 68 68 </Compile> 69 69 </ItemGroup> 70 <ItemGroup> 71 <Compile Include="portaali.png"> 72 <Name>portaali</Name> 73 <Importer>TextureImporter</Importer> 74 <Processor>TextureProcessor</Processor> 75 </Compile> 76 </ItemGroup> 77 <ItemGroup> 78 <Compile Include="päämies.png"> 79 <Name>päämies</Name> 80 <Importer>TextureImporter</Importer> 81 <Processor>TextureProcessor</Processor> 82 </Compile> 83 </ItemGroup> 84 <ItemGroup> 85 <Compile Include="pedobear.png"> 86 <Name>pedobear</Name> 87 <Importer>TextureImporter</Importer> 88 <Processor>TextureProcessor</Processor> 89 </Compile> 90 </ItemGroup> 91 <ItemGroup> 92 <Compile Include="baby.jpg"> 93 <Name>baby</Name> 94 <Importer>TextureImporter</Importer> 95 <Processor>TextureProcessor</Processor> 96 </Compile> 97 </ItemGroup> 98 <ItemGroup> 99 <Compile Include="mother.jpg"> 100 <Name>mother</Name> 101 <Importer>TextureImporter</Importer> 102 <Processor>TextureProcessor</Processor> 103 </Compile> 104 </ItemGroup> 105 <ItemGroup> 106 <Compile Include="vasemmalleliikkuu.png"> 107 <Name>vasemmalleliikkuu</Name> 108 <Importer>TextureImporter</Importer> 109 <Processor>TextureProcessor</Processor> 110 </Compile> 111 </ItemGroup> 112 <ItemGroup> 113 <Compile Include="oikealleliikkuu.png"> 114 <Name>oikealleliikkuu</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 </Compile> 118 </ItemGroup> 119 <ItemGroup> 120 <Compile Include="oikealleliikkuu2.png"> 121 <Name>oikealleliikkuu2</Name> 122 <Importer>TextureImporter</Importer> 123 <Processor>TextureProcessor</Processor> 124 </Compile> 125 </ItemGroup> 70 126 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 71 127 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2010/23/leperoih/Tasohyppely2/Peli.cs
r570 r620 16 16 17 17 PlatformCharacter pelaaja1; 18 PhysicsObject pahikset; 18 19 19 20 int kenttaNro; // monesko kenttä on menossa … … 22 23 protected override void Begin() 23 24 { 25 Timer ajastin = new Timer(); 26 ajastin.Interval = 1; 27 ajastin.Trigger += new Timer.TriggerHandler(VihollinenLyo); 28 Add(ajastin); 29 ajastin.Start(); 24 30 kenttaNro = 0; 25 31 Level.Width = 2000; … … 43 49 44 50 seuraavaKentta(); 45 MessageDisplay.Add("Etsi iso tähti!"); 51 MessageDisplay.Add("Etsi iso portaali!"); 52 } 53 54 protected override void Update(Time time) 55 { 56 onkoPelaajaLahella(); 57 base.Update(time); 46 58 } 47 59 … … 65 77 { 66 78 Level.CreateBorders(); 67 Level.Background.CreateGradient(Color.White, Color.Red); 68 69 lisaaTaso(300, 100); 70 lisaaTaso(0, -200); 71 lisaaTaso(-375, -150); 79 Level.Background.CreateGradient(Color.Green, Color.Blue); 80 81 lisaaTaso(-150, -200); 82 lisaaTaso(-150, -350); 83 lisaaTaso(-100, -425); 84 lisaaTaso(300, 0); 85 lisaaTaso(0, -250); 86 lisaaTaso(-375, -200); 72 87 lisaaTaso(-150, 500); 73 88 lisaaTaso(200,-250); 74 89 lisaaTaso(-250, 100); 90 lisaaTaso(-500, -400); 91 lisaaTaso(-550, -300); 75 92 76 93 lisaaMaali(); … … 81 98 { 82 99 Level.CreateBorders(); 83 84 100 } 85 101 … … 87 103 { 88 104 PhysicsObject taso = PhysicsObject.CreateStaticObject(100, 30); 89 taso.Color = Color. Brown;105 taso.Color = Color.Green; 90 106 taso.X = x; 91 107 taso.Y = y; … … 97 113 pelaaja1 = new PlatformCharacter(40, 80); 98 114 pelaaja1.Mass = 14.0; 99 pelaaja1.Image = LoadImage("My char");115 //pelaaja1.Image = LoadImage("My char"); 100 116 pelaaja1.X = 0; 101 117 pelaaja1.Y = Level.Bottom + 120; 118 Juokseminen(); 102 119 103 120 AddCollisionHandler(pelaaja1, osuiMaaliin); 104 121 105 122 Add(pelaaja1); 106 } 107 123 124 pahikset = new PhysicsObject(40, 80); 125 pahikset.Image = LoadImage("pedobear"); 126 pahikset.CanRotate = false; 127 pahikset.StaticFriction = 0.1; 128 pahikset.Mass = 10.0; 129 Add(pahikset); 130 } 131 132 void Juokseminen() 133 { 134 Image[] tekstuurit = LoadImages("oikealleliikkuu", "oikealleliikkuu2"); 135 Animation KavelyTekstuuri = new Animation( tekstuurit ); 136 KavelyTekstuuri.FPS = 5; 137 pelaaja1.RightWalkingAnimation = KavelyTekstuuri; 138 pelaaja1.LeftWalkingAnimation = Animation.Mirror( KavelyTekstuuri ); 139 pelaaja1.RightIdleAnimation = new Animation( LoadImage( "My char" ) ); 140 pelaaja1.LeftIdleAnimation = new Animation( Image.Mirror( LoadImage( "My char" ) ) ); 141 } 142 143 void onkoPelaajaLahella() 144 { 145 if (Math.Abs(pelaaja1.X - pahikset.X) < 400 && pelaaja1.Y >= pahikset.Y) 146 { 147 pahikset.Hit(pelaaja1.Position - pahikset.Position); 148 } 149 } 150 151 void VihollinenLyo(Timer sender) 152 { 153 MessageDisplay.Add("vihollinenLyo"); 154 } 108 155 void lisaaMaali() 109 156 { … … 111 158 maali.Tag = "maali"; 112 159 maali.IgnoresCollisionResponse = true; 113 maali.X = 100;114 maali.Y = 300;115 maali.Image = LoadImage(" fffuuuuuuuuu");160 maali.X = 0; 161 maali.Y = 0; 162 maali.Image = LoadImage("portaali"); 116 163 Add(maali); 117 164 } … … 136 183 137 184 controller.Listen(Button.DPadLeft, ButtonState.Down, liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 185 controller.Listen(Button.DPadLeft, ButtonState.Released, liikuta, "Liikkuu vasemmalle", pelaaja1, 0.0); 138 186 controller.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 187 controller.Listen(Button.DPadRight, ButtonState.Released, liikuta, "Liikkuu oikealle", pelaaja1, 0.0); 139 188 controller.Listen(Button.A, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyVoima); 140 189 }
Note: See TracChangeset
for help on using the changeset viewer.