Changeset 695
- Timestamp:
- 2010-06-10 14:58:43 (13 years ago)
- Location:
- 2010/23/johanh
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/johanh/Tasohyppely1/Content/Content.contentproj
r657 r695 82 82 </Compile> 83 83 </ItemGroup> 84 <ItemGroup> 85 <Compile Include="Laukku.png"> 86 <Name>Laukku</Name> 87 <Importer>TextureImporter</Importer> 88 <Processor>TextureProcessor</Processor> 89 </Compile> 90 </ItemGroup> 84 91 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 85 92 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2010/23/johanh/Tasohyppely1/Peli.cs
r657 r695 3 3 using Jypeli.ScreenObjects; 4 4 using Jypeli.Assets; 5 using System.Collections.Generic; 5 6 6 7 … … 43 44 44 45 // Zoomataan lähemmäksi 45 Camera.ZoomFactor = 1. 75;46 Camera.ZoomFactor = 1.0; 46 47 47 48 Camera.StayInLevel = true; … … 76 77 void luoKentta() 77 78 { 78 Level.CreateBorders();79 Level.Background.CreateGradient(Color.White, Color.SkyBlue);80 81 lisaaTaso(-200, -350);82 lisaaTaso(0, -200);83 lisaaTaso(0, -250); 84 lisaaTaso(100, 500);85 lisaaTaso(0, 700);86 lisaaTaso(0, 900); 79 const int ruudunLeveys = 50; 80 const int ruudunKorkeus = 50; 81 var merkit = new Dictionary<char, ObjectCreator>(); 82 merkit['x'] = LuoPalikka; 83 merkit['+'] = LuoTahti; 84 85 char[,] ruudut = Tiles.ReadFromFile("kentta.txt"); 86 Tiles.Insert(this, ruudut, merkit, ruudunLeveys, ruudunKorkeus); 87 87 88 88 89 lisaaMaali(); 89 90 lisaaPelaajat(); 90 91 } 92 93 PhysicsObject LuoPalikka() 94 { 95 PhysicsObject palikka = PhysicsObject.CreateStaticObject(50.0, 50.0,Shapes.Rectangle,CollisionShapeQuality.Good); 96 return palikka; 97 } 98 99 PhysicsObject LuoTahti() 100 { 101 PhysicsObject tahti = PhysicsObject.CreateStaticObject(25.0, 25.0); 102 return tahti; 103 } 104 91 105 92 106 void lisaaTaso(double x, double y) … … 98 112 Add(taso); 99 113 } 114 void lisaataso(double x, double y) 115 { 116 117 Add(pelaaja1); 118 } 119 100 120 101 121 void lisaaPelaajat() 102 122 { 103 pelaaja1 = new PlatformCharacter( 50, 50);123 pelaaja1 = new PlatformCharacter(49, 49); 104 124 pelaaja1.Mass = 4.0; 105 125 pelaaja1.Image = LoadImage("Ukko"); … … 111 131 pelaaja1.LeftWalkingAnimation = kavelyTekstuuri; 112 132 pelaaja1.RightWalkingAnimation = Animation.Mirror(kavelyTekstuuri); 113 133 pelaaja1.KineticFriction = 1.0; 114 134 115 135 … … 124 144 void lisaaMaali() 125 145 { 126 PhysicsObject maali = PhysicsObject.CreateStaticObject( 50, 50, Shapes.Circle);146 PhysicsObject maali = PhysicsObject.CreateStaticObject(20, 20, Shapes.Circle); 127 147 maali.Tag = "maali"; 128 148 maali.IgnoresCollisionResponse = true; 129 149 maali.X = 750; 130 150 maali.Y = -60; 131 maali.Image = LoadImage(" tahti");151 maali.Image = LoadImage("Laukku"); 132 152 Add(maali); 133 153 } … … 179 199 int edellisenKentanPisteet = pisteLaskuri.Value; 180 200 seuraavaKentta(); 181 MessageDisplay.Add("Pääsit läpi kentän " + kenttaNro + ". Pisteitä: 201 MessageDisplay.Add("Pääsit läpi kentän " + kenttaNro + ". Pisteitä:" + edellisenKentanPisteet); 182 202 } 183 203 } -
2010/23/johanh/Tasohyppely1/Tasohyppely1.csproj
r632 r695 89 89 <Content Include="Game.ico" /> 90 90 <Content Include="GameThumbnail.png" /> 91 <None Include="Kentta.txt"> 92 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 93 </None> 91 94 </ItemGroup> 92 95 <ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.