- Timestamp:
- 2016-04-16 14:58:45 (7 years ago)
- Location:
- 2015/27/JaakkoS
- Files:
-
- 6 added
- 2 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/JaakkoS/RPGpeli/RPGpeli/RPGpeli/RPGpeli.cs
r7136 r7150 28 28 static private Image[] ritariTaakse = LoadImages("RanimaatioT1", "RanimaatioT2"); 29 29 Animation ritariTaakseAnim = new Animation(ritariTaakse); 30 Image ritariOikea = LoadImage("Ritarioikealle"); 31 Image ritariVasen = LoadImage("Ritarivasemmalle"); 30 32 Image ritariTaka = LoadImage("Ritaritaka"); 31 33 static private Image[] RHyokE = LoadImages("RHyökkäysE1", "RHyökkäysE2", "RHyökkäysE3"); … … 46 48 bool damage = true; 47 49 50 Dictionary<Direction, Image> kuvat = new Dictionary<Direction, Image>(); 48 51 Dictionary<Direction, Animation> hyokkaykset = new Dictionary<Direction, Animation>(); 49 52 Direction suunta = Direction.Down; 53 54 List<PhysicsObject> vihut = new List<PhysicsObject>(); 50 55 51 56 public override void Begin() … … 55 60 hyokkaykset.Add(Direction.Up, RHyokkaysTAnim); 56 61 hyokkaykset.Add(Direction.Down, RHyokkaysEAnim); 62 63 kuvat.Add(Direction.Down, ritariKuva); 64 kuvat.Add(Direction.Up, ritariTaka); 65 kuvat.Add(Direction.Left, ritariOikea); 66 kuvat.Add(Direction.Right, ritariVasen); 57 67 58 68 … … 83 93 84 94 85 //lisaaLuola(0, 200);95 lisaaLuola(0, 200); 86 96 87 97 Level.CreateBorders(); … … 111 121 void LaitaAnimaatio(Animation anim, Direction uusiSuunta) 112 122 { 113 pelaaja.Animation = ritariTaakseAnim;123 pelaaja.Animation = anim; 114 124 pelaaja.Animation.FPS = 4; 115 125 pelaaja.Animation.Start(); … … 122 132 pelaaja.Animation.FPS = 8; 123 133 pelaaja.Animation.Start(1); 134 pelaaja.Animation.Played += delegate { pelaaja.Image = kuvat[suunta]; }; 135 if (vihut.Count > 0) 136 { 137 double minDistance = Double.MaxValue; 138 PhysicsObject lahin = vihut[0]; 139 foreach (PhysicsObject vihu in vihut) 140 { 141 if (Vector.Distance(pelaaja.Position, vihu.Position) < minDistance) 142 { 143 minDistance = Vector.Distance(pelaaja.Position, vihu.Position); 144 lahin = vihu; 145 } 146 } 147 if (minDistance < 150) 148 { 149 lahin.Destroy(); 150 } 151 } 124 152 } 125 153 void LiikutaPelaajaa(PhysicsObject pelaaja, Vector vektori) … … 132 160 Vihu = new PhysicsObject(50, 70); 133 161 Vihu.MaximumLifetime = TimeSpan.FromSeconds(5.0); 162 Vihu.Destroyed += delegate { vihut.Remove(Vihu); }; 134 163 Vihu.X = x; 135 164 Vihu.Y = y; … … 146 175 Vihu.Brain = seuraajaAivot; 147 176 177 vihut.Add(Vihu); 148 178 149 179 Add(Vihu); -
2015/27/JaakkoS/RPGpeli/RPGpeli/RPGpeli/RPGpeli.csproj.Debug.cachefile
r7136 r7150 30 30 Content\RhyökkÀysV2.xnb 31 31 Content\RHyökkÀysV3.xnb 32 Content\aalto.xnb 32 33 Content\Vihollien1.png -
2015/27/JaakkoS/RPGpeli/RPGpeli/RPGpeli/obj/x86/Debug/ContentPipeline-{387B9DE7-CFA5-49C1-8050-699303AA8829}.xml
r7136 r7150 280 280 <Output>C:\MyTemp\JaakkoS\RPGpeli\RPGpeli\RPGpeli\bin\x86\Debug\Content\RHyökkäysV3.xnb</Output> 281 281 <Time>2016-03-12T12:46:31.693517+02:00</Time> 282 </Item> 283 <Item> 284 <Source>aalto.png</Source> 285 <Name>aalto</Name> 286 <Importer>TextureImporter</Importer> 287 <Processor>TextureProcessor</Processor> 288 <Options>None</Options> 289 <Output>C:\MyTemp\JaakkoS\RPGpeli\RPGpeli\RPGpeli\bin\x86\Debug\Content\aalto.xnb</Output> 290 <Time>2016-04-16T10:51:30.3481886+03:00</Time> 282 291 </Item> 283 292 <BuildSuccessful>true</BuildSuccessful> -
2015/27/JaakkoS/RPGpeli/RPGpeli/RPGpeli/obj/x86/Debug/RPGpeli.csproj.FileListAbsolute.txt
r7136 r7150 39 39 C:\MyTemp\JaakkoS\RPGpeli\RPGpeli\RPGpeli\bin\x86\Debug\Content\RhyökkÀysV2.xnb 40 40 C:\MyTemp\JaakkoS\RPGpeli\RPGpeli\RPGpeli\bin\x86\Debug\Content\RHyökkÀysV3.xnb 41 C:\MyTemp\JaakkoS\RPGpeli\RPGpeli\RPGpeli\bin\x86\Debug\Content\aalto.xnb -
2015/27/JaakkoS/RPGpeli/RPGpeli/RPGpeli/obj/x86/Debug/cachefile-{387B9DE7-CFA5-49C1-8050-699303AA8829}-targetpath.txt
r7136 r7150 30 30 Content\RhyökkÀysV2.xnb 31 31 Content\RHyökkÀysV3.xnb 32 Content\aalto.xnb 32 33 Content\Vihollien1.png -
2015/27/JaakkoS/RPGpeli/RPGpeli/RPGpeliContent/RPGpeliContent.contentproj
r7136 r7150 227 227 </Compile> 228 228 </ItemGroup> 229 <ItemGroup> 230 <Compile Include="aalto.png"> 231 <Name>aalto</Name> 232 <Importer>TextureImporter</Importer> 233 <Processor>TextureProcessor</Processor> 234 </Compile> 235 </ItemGroup> 229 236 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 230 237 <!-- 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.