Changeset 2947
- Timestamp:
- 2012-06-12 14:37:07 (10 years ago)
- Location:
- 2012/24/VilmaK/Tasohyppelypeli1
- Files:
-
- 14 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.cs
r2935 r2947 9 9 public class Tasohyppelypeli1 : PhysicsGame 10 10 { 11 const double nopeus = 200;12 const double hyppyNopeus = 1 000;11 const double nopeus = 400; 12 const double hyppyNopeus = 1300; 13 13 const int RUUDUN_KOKO = 40; 14 14 15 15 PlatformCharacter pelaaja1; 16 16 17 Image pelaajanKuva = LoadImage(" norsu");18 Image tahtiKuva = LoadImage("tahti");17 Image pelaajanKuva = LoadImage("Pingviini"); 18 //Image tahtiKuva = LoadImage("tahti"); 19 19 20 20 SoundEffect maaliAani = LoadSoundEffect("maali"); … … 27 27 lisaaNappaimet(); 28 28 29 Camera.Follow(pelaaja1); 30 Camera.ZoomFactor = 1.2; 31 Camera.StayInLevel = true; 29 Camera.ZoomToLevel(); 30 // Camera.ZoomToAllObjects(); 31 //Camera.StayInLevel = true; 32 //Camera.Follow(pelaaja1); 32 33 } 33 34 34 35 void luoKentta() 35 36 { 36 TileMap kentta = TileMap.FromFile("kentta1.txt"); 37 kentta.SetTileMethod('#', lisaaTaso); 38 kentta.SetTileMethod('*', lisaaTahti); 39 kentta.SetTileMethod('N', lisaaPelaaja); 37 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 38 kentta.SetTileMethod('b', lisaaTaso); 39 kentta.SetTileMethod('*', lisaaTimantti); 40 kentta.SetTileMethod('P', lisaaPelaaja); 41 //kentta.SetTileMethod('m', lisaaMaa); 40 42 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 41 43 Level.CreateBorders(); 42 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 44 // Level.Background.CreateGradient(Color.White, Color.SkyBlue); 45 Level.BackgroundColor = Color.Yellow; 43 46 } 44 47 … … 51 54 } 52 55 53 void lisaaT ahti(Vector paikka, double leveys, double korkeus)56 void lisaaTimantti(Vector paikka, double leveys, double korkeus) 54 57 { 55 PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys, korkeus); 56 tahti.IgnoresCollisionResponse = true; 57 tahti.Position = paikka; 58 tahti.Image = tahtiKuva; 59 tahti.Tag = "tahti"; 60 Add(tahti); 58 PhysicsObject timantti = PhysicsObject.CreateStaticObject(leveys, korkeus); 59 timantti.IgnoresCollisionResponse = false; 60 timantti.Position = paikka; 61 timantti.Shape = Shape.Diamond; 62 timantti.Color = Color.Turquoise; 63 //timantti.Image = tahtiKuva; 64 // timantti.Tag = "tahti"; 65 Add(timantti); 61 66 } 62 67 63 68 void lisaaPelaaja(Vector paikka, double leveys, double korkeus) 64 69 { 65 pelaaja1 = new PlatformCharacter( leveys, korkeus);70 pelaaja1 = new PlatformCharacter(130, 100); 66 71 pelaaja1.Position = paikka; 67 72 pelaaja1.Mass = 4.0; … … 102 107 void kasittelePelaajanTormays(PhysicsObject hahmo, PhysicsObject kohde) 103 108 { 104 if (kohde.Tag.ToString() == "t ahti")109 if (kohde.Tag.ToString() == "timantti") 105 110 { 106 111 maaliAani.Play(); 107 MessageDisplay.Add("Keräsit t ähden!");112 MessageDisplay.Add("Keräsit timantin!"); 108 113 kohde.Destroy(); 109 114 } 110 115 } 111 void luoPingviini()116 void LuoPingviini() 112 117 { 113 PhysicsObject pingviini = new PhysicsObject ( 40, 40);118 PhysicsObject pingviini = new PhysicsObject (100, 100); 114 119 pingviini.Shape = Shape.Circle; 115 120 pingviini.Color = Color.Transparent; 121 Image hahmo = LoadImage("Pingviini"); 122 pingviini.X = 100; 123 pingviini.Y = 200; 116 124 Add(pingviini); 125 126 //GameObject timantti = new GameObject(10, 10); 127 // timantti.Shape = Shape.Diamond; 128 // timantti.Color = Color.Turquoise; 129 // Add(timantti); 117 130 118 131 } 119 void luoTausta()132 void LuoTausta() 120 133 { 121 134 // Image taustaKuva = LoadImage ("Saaripeli"); … … 125 138 Level.Background.FitToLevel(); 126 139 140 Add(tausta); 141 127 142 } 128 void luoKentta()129 {130 131 }132 133 134 135 136 143 } -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.csproj
r2935 r2947 118 118 <Content Include="Game.ico" /> 119 119 <Content Include="GameThumbnail.png" /> 120 <Content Include="kentta1.txt">121 <CopyToOutputDirectory>Always</CopyToOutputDirectory>122 </Content>123 120 </ItemGroup> 124 121 <ItemGroup> -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.csproj.Debug.cachefile
r2935 r2947 1 1 Content\maali.xnb 2 Content\norsu.xnb3 Content\tahti.xnb4 2 Content\Saaripeli.xnb 5 kentta1.txt 3 Content\Pingviini.xnb 4 Content\kentta1.xnb 5 Content\kentta2.xnb 6 Content\kentta3.xnb 7 Content\kentta4.xnb 8 Content\kentta5.xnb -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/Tasohyppelypeli1.csproj.FileListAbsolute.txt
r2935 r2947 15 15 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\obj\x86\Debug\Tasohyppelypeli1.exe 16 16 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\obj\x86\Debug\Tasohyppelypeli1.pdb 17 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\kentta1.txt18 17 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\maali.xnb 19 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\norsu.xnb20 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\tahti.xnb21 18 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Saaripeli.xnb 22 19 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Tasohyppelypeli1.exe … … 24 21 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Jypeli4.dll 25 22 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Jypeli4.xml 23 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Pingviini.xnb 24 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta1.xnb 25 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta2.xnb 26 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta3.xnb 27 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta4.xnb 28 C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta5.xnb -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/cachefile-{3D11F9FF-84D7-4FD4-9CD5-2D7DDC927B82}-targetpath.txt
r2935 r2947 1 1 Content\maali.xnb 2 Content\norsu.xnb3 Content\tahti.xnb4 2 Content\Saaripeli.xnb 3 Content\Pingviini.xnb 4 Content\kentta1.xnb 5 Content\kentta2.xnb 6 Content\kentta3.xnb 7 Content\kentta4.xnb 8 Content\kentta5.xnb -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/Tasohyppelypeli1Content.contentproj
r2935 r2947 50 50 <Processor>SoundEffectProcessor</Processor> 51 51 </Compile> 52 <Compile Include="norsu.png">53 <Name>norsu</Name>54 <Importer>TextureImporter</Importer>55 <Processor>TextureProcessor</Processor>56 </Compile>57 <Compile Include="tahti.png">58 <Name>tahti</Name>59 <Importer>TextureImporter</Importer>60 <Processor>TextureProcessor</Processor>61 </Compile>62 52 </ItemGroup> 63 53 <ItemGroup> … … 66 56 <Importer>TextureImporter</Importer> 67 57 <Processor>TextureProcessor</Processor> 58 </Compile> 59 </ItemGroup> 60 <ItemGroup> 61 <Compile Include="Pingviini.png"> 62 <Name>Pingviini</Name> 63 <Importer>TextureImporter</Importer> 64 <Processor>TextureProcessor</Processor> 65 </Compile> 66 </ItemGroup> 67 <ItemGroup> 68 <Compile Include="kentta1.txt"> 69 <Name>kentta1</Name> 70 <Importer>TextFileImporter</Importer> 71 <Processor>TextFileContentProcessor</Processor> 72 </Compile> 73 </ItemGroup> 74 <ItemGroup> 75 <Compile Include="kentta2.txt"> 76 <Name>kentta2</Name> 77 <Importer>TextFileImporter</Importer> 78 <Processor>TextFileContentProcessor</Processor> 79 </Compile> 80 </ItemGroup> 81 <ItemGroup> 82 <Compile Include="kentta3.txt"> 83 <Name>kentta3</Name> 84 <Importer>TextFileImporter</Importer> 85 <Processor>TextFileContentProcessor</Processor> 86 </Compile> 87 </ItemGroup> 88 <ItemGroup> 89 <Compile Include="kentta4.txt"> 90 <Name>kentta4</Name> 91 <Importer>TextFileImporter</Importer> 92 <Processor>TextFileContentProcessor</Processor> 93 </Compile> 94 </ItemGroup> 95 <ItemGroup> 96 <Compile Include="kentta5.txt"> 97 <Name>kentta5</Name> 98 <Importer>TextFileImporter</Importer> 99 <Processor>TextFileContentProcessor</Processor> 68 100 </Compile> 69 101 </ItemGroup> -
2012/24/VilmaK/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/obj/x86/Debug/ContentPipeline.xml
r2935 r2947 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\maali.xnb</Output> 11 <Time>2012-06-11T14:14:14+03:00</Time> 12 </Item> 13 <Item> 14 <Source>norsu.png</Source> 15 <Name>norsu</Name> 16 <Importer>TextureImporter</Importer> 17 <Processor>TextureProcessor</Processor> 18 <Options>None</Options> 19 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\norsu.xnb</Output> 20 <Time>2012-06-11T14:14:14+03:00</Time> 21 </Item> 22 <Item> 23 <Source>tahti.png</Source> 24 <Name>tahti</Name> 25 <Importer>TextureImporter</Importer> 26 <Processor>TextureProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\tahti.xnb</Output> 29 <Time>2012-06-11T14:14:14+03:00</Time> 11 <Time>2012-06-12T10:24:08.8354152+03:00</Time> 30 12 </Item> 31 13 <Item> … … 36 18 <Options>None</Options> 37 19 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Saaripeli.xnb</Output> 38 <Time>2012-06-11T14:27:21+03:00</Time> 20 <Time>2012-06-12T10:24:08.9446152+03:00</Time> 21 </Item> 22 <Item> 23 <Source>Pingviini.png</Source> 24 <Name>Pingviini</Name> 25 <Importer>TextureImporter</Importer> 26 <Processor>TextureProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\Pingviini.xnb</Output> 29 <Time>2012-06-12T10:35:43.2736152+03:00</Time> 30 </Item> 31 <Item> 32 <Source>kentta1.txt</Source> 33 <Name>kentta1</Name> 34 <Importer>TextFileImporter</Importer> 35 <Processor>TextFileContentProcessor</Processor> 36 <Options>None</Options> 37 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2012-06-12T14:36:36.3747152+03:00</Time> 39 </Item> 40 <Item> 41 <Source>kentta2.txt</Source> 42 <Name>kentta2</Name> 43 <Importer>TextFileImporter</Importer> 44 <Processor>TextFileContentProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta2.xnb</Output> 47 <Time>2012-06-12T13:14:52.2087152+03:00</Time> 48 </Item> 49 <Item> 50 <Source>kentta3.txt</Source> 51 <Name>kentta3</Name> 52 <Importer>TextFileImporter</Importer> 53 <Processor>TextFileContentProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta3.xnb</Output> 56 <Time>2012-06-12T13:28:14.7727152+03:00</Time> 57 </Item> 58 <Item> 59 <Source>kentta4.txt</Source> 60 <Name>kentta4</Name> 61 <Importer>TextFileImporter</Importer> 62 <Processor>TextFileContentProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta4.xnb</Output> 65 <Time>2012-06-12T13:28:10.1407152+03:00</Time> 66 </Item> 67 <Item> 68 <Source>kentta5.txt</Source> 69 <Name>kentta5</Name> 70 <Importer>TextFileImporter</Importer> 71 <Processor>TextFileContentProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\VilmaK\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta5.xnb</Output> 74 <Time>2012-06-12T13:28:20.9807152+03:00</Time> 39 75 </Item> 40 76 <BuildSuccessful>true</BuildSuccessful> … … 80 116 <Assembly> 81 117 <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 82 <Value>2012-01-20T10:2 8:50.7077545+02:00</Value>118 <Value>2012-01-20T10:26:03.0457588+02:00</Value> 83 119 </Assembly> 84 120 </Assemblies>
Note: See TracChangeset
for help on using the changeset viewer.