Changeset 6270
- Timestamp:
- 2015-06-24 14:59:48 (8 years ago)
- Location:
- 2015/26/FransM/Pixels
- Files:
-
- 6 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/FransM/Pixels/Pixels/Pixels/Pixels.cs
r6238 r6270 20 20 Image alinkuva = LoadImage("Alin"); 21 21 Image ruohokuva = LoadImage("Maapalaruoholla"); 22 22 Image alempikuva = LoadImage("Alempi"); 23 24 23 25 public override void Begin() 24 26 { … … 26 28 27 29 SmoothTextures = false; 28 29 30 31 //Inventory test = new Inventory(); 32 //test.AddItem(new PhysicsObject(porakuva), porakuva); 33 //Add(test); 34 35 MediaPlayer.Play("CaveMusicX"); 36 MediaPlayer.IsRepeating = true; 30 37 31 38 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); … … 34 41 void LuoKentta() 35 42 { 36 Level.Background. CreateGradient(Color.White, Color.Red);43 Level.Background.Image = taustakuva; 37 44 38 45 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("Maa"); … … 44 51 ruudut.SetTileMethod(Color.FromHexCode("0026FF"), LuoTaso5); 45 52 ruudut.SetTileMethod(Color.FromHexCode("00FF21"), LuoTaso6); 46 47 53 ruudut.SetTileMethod(Color.FromHexCode("FF6A00"), LuoTaso7); 54 // ruudut.SetTileMethod(Color.FromHexCode("7F3300"), LuoTaso8); 55 56 48 57 ruudut.Execute(60, 60); 49 50 //Camera.ZoomToLevel(); 58 Level.Background.FitToLevel(); 59 51 60 IsMouseVisible = true; 52 61 Camera.StayInLevel = true; … … 62 71 }, ""); 63 72 IsFullScreen = true; 64 } 65 73 74 75 } 76 void EsineValitsin(Vector paikka) 77 { 78 int arpa = RandomGen.NextInt(0, 100); 79 if (arpa <= 50) 80 { 81 EsineLuoja(paikka, "Pora"); 82 } 83 else 84 { 85 86 } 87 } 88 void EsineLuoja(Vector paikka, String tag) 89 { 90 GameObject esine = new GameObject(LoadImage(tag)); 91 esine.Position = paikka; 92 Add(esine, 1); 93 } 66 94 67 95 void LuoTaso(Vector paikka, double leveys, double korkeus) … … 82 110 taso2.CollisionIgnoreGroup = 1; 83 111 Add(taso2); 112 if (RandomGen.NextInt(0, 100) < 20) 113 { 114 EsineValitsin(paikka); 115 } 84 116 } 85 117 … … 112 144 113 145 void LuoTaso6(Vector paikka, double leveys, double korkeus) 146 114 147 { 115 148 PhysicsObject taso6 = PhysicsObject.CreateStaticObject(leveys, korkeus); … … 119 152 Add(taso6); 120 153 } 154 155 void LuoTaso7(Vector paikka, double leveys, double korkeus) 156 { 157 PhysicsObject taso7 = PhysicsObject.CreateStaticObject(leveys, korkeus); 158 taso7.Position = paikka; 159 taso7.Image = alempikuva; 160 taso7.CollisionIgnoreGroup = 1; 161 Add(taso7); 162 } 121 163 } 164 165 166 /// <summary> 167 /// Esinevalikko. 168 /// </summary> 169 class Inventory : Widget 170 { 171 /// <summary> 172 /// Tapahtuma, kun esine on valittu. 173 /// </summary> 174 public event Action<PhysicsObject> ItemSelected; 175 176 /// <summary> 177 /// Luo uuden esinevalikon. 178 /// </summary> 179 public Inventory() 180 : base(new HorizontalLayout()) 181 { 182 } 183 184 /// <summary> 185 /// Lisää esineen. 186 /// </summary> 187 /// <param name="item">Lisättävä esine.</param> 188 /// <param name="kuva">Esineen ikoni, joka näkyy valikossa.</param> 189 public void AddItem(PhysicsObject item, Image kuva) 190 { 191 PushButton icon = new PushButton(kuva); 192 Add(icon); 193 icon.Clicked += delegate() { SelectItem(item); }; 194 } 195 196 void SelectItem(PhysicsObject item) 197 { 198 if (ItemSelected != null) 199 { 200 ItemSelected(item); 201 } 202 } 203 } -
2015/26/FransM/Pixels/Pixels/Pixels/Pixels.csproj.Debug.cachefile
r6238 r6270 11 11 Content\seinÀ.xnb 12 12 Content\Alin.xnb 13 Content\Alempi.xnb 14 Content\CaveMusicX.xnb 15 Content\Kivi3.xnb 16 Content\CaveMusicX.wma -
2015/26/FransM/Pixels/Pixels/Pixels/obj/x86/Debug/ContentPipeline-{23DE9823-17E1-4AFC-BB04-6AA018C329F7}.xml
r6238 r6270 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\Taustakuva.xnb</Output> 11 <Time>2015-06-2 3T10:23:30.7718957+03:00</Time>11 <Time>2015-06-24T14:12:49.0725085+03:00</Time> 12 12 </Item> 13 13 <Item> … … 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\Maa.xnb</Output> 20 <Time>2015-06-24T1 1:35:35.9293975+03:00</Time>20 <Time>2015-06-24T14:27:19.3271527+03:00</Time> 21 21 </Item> 22 22 <Item> … … 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\TNT.xnb</Output> 38 <Time>2015-06-2 3T12:37:17.1763957+03:00</Time>38 <Time>2015-06-24T14:07:10.6245085+03:00</Time> 39 39 </Item> 40 40 <Item> … … 108 108 <Options>None</Options> 109 109 <Output>C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\Alin.xnb</Output> 110 <Time>2015-06-24T11:59:56.4430975+03:00</Time> 110 <Time>2015-06-24T14:25:49.5664991+03:00</Time> 111 </Item> 112 <Item> 113 <Source>Alempi.png</Source> 114 <Name>Alempi</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\Alempi.xnb</Output> 119 <Time>2015-06-24T14:18:05.9683085+03:00</Time> 120 </Item> 121 <Item> 122 <Source>CaveMusicX.mp3</Source> 123 <Name>CaveMusicX</Name> 124 <Importer>Mp3Importer</Importer> 125 <Processor>SongProcessor</Processor> 126 <Options>None</Options> 127 <Output>C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\CaveMusicX.xnb</Output> 128 <Extra>C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\CaveMusicX.wma</Extra> 129 <Time>2015-06-24T11:58:24.4691975+03:00</Time> 130 </Item> 131 <Item> 132 <Source>Kivi3.png</Source> 133 <Name>Kivi3</Name> 134 <Importer>TextureImporter</Importer> 135 <Processor>TextureProcessor</Processor> 136 <Options>None</Options> 137 <Output>C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\Kivi3.xnb</Output> 138 <Time>2015-06-24T14:29:42.0358536+03:00</Time> 111 139 </Item> 112 140 <BuildSuccessful>true</BuildSuccessful> -
2015/26/FransM/Pixels/Pixels/Pixels/obj/x86/Debug/Pixels.csproj.FileListAbsolute.txt
r6238 r6270 19 19 C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\seinÀ.xnb 20 20 C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\Alin.xnb 21 C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\Alempi.xnb 22 C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\CaveMusicX.xnb 23 C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\CaveMusicX.wma 24 C:\MyTemp\FransM\Pixels\Pixels\Pixels\bin\x86\Debug\Content\Kivi3.xnb -
2015/26/FransM/Pixels/Pixels/Pixels/obj/x86/Debug/cachefile-{23DE9823-17E1-4AFC-BB04-6AA018C329F7}-targetpath.txt
r6238 r6270 11 11 Content\seinÀ.xnb 12 12 Content\Alin.xnb 13 Content\Alempi.xnb 14 Content\CaveMusicX.xnb 15 Content\CaveMusicX.wma 16 Content\Kivi3.xnb -
2015/26/FransM/Pixels/Pixels/PixelsContent/PixelsContent.contentproj
r6238 r6270 129 129 </Compile> 130 130 </ItemGroup> 131 <ItemGroup> 132 <Compile Include="Alempi.png"> 133 <Name>Alempi</Name> 134 <Importer>TextureImporter</Importer> 135 <Processor>TextureProcessor</Processor> 136 </Compile> 137 </ItemGroup> 138 <ItemGroup> 139 <Compile Include="CaveMusicX.mp3"> 140 <Name>CaveMusicX</Name> 141 <Importer>Mp3Importer</Importer> 142 <Processor>SongProcessor</Processor> 143 </Compile> 144 </ItemGroup> 145 <ItemGroup> 146 <Compile Include="Kivi3.png"> 147 <Name>Kivi3</Name> 148 <Importer>TextureImporter</Importer> 149 <Processor>TextureProcessor</Processor> 150 </Compile> 151 </ItemGroup> 131 152 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 132 153 <!-- 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.