Changeset 8876
- Timestamp:
- 2017-07-04 13:37:07 (6 years ago)
- Location:
- 2017/27/EeliN/Selviytyja
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/27/EeliN/Selviytyja/Selviytyja/Selviytyja/Selviytyja.cs
r8864 r8876 11 11 int Speed = 100; 12 12 public Image idleRight = LoadImage("PlayerIdleRight_0"); 13 public Image puuimg = LoadImage("Tree_0"); 13 public Image treeLeaves = LoadImage("TreeLeaves"); 14 public Image treeTrunk = LoadImage("TreeTrunk"); 14 15 public Image stoneimg = LoadImage("Stone_0"); 15 16 private Image[] playerWalkR = LoadImages("PlayerWalkRight_0","PlayerWalkRight_1"); … … 22 23 // TODO: Kirjoita ohjelmakoodisi tähän 23 24 SmoothTextures = false; 24 Player ukko = new Player( 50, 50);25 Player ukko = new Player(22, 42); 25 26 //ukko.MakeStatic(); 26 27 ukko.Image = idleRight; … … 36 37 //ukko.PlayerWalkL = Animation.Mirror(ukko.PlayerWalkR.cl); 37 38 ukko.Restitution = 0; 39 ukko.MaxVelocity = 0; 38 40 Level.Background.Color = Color.Black; 39 41 Add(ukko); … … 65 67 void MoveSideways(Player pelaaja, Vector direction) 66 68 { 67 pelaaja.Velocity = new Vector(direction.X, pelaaja.Velocity.Y);69 //pelaaja.Velocity = new Vector(direction.X, pelaaja.Velocity.Y); 68 70 PlayerAnimation(pelaaja, direction); 71 pelaaja.Velocity += direction; 69 72 } 70 73 71 74 void MoveVertically(Player pelaaja, Vector direction) 72 75 { 73 pelaaja.Velocity = new Vector(pelaaja.Velocity.X, direction.Y); 74 76 //pelaaja.Velocity = new Vector(pelaaja.Velocity.X, direction.Y); 75 77 PlayerAnimation(pelaaja, direction); 78 pelaaja.Velocity += direction; 76 79 } 77 80 … … 101 104 void LuoKivi(double x,double y) 102 105 { 103 PhysicsObject stone = PhysicsObject.CreateStaticObject( 40, 40);106 PhysicsObject stone = PhysicsObject.CreateStaticObject(56, 50); 104 107 stone.Image = stoneimg; 105 108 stone.Shape = Shape.Circle; 109 stone.Restitution = 0; 106 110 stone.X = x; 107 111 stone.Restitution = 0; … … 111 115 for (int i = 0; i < objektilista.Count-1; i++) 112 116 { 113 if ((stone.Position - objektilista[i].Position).Magnitude < 90 )117 if ((stone.Position - objektilista[i].Position).Magnitude < 120 ) 114 118 { 115 119 objektilista.Remove(stone); … … 131 135 void LuoPuu(double x, double y) 132 136 { 133 PhysicsObject puu = PhysicsObject.CreateStaticObject(100, 100); 134 puu.Image = puuimg; 137 Tree puu = new Tree(80, 152); 138 puu.MakeStatic(); 139 puu.Image = treeTrunk; 140 puu.TopImage = treeLeaves; 141 puu.Restitution = 0; 135 142 puu.X = x; 136 143 puu.Y = y; … … 139 146 for (int i = 0; i < objektilista.Count - 1; i++) 140 147 { 141 if ((puu.Position - objektilista[i].Position).Magnitude < 90)148 if ((puu.Position - objektilista[i].Position).Magnitude < 120) 142 149 { 143 150 objektilista.Remove(puu); … … 228 235 229 236 } 237 238 239 public class Tree : PhysicsObject 240 { 241 GameObject Lehti; 242 PhysicsObject runko; 243 244 public Image TopImage 245 { 246 get { return Lehti.Image; } 247 set { Lehti.Image = value;} 248 } 249 250 251 public Tree(double leveys, double korkeus) 252 : base (leveys, korkeus*0.5) 253 { 254 Lehti = new GameObject(leveys, korkeus*0.5); 255 Lehti.Bottom = this.Top; 256 this.Add(Lehti); 257 } 258 259 } -
2017/27/EeliN/Selviytyja/Selviytyja/Selviytyja/Selviytyja.csproj.Debug.cachefile
r8864 r8876 5 5 Content\Tree_0.xnb 6 6 Content\Stone_0.xnb 7 Content\TreeLeaves.xnb 8 Content\TreeTrunk.xnb -
2017/27/EeliN/Selviytyja/Selviytyja/Selviytyja/obj/x86/Debug/ContentPipeline-{3B3FCF0A-DF81-4674-AF8D-360E80F14224}.xml
r8864 r8876 56 56 <Time>2017-07-04T11:54:41.2164752+03:00</Time> 57 57 </Item> 58 <Item> 59 <Source>TreeLeaves.png</Source> 60 <Name>TreeLeaves</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\TreeLeaves.xnb</Output> 65 <Time>2017-07-04T13:16:50.7597747+03:00</Time> 66 </Item> 67 <Item> 68 <Source>TreeTrunk.png</Source> 69 <Name>TreeTrunk</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\TreeTrunk.xnb</Output> 74 <Time>2017-07-04T13:17:40.2425019+03:00</Time> 75 </Item> 58 76 <BuildSuccessful>true</BuildSuccessful> 59 77 <Settings> -
2017/27/EeliN/Selviytyja/Selviytyja/Selviytyja/obj/x86/Debug/Selviytyja.csproj.FileListAbsolute.txt
r8864 r8876 13 13 C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\Tree_0.xnb 14 14 C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\Stone_0.xnb 15 C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\TreeLeaves.xnb 16 C:\MyTemp\EeliN\Selviytyja\Selviytyja\Selviytyja\bin\x86\Debug\Content\TreeTrunk.xnb -
2017/27/EeliN/Selviytyja/Selviytyja/Selviytyja/obj/x86/Debug/cachefile-{3B3FCF0A-DF81-4674-AF8D-360E80F14224}-targetpath.txt
r8864 r8876 5 5 Content\Tree_0.xnb 6 6 Content\Stone_0.xnb 7 Content\TreeLeaves.xnb 8 Content\TreeTrunk.xnb -
2017/27/EeliN/Selviytyja/Selviytyja/SelviytyjaContent/SelviytyjaContent.contentproj
r8864 r8876 87 87 </Compile> 88 88 </ItemGroup> 89 <ItemGroup> 90 <Compile Include="TreeLeaves.png"> 91 <Name>TreeLeaves</Name> 92 <Importer>TextureImporter</Importer> 93 <Processor>TextureProcessor</Processor> 94 </Compile> 95 </ItemGroup> 96 <ItemGroup> 97 <Compile Include="TreeTrunk.png"> 98 <Name>TreeTrunk</Name> 99 <Importer>TextureImporter</Importer> 100 <Processor>TextureProcessor</Processor> 101 </Compile> 102 </ItemGroup> 89 103 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 90 104 <!-- 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.