Changeset 670
- Timestamp:
- 2010-06-10 11:43:25 (13 years ago)
- Location:
- 2010/23/laemkaup/Tasohyppelypeli
- Files:
-
- 2 added
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
2010/23/laemkaup/Tasohyppelypeli/Content/Content.contentproj
r636 r670 61 61 </Compile> 62 62 </ItemGroup> 63 <ItemGroup> 64 <Compile Include="porkkana.png"> 65 <Name>porkkana</Name> 66 <Importer>TextureImporter</Importer> 67 <Processor>TextureProcessor</Processor> 68 </Compile> 69 </ItemGroup> 63 70 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 64 71 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2010/23/laemkaup/Tasohyppelypeli/Peli.cs
r653 r670 4 4 using Jypeli.ScreenObjects; 5 5 using Jypeli.Assets; 6 using System.Collections.Generic; 6 7 7 8 8 9 namespace Tasohyppelypeli 10 9 11 { 10 class Tasohyppely : PhysicsGame 11 { 12 13 class Tasohyppely : PhysicsGame 14 { 15 const int ruudunLeveys = 30; 16 const int ruudunKorkeus = 30; 17 18 19 12 20 const double nopeus = 200; 13 21 const double hyppyVoima = 4000; 14 22 15 23 IntMeter pisteLaskuri; 16 24 ValueDisplay pisteNaytto; … … 20 28 int kenttaNro; // monesko kenttä on menossa 21 29 22 30 23 31 protected override void Begin() 24 32 { … … 65 73 void luoKentta() 66 74 { 75 var merkit = new Dictionary<char, ObjectCreator>(); 76 merkit['x'] = LuoPalikka; 77 merkit['p'] = LuoPorkkana; 78 79 char[,] ruudut = Tiles.ReadFromFile("kenttä.txt"); 67 80 68 81 … … 70 83 Level.Background.CreateGradient(Color.Pink, Color.SkyBlue); 71 84 85 /* 72 86 lisaaTaso(-200, -350, 100); 73 87 lisaaTaso(0, -200, 150); … … 87 101 lisaaTaso(-700, 160, 100); 88 102 lisaaTaso(600, -200, 100); 89 90 103 */ 104 Tiles.Insert(this, ruudut, merkit, ruudunLeveys, ruudunKorkeus); 91 105 //lisaaMaali(); 92 106 lisaaPelaajat(); … … 103 117 } 104 118 105 106 107 119 120 PhysicsObject LuoPalikka() 121 { 122 PhysicsObject palikka = PhysicsObject.CreateStaticObject(30.0, 30.0); 123 palikka.Shape = Shapes.Rectangle; 124 palikka.Color = Color.Yellow; 125 return palikka; 126 127 128 } 129 PhysicsObject LuoPorkkana() 130 { 131 PhysicsObject porkkana = PhysicsObject.CreateStaticObject(30.0, 30.0); 132 porkkana.Image = LoadImage("porkkana"); 133 porkkana.Tag = "porkkana"; 134 return porkkana; 135 136 } 137 138 108 139 109 140 … … 174 205 MessageDisplay.Add("Pääsit läpi kentän " + kenttaNro + ". Pisteitä: " + edellisenKentanPisteet); 175 206 } 207 if (otherObject.Tag.ToString() == "porkkana") 208 { 209 MessageDisplay.Add("porkkana"); 210 } 211 176 212 } 177 213 } -
2010/23/laemkaup/Tasohyppelypeli/Tasohyppelypeli.csproj
r606 r670 89 89 <Content Include="Game.ico" /> 90 90 <Content Include="GameThumbnail.png" /> 91 <Content Include="kenttä.txt"> 92 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 93 </Content> 91 94 </ItemGroup> 92 95 <ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.