- Timestamp:
- 2015-07-01 11:47:42 (8 years ago)
- Location:
- 2015/27/JimiS
- Files:
-
- 12 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/JimiS/tasohyppely/hyppely/hyppely/hyppely/hyppely.cs
r6629 r6651 7 7 using Jypeli.Widgets; 8 8 9 //TODO Vaihda tähdet kolikoiksi 10 //TODO Lisää Kolikkolaskuri 11 //TODO Lisää kolikkolaskuriin maali, kun riittävästi kolikoita on kerätty 9 12 10 //TODO Lisää erilaisia vihollisia 13 11 //TODO Pidennä kenttää ja lisää tasoja/palikoita ja kuoppia + muita esteitä. 14 12 //TODO Paranna kentän, pelaajan ja vihollisten kuvia. 15 //TODO kaikki muut mieleen tulevat parannukset.13 //TODO Lisää/muokkaa äänet 16 14 17 15 public class hyppely : PhysicsGame 18 16 { 19 17 const double nopeus = 200; 20 const double hyppyNopeus = 750;18 const double hyppyNopeus = 1000; 21 19 const int RUUDUN_KOKO = 40; 22 20 … … 31 29 Image tahtiKuva = LoadImage("tahti"); 32 30 Image vihukuva = LoadImage("vihu"); 31 Image Kolikko = LoadImage("kolikko"); 32 Image MaaPalikka = LoadImage("maapalikka"); 33 Image pahiskuva = LoadImage("putoamatonvihu"); 34 Image tasokuva = LoadImage("tasokuva"); 33 35 34 36 IntMeter pelaajan1Elamat; 37 IntMeter pelaajan1Tahdet; 35 38 36 39 Vector pelaajanaloituspaikka; … … 59 62 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 60 63 kentta.SetTileMethod('#', LisaaTaso); 61 kentta.SetTileMethod('*', Lisaa Tahti);64 kentta.SetTileMethod('*', LisaaKolikko); 62 65 kentta.SetTileMethod('N', LisaaPelaaja); 63 66 kentta.SetTileMethod('A', LisaaPalikka); 64 67 kentta.SetTileMethod('V', LisaaVihu); 68 kentta.SetTileMethod('M', LisaaMaa); 69 kentta.SetTileMethod('P', LisaaPahis); 65 70 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 66 71 … … 82 87 } 83 88 89 void LisaaPahis(Vector paikka, double leveys, double korkeus) 90 { 91 PlatformCharacter pahis = new PlatformCharacter(leveys, korkeus); 92 pahis.Position = paikka; 93 pahis.Tag = "pahis"; 94 pahis.Image = pahiskuva; 95 Add(pahis); 96 97 PlatformWandererBrain pahisaivot = new PlatformWandererBrain(); 98 pahisaivot.Speed = 40; 99 pahisaivot.FallsOffPlatforms = false; 100 101 pahis.Brain = pahisaivot; 102 } 103 84 104 void LisaaVihu(Vector paikka, double leveys, double korkeus) 85 105 { … … 101 121 } 102 122 123 void LisaaMaa(Vector paikka, double leveys, double korkeus) 124 { 125 PhysicsObject maa = PhysicsObject.CreateStaticObject(leveys, korkeus); 126 maa.Position = paikka; 127 maa.Image = MaaPalikka; 128 Add(maa); 129 } 130 103 131 void LisaaPalikka(Vector paikka, double leveys, double korkeus) 104 132 { … … 114 142 taso.Position = paikka; 115 143 taso.Color = Color.Blue; 144 taso.Image = tasokuva; 116 145 Add(taso); 117 146 } 118 147 119 void Lisaa Tahti(Vector paikka, double leveys, double korkeus)120 { 121 PhysicsObject tahti= PhysicsObject.CreateStaticObject(leveys, korkeus);122 tahti.IgnoresCollisionResponse = true;123 tahti.Position = paikka;124 tahti.Image = tahtiKuva;125 tahti.Tag = "tahti";126 Add( tahti);148 void LisaaKolikko(Vector paikka, double leveys, double korkeus) 149 { 150 PhysicsObject kolikko = PhysicsObject.CreateStaticObject(leveys, korkeus); 151 kolikko.IgnoresCollisionResponse = true; 152 kolikko.Position = paikka; 153 kolikko.Image = Kolikko; 154 kolikko.Tag = "tahti"; 155 Add(kolikko); 127 156 } 128 157 … … 137 166 AddCollisionHandler(pelaaja1, "pahis", TormaaVihuun); 138 167 Add(pelaaja1); 168 169 pelaajan1Tahdet = new IntMeter(0); 170 pelaajan1Tahdet.MaxValue = 50; 171 Label tahdet = new Label(); 172 tahdet.BindTo(pelaajan1Tahdet); 173 174 tahdet.Y = 0; 175 tahdet.X = 0; 176 tahdet.TextColor = Color.Black; 177 tahdet.BorderColor = Color.Black; 178 tahdet.Color = Color.White; 179 Add(tahdet); 139 180 140 181 pelaajan1Elamat = new IntMeter(3); … … 191 232 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 192 233 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 234 Keyboard.Listen(Key.R, ButtonState.Pressed, AloitaAlusta, "Aloittaa pelin alusta."); 193 235 194 236 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); … … 197 239 198 240 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 241 ControllerOne.Listen(Button.Start, ButtonState.Pressed, AloitaAlusta, "Aloittaa pelin alusta."); 199 242 200 243 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); … … 205 248 } 206 249 250 251 void AloitaAlusta() 252 { 253 ClearAll(); 254 Begin(); 255 } 256 207 257 void Liikuta(PlatformCharacter hahmo, double nopeus) 208 258 { … … 217 267 void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti) 218 268 { 269 pelaajan1Tahdet.Value += 1; 219 270 maaliAani.Play(); 220 MessageDisplay.Add("Keräsit tähden!");271 MessageDisplay.Add("Keräsit kolikon!"); 221 272 tahti.Destroy(); 273 274 if (pelaajan1Tahdet == 50) 275 { 276 MessageDisplay.Add("Voitit pelin!"); 277 Timer.SingleShot(3.0, Exit); 278 } 222 279 } 223 280 } -
2015/27/JimiS/tasohyppely/hyppely/hyppely/hyppely/hyppely.csproj.Debug.cachefile
r6596 r6651 3 3 Content\tahti.xnb 4 4 Content\pelaaja.xnb 5 Content\kentta1.xnb6 5 Content\pelaajahahmo.xnb 7 6 Content\vihu.xnb 7 Content\kolikko.xnb 8 Content\kentta1.xnb 9 Content\maapalikka.xnb 10 Content\putoamatonvihu.xnb 11 Content\tasokuva.xnb -
2015/27/JimiS/tasohyppely/hyppely/hyppely/hyppely/obj/x86/Debug/ContentPipeline-{9937689A-33E5-40B9-A7B6-3F1206C3B37D}.xml
r6611 r6651 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\maali.xnb</Output> 11 <Time>2015-0 6-30T12:39:08.2248053+03:00</Time>11 <Time>2015-07-01T09:51:43.9403447+03:00</Time> 12 12 </Item> 13 13 <Item> … … 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\norsu.xnb</Output> 20 <Time>2015-0 6-30T12:39:08.3028058+03:00</Time>20 <Time>2015-07-01T09:51:44.0183442+03:00</Time> 21 21 </Item> 22 22 <Item> … … 27 27 <Options>None</Options> 28 28 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\tahti.xnb</Output> 29 <Time>2015-0 6-30T12:39:08.3496061+03:00</Time>29 <Time>2015-07-01T09:51:44.0807438+03:00</Time> 30 30 </Item> 31 31 <Item> … … 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\pelaaja.xnb</Output> 38 <Time>2015-06-30T12:39:08.2248053+03:00</Time> 38 <Time>2015-07-01T09:51:43.9403447+03:00</Time> 39 </Item> 40 <Item> 41 <Source>pelaajahahmo.png</Source> 42 <Name>pelaajahahmo</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\pelaajahahmo.xnb</Output> 47 <Time>2015-07-01T09:51:44.0963437+03:00</Time> 48 </Item> 49 <Item> 50 <Source>vihu.png</Source> 51 <Name>vihu</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\vihu.xnb</Output> 56 <Time>2015-07-01T09:51:44.0963437+03:00</Time> 57 </Item> 58 <Item> 59 <Source>kolikko.png</Source> 60 <Name>kolikko</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\kolikko.xnb</Output> 65 <Time>2015-07-01T09:54:49.5588237+03:00</Time> 39 66 </Item> 40 67 <Item> … … 45 72 <Options>None</Options> 46 73 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\kentta1.xnb</Output> 47 <Time>2015-0 6-30T14:57:09.8169882+03:00</Time>74 <Time>2015-07-01T11:31:21.7790803+03:00</Time> 48 75 </Item> 49 76 <Item> 50 <Source> pelaajahahmo.png</Source>51 <Name> pelaajahahmo</Name>77 <Source>maapalikka.png</Source> 78 <Name>maapalikka</Name> 52 79 <Importer>TextureImporter</Importer> 53 80 <Processor>TextureProcessor</Processor> 54 81 <Options>None</Options> 55 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\ pelaajahahmo.xnb</Output>56 <Time>2015-0 6-30T14:23:01.3775446+03:00</Time>82 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\maapalikka.xnb</Output> 83 <Time>2015-07-01T10:36:59.7174521+03:00</Time> 57 84 </Item> 58 85 <Item> 59 <Source> vihu.png</Source>60 <Name> vihu</Name>86 <Source>putoamatonvihu.png</Source> 87 <Name>putoamatonvihu</Name> 61 88 <Importer>TextureImporter</Importer> 62 89 <Processor>TextureProcessor</Processor> 63 90 <Options>None</Options> 64 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\vihu.xnb</Output> 65 <Time>2015-06-30T14:23:07.3291397+03:00</Time> 91 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\putoamatonvihu.xnb</Output> 92 <Time>2015-07-01T10:42:37.015131+03:00</Time> 93 </Item> 94 <Item> 95 <Source>tasokuva.png</Source> 96 <Name>tasokuva</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\tasokuva.xnb</Output> 101 <Time>2015-07-01T11:27:24.0315682+03:00</Time> 66 102 </Item> 67 103 <BuildSuccessful>true</BuildSuccessful> … … 80 116 <Assembly> 81 117 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 82 <Value>2014-1 2-13T00:38:40+02:00</Value>118 <Value>2014-11-26T00:23:34+02:00</Value> 83 119 </Assembly> 84 120 <Assembly> 85 121 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</Key> 86 <Value>2011-09-01T1 7:22:30+03:00</Value>122 <Value>2011-09-01T16:22:30+03:00</Value> 87 123 </Assembly> 88 124 <Assembly> 89 125 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</Key> 90 <Value>2011-09-01T1 7:22:30+03:00</Value>126 <Value>2011-09-01T16:22:30+03:00</Value> 91 127 </Assembly> 92 128 <Assembly> 93 129 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</Key> 94 <Value>2011-09-01T1 7:22:30+03:00</Value>130 <Value>2011-09-01T16:22:30+03:00</Value> 95 131 </Assembly> 96 132 <Assembly> 97 133 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</Key> 98 <Value>2011-09-01T1 7:22:30+03:00</Value>134 <Value>2011-09-01T16:22:30+03:00</Value> 99 135 </Assembly> 100 136 <Assembly> 101 137 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</Key> 102 <Value>2011-09-01T1 7:22:30+03:00</Value>138 <Value>2011-09-01T16:22:30+03:00</Value> 103 139 </Assembly> 104 140 <Assembly> 105 141 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</Key> 106 <Value>2011-09-01T1 7:22:30+03:00</Value>142 <Value>2011-09-01T16:22:30+03:00</Value> 107 143 </Assembly> 108 144 <Assembly> 109 145 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 110 <Value>2014-1 2-13T00:38:40+02:00</Value>146 <Value>2014-11-26T00:23:36+02:00</Value> 111 147 </Assembly> 112 148 <Assembly> 113 149 <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> 114 <Value>201 2-03-16T14:36:56.0488429+02:00</Value>150 <Value>2014-04-23T00:53:38.0521963+03:00</Value> 115 151 </Assembly> 116 152 </Assemblies> -
2015/27/JimiS/tasohyppely/hyppely/hyppely/hyppely/obj/x86/Debug/cachefile-{9937689A-33E5-40B9-A7B6-3F1206C3B37D}-targetpath.txt
r6596 r6651 3 3 Content\tahti.xnb 4 4 Content\pelaaja.xnb 5 Content\kentta1.xnb6 5 Content\pelaajahahmo.xnb 7 6 Content\vihu.xnb 7 Content\kolikko.xnb 8 Content\kentta1.xnb 9 Content\maapalikka.xnb 10 Content\putoamatonvihu.xnb 11 Content\tasokuva.xnb -
2015/27/JimiS/tasohyppely/hyppely/hyppely/hyppely/obj/x86/Debug/hyppely.csproj.FileListAbsolute.txt
r6596 r6651 14 14 C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\pelaajahahmo.xnb 15 15 C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\vihu.xnb 16 C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\kolikko.xnb 17 C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\maapalikka.xnb 18 C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\putoamatonvihu.xnb 19 C:\MyTemp\JimiS\tasohyppely\hyppely\hyppely\hyppely\bin\x86\Debug\Content\tasokuva.xnb -
2015/27/JimiS/tasohyppely/hyppely/hyppely/hyppelyContent/hyppelyContent.contentproj
r6596 r6651 88 88 </Compile> 89 89 </ItemGroup> 90 <ItemGroup> 91 <Compile Include="kolikko.png"> 92 <Name>kolikko</Name> 93 <Importer>TextureImporter</Importer> 94 <Processor>TextureProcessor</Processor> 95 </Compile> 96 </ItemGroup> 97 <ItemGroup> 98 <Compile Include="maapalikka.png"> 99 <Name>maapalikka</Name> 100 <Importer>TextureImporter</Importer> 101 <Processor>TextureProcessor</Processor> 102 </Compile> 103 </ItemGroup> 104 <ItemGroup> 105 <Compile Include="putoamatonvihu.png"> 106 <Name>putoamatonvihu</Name> 107 <Importer>TextureImporter</Importer> 108 <Processor>TextureProcessor</Processor> 109 </Compile> 110 </ItemGroup> 111 <ItemGroup> 112 <Compile Include="tasokuva.png"> 113 <Name>tasokuva</Name> 114 <Importer>TextureImporter</Importer> 115 <Processor>TextureProcessor</Processor> 116 </Compile> 117 </ItemGroup> 90 118 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 91 119 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/27/JimiS/tasohyppely/hyppely/hyppely/hyppelyContent/kentta1.txt
r6611 r6651 1 ................................................................................................................................................................................................ 2 ................................................................................................................................................................................................ 3 ................................................................................................................................................................................................ 4 ................................................................................................................................................................................................ 5 ..........*................................*.....................................*.............................................................................................................. 6 .......#######...........*.................AAAAA......*........*.......*.......AAAAA............................................................................................................ 7 .........*......AAAAAAAAAAAAAAAA....####.......*....#####....###....#########..................................................................................................... 8 ........#####..............................########..........*...................................................................................................................................... 9 ..............#.......V*.............AAA..................AAAAAAA#............*................................................................................................................. 10 ...............#...######...........V...............................##############............................................................................................................................ 11 ...............................AAAAAAAAAAAAA....AAAAAAAA.................................................................................................................................... 12 ...N....V....................................................................................................................................................................................... 13 ##################...########################################################################################################################################################################### 1 ........................................................................................................*............................................................................................ 2 ........................................................................................................AA...P....................................................................................... 3 ............................................................................................................####.....P*.............................................................................. 4 .................................P..*.............................................................................AAAAA.............................................................................. 5 ................................AAAAA.......................................................................................................................................................... ..... 6 .............................##..............................................................................*....................................................................................... 7 ........................###.............................................................................P..#####...............................................*..................................... 8 .......................................................................................................AAAA......................................*..........P..AA.................................... 9 ..................................................................................................###..*.........................................##.......AAAA....................................... 10 ..........*..................##............*.....................................*....................####..P........................................###............................................. 11 .......#######.......P...*............P....AAAAA......*P.......*.......*..P....AAAAA.......................AAA....*.................................................................................. 12 .........*......AAAAAAAAAAAAAAAA....####.......*.P..#####....###....#########...................................AAAA.....................................A.*P........................................ 13 ........#####..............................########..........*.........................................P..................................................####....................................... 14 ..............#.......V*.............AAA..................AAAAAAA#........P...*..........P............AAAA.................................*...................AAAA.................................. 15 ...............#...######...........V...............................##############.......###...............AAAAA...*......................####......................P................................ 16 ...............................AAAAAAAAAAAAA....AAAAAAAA......................................###.................###.........P................####................#####............................. 17 ...N....V.....................................................................................................###...........AAAAA*..........AA.....V......V......PP.........*.......P................ 18 .......................................................................V............................................................................................................................. 19 MMMMMMMMMMMMMMMMMM...MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM........MMMMMMMMMMMMMMMMMMMMMMMMMM.......MMMMMMMMMM....MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
Note: See TracChangeset
for help on using the changeset viewer.