- Timestamp:
- 2015-06-10 11:31:44 (8 years ago)
- Location:
- 2015/24/AleksiS
- Files:
-
- 7 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/24/AleksiS/CandyLand/CandyLand/CandyLand/CandyLand.cs
r5955 r5978 14 14 15 15 PlatformCharacter pelaaja1; 16 PlatformCharacter vihollinen; 16 17 17 18 Image pelaajanKuva = LoadImage("tikku-ukko"); 18 Image tahtiKuva = LoadImage("tahti"); 19 Image KarkinKuva = LoadImage("YellowCandy"); 20 Image vihollisenKuva = LoadImage("CandyThief"); 19 21 20 22 SoundEffect maaliAani = LoadSoundEffect("maali"); 23 Label pisteNaytto; 21 24 22 25 public override void Begin() 23 26 { 27 MultiSelectWindow alkuValikko = new MultiSelectWindow("Candy Land", "Pelaa!", "Lopeta"); 28 Add(alkuValikko); 29 30 ClearAll(); 24 31 Gravity = new Vector(0, -1000); 32 33 LuoPisteLaskuri(); 25 34 26 35 LuoKentta(); … … 38 47 kentta.SetTileMethod('*', LisaaTahti); 39 48 kentta.SetTileMethod('N', LisaaPelaaja); 49 kentta.SetTileMethod('V', LisaaVihollinen); 40 50 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 41 51 Level.CreateBorders(); 42 52 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 43 53 } 54 55 IntMeter pisteLaskuri; 44 56 57 void LuoPisteLaskuri() 58 { 59 pisteLaskuri = new IntMeter(0,0,0); 60 61 pisteNaytto = new Label(); 62 pisteNaytto.X = Screen.Left + 150; 63 pisteNaytto.Y = Screen.Top - 100; 64 pisteNaytto.TextColor = Color.Black; 65 pisteNaytto.Color = Color.White; 66 pisteNaytto.Title = "Karkit"; 67 68 69 70 pisteNaytto.BindTo(pisteLaskuri); 71 Add(pisteNaytto); 72 73 } 45 74 void LisaaTaso(Vector paikka, double leveys, double korkeus) 46 75 { … … 56 85 tahti.IgnoresCollisionResponse = true; 57 86 tahti.Position = paikka; 58 tahti.Image = tahtiKuva;87 tahti.Image = KarkinKuva; 59 88 tahti.Tag = "tahti"; 60 89 Add(tahti); 90 pisteLaskuri.MaxValue++; 91 pisteNaytto.IntFormatString = " {0:D1}/" + pisteLaskuri.MaxValue; 61 92 } 62 93 … … 67 98 pelaaja1.Mass = 4.0; 68 99 pelaaja1.Image = pelaajanKuva; 69 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 100 pelaaja1.Tag = "pelaaja"; 101 AddCollisionHandler(pelaaja1, "tahti", KeraaKarkki); 102 AddCollisionHandler(pelaaja1, "vihollinen", delegate(PhysicsObject A, PhysicsObject B) 103 { 104 Begin(); 105 }); 70 106 Add(pelaaja1); 107 108 } 109 110 void LisaaVihollinen(Vector paikka, double leveys, double korkeus) 111 { 112 vihollinen = new PlatformCharacter(leveys, korkeus); 113 vihollinen.Position = paikka; 114 vihollinen.Mass = 4.0; 115 vihollinen.Image = vihollisenKuva; 116 vihollinen.Shape = Shape.FromImage(vihollisenKuva); 117 vihollinen.Tag = "vihollinen"; 118 vihollinen.IgnoresGravity = true; 119 Add(vihollinen); 120 121 FollowerBrain aivot = new FollowerBrain("pelaaja"); 122 vihollinen.Brain = aivot; 123 71 124 } 72 125 … … 74 127 { 75 128 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 129 Keyboard.Listen(Key.P, ButtonState.Pressed, TauotaPeli, "Tauko"); 76 130 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 77 131 … … 88 142 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 89 143 } 144 void TauotaPeli() 145 { 146 MessageDisplay.Add("Peli tauolla"); 147 Pause(); 148 } 90 149 91 150 void Liikuta(PlatformCharacter hahmo, double nopeus) … … 99 158 } 100 159 101 void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti)160 void KeraaKarkki(PhysicsObject hahmo, PhysicsObject tahti) 102 161 { 103 162 maaliAani.Play(); 104 MessageDisplay.Add("Keräsit tähden!");163 MessageDisplay.Add("Keräsit karkin!"); 105 164 tahti.Destroy(); 165 pisteLaskuri.Value += 1; 166 106 167 } 107 168 } -
2015/24/AleksiS/CandyLand/CandyLand/CandyLand/CandyLand.csproj.Debug.cachefile
r5955 r5978 1 1 Content\maali.xnb 2 Content\tahti.xnb3 2 Content\kentta1.xnb 4 3 Content\tikku-ukko.xnb 4 Content\YellowCandy.xnb 5 Content\CandyThief.xnb -
2015/24/AleksiS/CandyLand/CandyLand/CandyLand/obj/x86/Debug/CandyLand.csproj.FileListAbsolute.txt
r5955 r5978 1 1 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\maali.xnb 2 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\tahti.xnb3 2 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\kentta1.xnb 4 3 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\CandyLand.exe … … 11 10 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\obj\x86\Debug\CandyLand.csprojResolveAssemblyReference.cache 12 11 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\tikku-ukko.xnb 12 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\YellowCandy.xnb 13 C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\CandyThief.xnb -
2015/24/AleksiS/CandyLand/CandyLand/CandyLand/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r5955 r5978 12 12 </Item> 13 13 <Item> 14 <Source>tahti.png</Source>15 <Name>tahti</Name>16 <Importer>TextureImporter</Importer>17 <Processor>TextureProcessor</Processor>18 <Options>None</Options>19 <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\tahti.xnb</Output>20 <Time>2015-06-09T13:56:14.7626493+03:00</Time>21 </Item>22 <Item>23 14 <Source>kentta1.txt</Source> 24 15 <Name>kentta1</Name> … … 27 18 <Options>None</Options> 28 19 <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\kentta1.xnb</Output> 29 <Time>2015-06- 09T14:01:34.2330493+03:00</Time>20 <Time>2015-06-10T10:48:06.2998651+03:00</Time> 30 21 </Item> 31 22 <Item> … … 37 28 <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\tikku-ukko.xnb</Output> 38 29 <Time>2015-06-09T14:51:37.4592493+03:00</Time> 30 </Item> 31 <Item> 32 <Source>YellowCandy.png</Source> 33 <Name>YellowCandy</Name> 34 <Importer>TextureImporter</Importer> 35 <Processor>TextureProcessor</Processor> 36 <Options>None</Options> 37 <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\YellowCandy.xnb</Output> 38 <Time>2015-06-10T09:49:12.7256651+03:00</Time> 39 </Item> 40 <Item> 41 <Source>CandyThief.png</Source> 42 <Name>CandyThief</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\CandyThief.xnb</Output> 47 <Time>2015-06-10T10:59:51.4680651+03:00</Time> 39 48 </Item> 40 49 <BuildSuccessful>true</BuildSuccessful> -
2015/24/AleksiS/CandyLand/CandyLand/CandyLand/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r5955 r5978 1 1 Content\maali.xnb 2 Content\tahti.xnb3 2 Content\kentta1.xnb 4 3 Content\tikku-ukko.xnb 4 Content\YellowCandy.xnb 5 Content\CandyThief.xnb -
2015/24/AleksiS/CandyLand/CandyLand/CandyLandContent/CandyLandContent.contentproj
r5956 r5978 46 46 </ItemGroup> 47 47 <ItemGroup> 48 <Compile Include="CandyThief.png"> 49 <Name>CandyThief</Name> 50 <Importer>TextureImporter</Importer> 51 <Processor>TextureProcessor</Processor> 52 </Compile> 48 53 <Compile Include="maali.wav"> 49 54 <Name>maali</Name> … … 64 69 </Compile> 65 70 </ItemGroup> 71 <ItemGroup> 72 <Compile Include="YellowCandy.png"> 73 <Name>YellowCandy</Name> 74 <Importer>TextureImporter</Importer> 75 <Processor>TextureProcessor</Processor> 76 </Compile> 77 </ItemGroup> 66 78 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 67 79 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/24/AleksiS/CandyLand/CandyLand/CandyLandContent/kentta1.txt
r5955 r5978 11 11 ...##..##..##..##..... 12 12 ...................... 13 .*....*... ....*...*...14 .##..##..## ..##..##...13 .*....*...V.*...*..... 14 .##..##..#####..##.... 15 15 ...................... 16 16 ........N.............
Note: See TracChangeset
for help on using the changeset viewer.