- Timestamp:
- 2015-06-12 11:29:11 (8 years ago)
- Location:
- 2015/24/AleksiS/CandyLand
- Files:
-
- 7 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/24/AleksiS/CandyLand/CandyLand/CandyLand/CandyLand.cs
r6024 r6052 15 15 PlatformCharacter pelaaja1; 16 16 PlatformCharacter vihollinen; 17 17 String kenttaNimi = "kentta1"; 18 19 Image taustakuva = LoadImage("CandyLandBackgroundImage"); 18 20 Image pelaajanKuva = LoadImage("tikku-ukko"); 19 21 Image KarkinKuva = LoadImage("YellowCandy"); … … 27 29 Timer aikaLaskuri; 28 30 31 EasyHighScore topLista = new EasyHighScore(); 32 33 29 34 MultiSelectWindow alkuValikko; 30 35 … … 32 37 { 33 38 ClearAll(); 34 alkuValikko = new MultiSelectWindow("Candy Land", "Pelaa", "Tarina", "Info", "Lopeta"); 39 alkuValikko = new MultiSelectWindow("Candy Land", "Pelaa", "Info", "Lopeta"); 40 alkuValikko.ActiveColor = Color.Yellow; 35 41 Add(alkuValikko); 36 alkuValikko.AddItemHandler(0, Pelaa); 37 alkuValikko.AddItemHandler(1, Tarina); 38 alkuValikko.AddItemHandler(2, Info); 39 alkuValikko.AddItemHandler(3, Exit); 42 alkuValikko.AddItemHandler(0, Tarina); 43 alkuValikko.AddItemHandler(1, Info); 44 alkuValikko.AddItemHandler(2, Exit); 40 45 } 41 46 … … 43 48 { 44 49 ClearAll(); 50 Level.Width = Screen.Width; 51 Level.Height = Screen.Height; 52 Camera.Follow(pelaaja1); 45 53 Gravity = new Vector(0, -1000); 54 55 // Level.Background.Image = taustakuva; 56 GameObject tausta = new GameObject(Level.Width * 0.5, Level.Height); 57 tausta.Image = taustakuva; 58 Add(tausta, -2); 46 59 47 60 LuoPisteLaskuri(); … … 70 83 Add(b); 71 84 72 MultiSelectWindow takaisin = new MultiSelectWindow("", "Takaisin");73 takaisin.AddItemHandler(0, Begin);74 Add( takaisin);85 MultiSelectWindow aloita = new MultiSelectWindow("", "Aloita peli"); 86 aloita.AddItemHandler(0, Pelaa); 87 Add(aloita); 75 88 76 89 } … … 80 93 Label a = new Label("Candy Land, versio 1.0"); 81 94 Label b = new Label("Copyright 2015 Aleksis Games by Aleksi Soikkala"); 82 Label c = new Label("Pelin tiedot ja päivitykset: http://aleksis-games.webnode.fi/ candyland");95 Label c = new Label("Pelin tiedot ja päivitykset: http://aleksis-games.webnode.fi/pelit/candyland"); 83 96 Label d = new Label("Aleksis Gamesin nettisivut: http://aleksis-games.webnode.fi"); 84 97 … … 102 115 void LuoKentta() 103 116 { 104 TileMap kentta = TileMap.FromLevelAsset( "kentta1");117 TileMap kentta = TileMap.FromLevelAsset(kenttaNimi); 105 118 kentta.SetTileMethod('#', LisaaTaso); 106 119 kentta.SetTileMethod('*', LisaaTahti); … … 109 122 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 110 123 Level.CreateBorders(); 111 Level.Background.CreateGradient(Color.White, Color.SkyBlue);124 //Level.Background.CreateGradient(Color.White, Color.SkyBlue); 112 125 } 113 126 … … 117 130 { 118 131 pisteLaskuri = new IntMeter(0, 0, 0); 132 pisteLaskuri.UpperLimit += VoititPelin; 119 133 120 134 pisteNaytto = new Label(); … … 130 144 Add(pisteNaytto); 131 145 146 147 } 148 149 void VoititPelin() 150 { 151 152 MessageDisplay.Add("Voitit pelin!"); 153 topLista.EnterAndShow(pisteLaskuri.Value); 154 kenttaNimi = "kentta2"; 155 topLista.HighScoreWindow.Closed += delegate(Window sender) { Pelaa(); }; 156 132 157 } 133 158 … … 142 167 143 168 Label aikaNaytto = new Label(); 144 aikaNaytto.TextColor = Color.White; 169 aikaNaytto.X = Screen.Right - 150; 170 aikaNaytto.Y = Screen.Top - 100; 171 aikaNaytto.TextColor = Color.Black; 172 aikaNaytto.Color = Color.White; 145 173 aikaNaytto.DecimalPlaces = 1; 146 174 aikaNaytto.BindTo(alaspainLaskuri); … … 190 218 pelaaja1.Mass = 4.0; 191 219 pelaaja1.Image = pelaajanKuva; 220 pelaaja1.Shape = Shape.FromImage(pelaajanKuva); 192 221 pelaaja1.Tag = "pelaaja"; 193 222 AddCollisionHandler(pelaaja1, "tahti", KeraaKarkki); … … 202 231 tekstiLaatikko.Position -= new Vector(0, 100); 203 232 233 kenttaNimi = "kentta1"; 204 234 pelaaja1.Destroy(); 205 Timer.SingleShot(5.0, Begin); 235 236 Timer.SingleShot(5.0, delegate { topLista.EnterAndShow(pisteLaskuri.Value); IsPaused = true; }); 237 topLista.HighScoreWindow.Closed += delegate(Window sender) { IsPaused = false; Begin(); }; 238 //Timer.SingleShot(5.0, Begin); 206 239 207 240 }); … … 216 249 vihollinen.Mass = 4.0; 217 250 vihollinen.Image = vihollisenKuva; 218 vihollinen.Shape = Shape.FromImage(vihollisenKuva);251 219 252 vihollinen.Tag = "vihollinen"; 220 253 vihollinen.IgnoresGravity = true; … … 236 269 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 237 270 238 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä");239 240 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus);241 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus);242 ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus);243 244 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");271 //ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 272 273 //ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 274 //ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 275 //ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 276 277 //PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 245 278 } 246 279 void TauotaPeli() -
2015/24/AleksiS/CandyLand/CandyLand/CandyLand/CandyLand.csproj.Debug.cachefile
r5978 r6052 4 4 Content\YellowCandy.xnb 5 5 Content\CandyThief.xnb 6 Content\CandyLandBackgroundImage.xnb 7 Content\kentta2.xnb -
2015/24/AleksiS/CandyLand/CandyLand/CandyLand/obj/x86/Debug/CandyLand.csproj.FileListAbsolute.txt
r5978 r6052 12 12 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\YellowCandy.xnb 13 13 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\CandyThief.xnb 14 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\CandyLandBackgroundImage.xnb 15 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\kentta2.xnb -
2015/24/AleksiS/CandyLand/CandyLand/CandyLand/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r6024 r6052 27 27 <Options>None</Options> 28 28 <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\tikku-ukko.xnb</Output> 29 <Time>2015-06- 09T14:51:37.4592493+03:00</Time>29 <Time>2015-06-12T10:45:58.8476151+03:00</Time> 30 30 </Item> 31 31 <Item> … … 46 46 <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\CandyThief.xnb</Output> 47 47 <Time>2015-06-11T12:59:18.9848266+03:00</Time> 48 </Item> 49 <Item> 50 <Source>CandyLandBackgroundImage.png</Source> 51 <Name>CandyLandBackgroundImage</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\CandyLandBackgroundImage.xnb</Output> 56 <Time>2015-06-12T09:39:27.5557129+03:00</Time> 57 </Item> 58 <Item> 59 <Source>kentta2.txt</Source> 60 <Name>kentta2</Name> 61 <Importer>TextFileImporter</Importer> 62 <Processor>TextFileContentProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\kentta2.xnb</Output> 65 <Time>2015-06-12T10:28:14.9682378+03:00</Time> 48 66 </Item> 49 67 <BuildSuccessful>true</BuildSuccessful> -
2015/24/AleksiS/CandyLand/CandyLand/CandyLand/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r5978 r6052 4 4 Content\YellowCandy.xnb 5 5 Content\CandyThief.xnb 6 Content\CandyLandBackgroundImage.xnb 7 Content\kentta2.xnb -
2015/24/AleksiS/CandyLand/CandyLand/CandyLandContent/CandyLandContent.contentproj
r6020 r6052 58 58 </ItemGroup> 59 59 <ItemGroup> 60 <Compile Include="tikku-ukko.png">61 <Name>tikku-ukko</Name>62 <Importer>TextureImporter</Importer>63 <Processor>TextureProcessor</Processor>64 </Compile>65 </ItemGroup>66 <ItemGroup>67 60 <Compile Include="YellowCandy.png"> 68 61 <Name>YellowCandy</Name> … … 78 71 </Compile> 79 72 </ItemGroup> 73 <ItemGroup> 74 <Compile Include="CandyLandBackgroundImage.png"> 75 <Name>CandyLandBackgroundImage</Name> 76 <Importer>TextureImporter</Importer> 77 <Processor>TextureProcessor</Processor> 78 </Compile> 79 </ItemGroup> 80 <ItemGroup> 81 <Compile Include="kentta2.txt"> 82 <Name>kentta2</Name> 83 <Importer>TextFileImporter</Importer> 84 <Processor>TextFileContentProcessor</Processor> 85 </Compile> 86 </ItemGroup> 87 <ItemGroup> 88 <Compile Include="tikku-ukko.png"> 89 <Name>tikku-ukko</Name> 90 <Importer>TextureImporter</Importer> 91 <Processor>TextureProcessor</Processor> 92 </Compile> 93 </ItemGroup> 80 94 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 81 95 <!-- 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.