Changeset 4093
- Timestamp:
- 2013-06-12 14:59:03 (10 years ago)
- Location:
- 2013/24/JuhoR/FysiikkaPeli3/FysiikkaPeli3
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/24/JuhoR/FysiikkaPeli3/FysiikkaPeli3/FysiikkaPeli3/FysiikkaPeli3.cs
r4089 r4093 9 9 public class FysiikkaPeli3 : PhysicsGame 10 10 { 11 int kenttanro = 1; 12 11 13 PhysicsObject pelaaja; 12 14 Image pelaajankuva = LoadImage("pelaaja"); … … 15 17 void LuoKentta() 16 18 { 17 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("kenttä 2");19 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("kenttä4"); 18 20 19 21 ruudut.SetTileMethod(Color.FromHexCode("4CFF00"), LuoPelaaja); … … 43 45 pelaaja.Position = paikka; 44 46 pelaaja.Destroyed += peliloppuu; 45 47 pelaaja.LinearDamping = 0.9; 46 48 47 49 Camera.Follow(pelaaja); … … 118 120 tarina.SizeMode = TextSizeMode.Wrapped; 119 121 ikkuna.Add(tarina); 122 kenttanro++; 120 123 Seuraavakenttä(); 121 124 } … … 134 137 135 138 Keyboard.Listen(Key.Left, ButtonState.Down, 136 LiikutaPelaajaa, null, new Vector(-4 0, 0));139 LiikutaPelaajaa, null, new Vector(-450, 0)); 137 140 Keyboard.Listen(Key.Right, ButtonState.Down, 138 LiikutaPelaajaa, null, new Vector(4 0, 0));141 LiikutaPelaajaa, null, new Vector(450, 0)); 139 142 Keyboard.Listen(Key.Up, ButtonState.Down, 140 LiikutaPelaajaa, null, new Vector(0, 4 0));143 LiikutaPelaajaa, null, new Vector(0, 450)); 141 144 Keyboard.Listen(Key.Down, ButtonState.Down, 142 LiikutaPelaajaa, null, new Vector(0, -4 0));145 LiikutaPelaajaa, null, new Vector(0, -450)); 143 146 144 147 } … … 151 154 { 152 155 ClearAll(); 156 157 if (kenttanro == 1) LuoKentta(); 158 else if (kenttanro == 2) LuoKentta2(); 159 else if (kenttanro == 3) LuoKentta3(); 160 153 161 TeeKontrollit(); 154 LuoKentta2();155 162 } 156 163 … … 167 174 } 168 175 176 void LuoKentta3() 177 { 178 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("kenttä4"); 179 180 ruudut.SetTileMethod(Color.FromHexCode("4CFF00"), LuoPelaaja); 181 ruudut.SetTileMethod(Color.Black, LuoTaso); 182 ruudut.SetTileMethod(Color.FromHexCode("FFD800"), LuoTahti); 183 ruudut.SetTileMethod(Color.FromHexCode("FF0000"), LuoVihollinen); 184 185 ruudut.Execute(20, 20); 186 } 187 188 169 189 } -
2013/24/JuhoR/FysiikkaPeli3/FysiikkaPeli3/FysiikkaPeli3Content/FysiikkaPeli3Content.contentproj
r4089 r4093 73 73 </Compile> 74 74 </ItemGroup> 75 <ItemGroup> 76 <Compile Include="kenttä4.png"> 77 <Name>kenttä4</Name> 78 <Importer>TextureImporter</Importer> 79 <Processor>TextureProcessor</Processor> 80 </Compile> 81 </ItemGroup> 75 82 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 76 83 <!-- 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.