- Timestamp:
- 2014-07-24 10:47:50 (9 years ago)
- Location:
- 2014/30/AarniAR
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid.cs
r5600 r5617 13 13 private Image[] shootinganimation = LoadImages("shootinganimation"); 14 14 private Image[] jumpinganimation = LoadImages("jumpinganimation"); 15 private Image[] lifelost = LoadImages("LifeLost"); 15 16 const double nopeus = 200; 16 17 const double hyppyNopeus = 750; 17 18 const int RUUDUN_KOKO = 40; 18 19 PlasmaCannon pelaajan1Ase; 20 DoubleMeter health; 19 21 20 22 … … 28 30 public override void Begin() 29 31 { 32 SmoothTextures = false; 33 AloitaPeli(); 34 } 35 36 void AloitaPeli() 37 { 38 ClearAll(); 30 39 Gravity = new Vector(0, -1000); 31 SmoothTextures = false;32 40 33 41 LuoKentta(); 34 42 LisaaNappaimet(); 43 LuoPistelaskuri(); 35 44 36 45 Camera.Follow(pelaaja1); … … 92 101 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 93 102 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 94 Keyboard.Listen(Key. Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus);103 Keyboard.Listen(Key.Space, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 95 104 Keyboard.Listen(Key. C, ButtonState.Pressed, Ammu, "Ampuu", pelaajan1Ase); 96 105 … … 119 128 maaliAani.Play(); 120 129 MessageDisplay.Add("Ouch!"); 130 health.Value -= 2; 131 121 132 //stumper.Destroy(); 122 133 } … … 129 140 void LuoPistelaskuri() 130 141 { 131 IntMeter pelaajanElamat = new IntMeter(10); 132 pelaajanElamat.MinValue = 0; 133 pelaajanElamat.LowerLimit += PelaajaHaviaa; 142 health = new DoubleMeter(10); 143 health.MaxValue = 15; 144 health.MinValue = 0; 145 health.LowerLimit += PelaajaHaviaa; 146 /* 147 health.Changed += delegate 148 { 149 Animation anim = new Animation(lifelost); 150 anim.FPS = 2.0; 151 pelaaja1.PlayAnimation(anim); 152 }; 153 */ 154 ProgressBar healthMeter = new ProgressBar(150, 20); 155 healthMeter.X = Screen.Left + 150; 156 healthMeter.Y = Screen.Top - 100; 157 healthMeter.BindTo(health); 158 Add(healthMeter); 159 160 healthMeter.Angle = Angle.RightAngle; 161 healthMeter.Color = Color.Transparent; 162 healthMeter.BarColor = Color.Red; 163 healthMeter.BorderColor = Color.Black; 164 165 166 134 167 } 135 168 void PelaajaHaviaa() 136 169 { 137 170 MessageDisplay.Add("Life Lost..."); 171 pelaaja1.Destroy(); 172 GameObject kuoli = new GameObject(pelaaja1.Width, pelaaja1.Height); 173 kuoli.Image = lifelost[0]; 174 kuoli.Position = pelaaja1.Position; 175 Add(kuoli); 176 177 Timer.SingleShot(2, kuoli.Destroy); 178 Timer.SingleShot(5, AloitaPeli); 138 179 } 139 180 } -
2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid.csproj.Debug.cachefile
r5600 r5617 9 9 Content\Shootinganimation.xnb 10 10 Content\jumpinganimation.xnb 11 Content\LifeLost.xnb -
2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/obj/x86/Debug/AdventureOfStarKid.csproj.FileListAbsolute.txt
r5600 r5617 17 17 C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\Shootinganimation.xnb 18 18 C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\jumpinganimation.xnb 19 C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\LifeLost.xnb -
2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/obj/x86/Debug/ContentPipeline-{ECF942E0-B21C-45ED-8977-79F4B42A7C44}.xml
r5600 r5617 92 92 <Time>2014-07-23T14:42:04.3043512+03:00</Time> 93 93 </Item> 94 <Item> 95 <Source>LifeLost.png</Source> 96 <Name>LifeLost</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\LifeLost.xnb</Output> 101 <Time>2014-07-24T10:36:40.4322288+03:00</Time> 102 </Item> 94 103 <BuildSuccessful>true</BuildSuccessful> 95 104 <Settings> -
2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/obj/x86/Debug/cachefile-{ECF942E0-B21C-45ED-8977-79F4B42A7C44}-targetpath.txt
r5600 r5617 9 9 Content\Shootinganimation.xnb 10 10 Content\jumpinganimation.xnb 11 Content\LifeLost.xnb -
2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKidContent/AdventureOfStarKidContent.contentproj
r5600 r5617 109 109 </Compile> 110 110 </ItemGroup> 111 <ItemGroup> 112 <Compile Include="LifeLost.png"> 113 <Name>LifeLost</Name> 114 <Importer>TextureImporter</Importer> 115 <Processor>TextureProcessor</Processor> 116 </Compile> 117 </ItemGroup> 111 118 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 112 119 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.