- Timestamp:
- 2014-06-11 14:55:29 (9 years ago)
- Location:
- 2014/24/JuhoJ
- Files:
-
- 22 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoe/ShotgunJoe.cs
r4939 r4954 10 10 { 11 11 const double nopeus = 200; 12 const double hyppyNopeus = 750;12 const double hyppyNopeus = 550; 13 13 const int RUUDUN_KOKO = 40; 14 14 15 15 PlatformCharacter pelaaja1; 16 17 DoubleMeter elamalaskuri; 18 16 19 17 20 Image pelaajanKuva = LoadImage("shutter"); 18 21 Image tahtiKuva = LoadImage("tahti"); 19 22 Image piikkikuva = LoadImage("Piikki"); 20 23 SoundEffect maaliAani = LoadSoundEffect("maali"); 21 24 Image ruohokuva = LoadImage("Ruoho"); 25 Image multakuva = LoadImage("multa"); 26 Image asekuva = LoadImage("haulikko"); 27 Image panoskuva = LoadImage("ammus"); 28 Image vihukuva = LoadImage("Vihu"); 29 Image näkymätönkuva = LoadImage("näkymätön"); 22 30 public override void Begin() 23 31 { … … 26 34 LuoKentta(); 27 35 LisaaNappaimet(); 28 36 29 37 Camera.Follow(pelaaja1); 30 38 Camera.ZoomFactor = 4.2; 31 39 Camera.StayInLevel = true; 40 41 pelaaja1.Weapon = new PlasmaCannon(30, 10); 42 pelaaja1.Weapon.Image = asekuva; 43 pelaaja1.Weapon.Ammo.Value = 100000000; 44 pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 45 pelaaja1.Weapon.FireRate = 1000.0; 46 32 47 } 33 48 … … 37 52 kentta.SetTileMethod('#', LisaaTaso); 38 53 kentta.SetTileMethod('*', LisaaTahti); 39 kentta.SetTileMethod('N', LisaaPelaaja); 54 kentta.SetTileMethod('J', LisaaPelaaja); 55 kentta.SetTileMethod('P', LisaaPiikki); 56 kentta.SetTileMethod('R', LisaaRuoho); 57 kentta.SetTileMethod('V', LisaaVihu); 58 kentta.SetTileMethod('N', LisaaNäkymätön); 40 59 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 41 60 Level.CreateBorders(); … … 47 66 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 48 67 taso.Position = paikka; 49 taso. Color = Color.Green;68 taso.Image = multakuva; 50 69 Add(taso); 51 70 } … … 63 82 void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 64 83 { 65 pelaaja1 = new PlatformCharacter(leveys *2, korkeus *3);84 pelaaja1 = new PlatformCharacter(leveys , korkeus ); 66 85 pelaaja1.Position = paikka; 67 86 pelaaja1.Mass = 4.0; 68 87 pelaaja1.Image = pelaajanKuva; 69 88 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 89 // AddCollisionHandler(pelaaja1, "piikki", TormaaPiikkin); 70 90 Add(pelaaja1); 71 91 } … … 85 105 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 86 106 ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 107 Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 87 108 88 109 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); … … 105 126 tahti.Destroy(); 106 127 } 128 129 void LisaaPiikki(Vector paikka, Double leveys, Double korkeus) 130 { 131 PhysicsObject piikki = PhysicsObject.CreateStaticObject(leveys, korkeus); 132 piikki.Tag = "piikki"; 133 piikki.Position = paikka; 134 piikki.Image = piikkikuva; 135 Add(piikki); 136 137 } 138 139 void LisaaRuoho(Vector paikka, Double leveys, Double korkeus) 140 { 141 PhysicsObject ruoho = PhysicsObject.CreateStaticObject(leveys, korkeus); 142 ruoho.Tag = "ruoho"; 143 ruoho.Position = paikka; 144 ruoho.Image = ruohokuva; 145 Add(ruoho); 146 147 } 148 149 void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 150 { 151 //ammus.Destroy(); 152 } 153 154 void AmmuAseella(PlatformCharacter pelaaja) 155 { 156 PhysicsObject ammus = pelaaja.Weapon.Shoot(); 157 158 if (ammus != null) 159 { 160 //ammus.Size *= 3; 161 ammus.Image = panoskuva; 162 //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 163 164 } 165 } 166 167 void LisaaVihu(Vector paikka, Double leveys, Double korkeus) 168 { 169 PlatformCharacter vihu = new PlatformCharacter(leveys, korkeus); 170 vihu.Position = paikka; 171 vihu.Image = vihukuva; 172 Add(vihu); 173 FollowerBrain seuraajanAivot = new FollowerBrain(pelaaja1); 174 vihu.Brain = seuraajanAivot; 175 176 } 177 178 void LisaaNäkymätön(Vector paikka, Double leveys, Double korkeus) 179 { 180 PhysicsObject näkymätön = PhysicsObject.CreateStaticObject(leveys, korkeus); 181 näkymätön.Tag = "näkymätön"; 182 näkymätön.Position = paikka; 183 näkymätön.Image = näkymätönkuva; 184 Add(näkymätön); 185 } 186 187 void LuoElamaLaskuri() 188 { 189 elamalaskuri = new DoubleMeter(10); 190 elamalaskuri.MaxValue = 10; 191 elamalaskuri.LowerLimit += ElamaLoppui; 192 193 ProgressBar elamaPalkki = new ProgressBar(150, 20); 194 elamaPalkki.X = Screen.Left + 150; 195 elamaPalkki.Y = Screen.Top - 20; 196 elamaPalkki.BindTo(elamalaskuri); 197 elamaPalkki.Color = Color.Transparent; 198 elamaPalkki.BarColor = Color.Red; 199 elamaPalkki.BorderColor = Color.Black; 200 Add(elamaPalkki); 201 } 202 203 void ElamaLoppui() 204 { 205 MessageDisplay.Add("Huudat elämäsi puolesta kun sisälmyksesi valuvat maahan!"); 206 } 207 208 209 210 107 211 } -
2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoe/ShotgunJoe.csproj.Debug.cachefile
r4939 r4954 4 4 Content\kentta1.xnb 5 5 Content\shutter.xnb 6 Content\Piikki.xnb 7 Content\Ruoho.xnb 8 Content\multa.xnb 9 Content\haulikko.xnb 10 Content\ammus.xnb 11 Content\Vihu.xnb 12 Content\nÀkymÀtön.xnb -
2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoe/obj/x86/Debug/ContentPipeline-{CF60888C-4746-4871-9D32-E8426663FBA0}.xml
r4939 r4954 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2014-06-1 0T14:06:15.8598568+03:00</Time>38 <Time>2014-06-11T14:19:05.9536218+03:00</Time> 39 39 </Item> 40 40 <Item> … … 46 46 <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\shutter.xnb</Output> 47 47 <Time>2014-06-10T14:59:25.8868088+03:00</Time> 48 </Item> 49 <Item> 50 <Source>Piikki.png</Source> 51 <Name>Piikki</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\Piikki.xnb</Output> 56 <Time>2014-06-11T12:56:21.4869076+03:00</Time> 57 </Item> 58 <Item> 59 <Source>Ruoho.png</Source> 60 <Name>Ruoho</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\Ruoho.xnb</Output> 65 <Time>2014-06-11T12:00:07.781064+03:00</Time> 66 </Item> 67 <Item> 68 <Source>multa.png</Source> 69 <Name>multa</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\multa.xnb</Output> 74 <Time>2014-06-11T12:00:53.0475902+03:00</Time> 75 </Item> 76 <Item> 77 <Source>haulikko.png</Source> 78 <Name>haulikko</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\haulikko.xnb</Output> 83 <Time>2014-06-11T12:21:36.8419572+03:00</Time> 84 </Item> 85 <Item> 86 <Source>ammus.png</Source> 87 <Name>ammus</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\ammus.xnb</Output> 92 <Time>2014-06-11T12:52:55.7049076+03:00</Time> 93 </Item> 94 <Item> 95 <Source>Vihu.png</Source> 96 <Name>Vihu</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\Vihu.xnb</Output> 101 <Time>2014-06-11T14:31:15.8116003+03:00</Time> 102 </Item> 103 <Item> 104 <Source>näkymätön.png</Source> 105 <Name>näkymätön</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\näkymätön.xnb</Output> 110 <Time>2014-06-11T14:09:41.6181939+03:00</Time> 48 111 </Item> 49 112 <BuildSuccessful>true</BuildSuccessful> -
2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoe/obj/x86/Debug/ShotgunJoe.csproj.FileListAbsolute.txt
r4939 r4954 12 12 C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\obj\x86\Debug\ShotgunJoe.pdb 13 13 C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\shutter.xnb 14 C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\Piikki.xnb 15 C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\Ruoho.xnb 16 C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\multa.xnb 17 C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\haulikko.xnb 18 C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\ammus.xnb 19 C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\Vihu.xnb 20 C:\MyTemp\JuhoJ\ShotgunJoe\ShotgunJoe\ShotgunJoe\bin\x86\Debug\Content\nÀkymÀtön.xnb -
2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoe/obj/x86/Debug/cachefile-{CF60888C-4746-4871-9D32-E8426663FBA0}-targetpath.txt
r4939 r4954 4 4 Content\kentta1.xnb 5 5 Content\shutter.xnb 6 Content\Piikki.xnb 7 Content\Ruoho.xnb 8 Content\multa.xnb 9 Content\haulikko.xnb 10 Content\ammus.xnb 11 Content\Vihu.xnb 12 Content\nÀkymÀtön.xnb -
2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoeContent/ShotgunJoeContent.contentproj
r4939 r4954 74 74 </Compile> 75 75 </ItemGroup> 76 <ItemGroup> 77 <Compile Include="Piikki.png"> 78 <Name>Piikki</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 </Compile> 82 </ItemGroup> 83 <ItemGroup> 84 <Compile Include="Ruoho.png"> 85 <Name>Ruoho</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 </ItemGroup> 90 <ItemGroup> 91 <Compile Include="multa.png"> 92 <Name>multa</Name> 93 <Importer>TextureImporter</Importer> 94 <Processor>TextureProcessor</Processor> 95 </Compile> 96 </ItemGroup> 97 <ItemGroup> 98 <Compile Include="haulikko.png"> 99 <Name>haulikko</Name> 100 <Importer>TextureImporter</Importer> 101 <Processor>TextureProcessor</Processor> 102 </Compile> 103 </ItemGroup> 104 <ItemGroup> 105 <Compile Include="ammus.png"> 106 <Name>ammus</Name> 107 <Importer>TextureImporter</Importer> 108 <Processor>TextureProcessor</Processor> 109 </Compile> 110 </ItemGroup> 111 <ItemGroup> 112 <Compile Include="Vihu.png"> 113 <Name>Vihu</Name> 114 <Importer>TextureImporter</Importer> 115 <Processor>TextureProcessor</Processor> 116 </Compile> 117 </ItemGroup> 118 <ItemGroup> 119 <Compile Include="näkymätön.png"> 120 <Name>näkymätön</Name> 121 <Importer>TextureImporter</Importer> 122 <Processor>TextureProcessor</Processor> 123 </Compile> 124 </ItemGroup> 76 125 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 77 126 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2014/24/JuhoJ/ShotgunJoe/ShotgunJoe/ShotgunJoeContent/kentta1.txt
r4939 r4954 1 *2 ##3 1 4 * * 5 ## ## 6 7 * * 8 ## ## ## 9 10 * * * * 11 ## ## ## ## 12 13 * * * * 14 ## ## ## ## ## 15 16 N 17 ###################### 2 ................................................................................................................................................. 3 ..................................NNNNNNNNNNNNNNNNNNNNNNN........................................................................................ 4 .......................RRR....NNN................................................................................................................ 5 ...................R........................................................................RRRRRRRRRRRRRRR..........RRRRR....................... 6 ...........RRRR.......................................................................RRRRR..................RRRRRR...........R.................. 7 .J......V............................................... RRRRRRRRRRRRRRRRRRRRRRRRRRR............................................................. 8 RRRRRRRRRRRRRRRRRRRRRRRR................................ ###########################...............................................N............. 9 ########################................................ ###########################.....................................................RRR..... 10 ########################............RRRRRRRR............ ###########################............................................................. 11 ########################PPPPPPRRRR............RRRR...... ###########################............................................................. 12 ##################################################...... ###########################............................................................. 13 ##################################################...... ###########################............................................................. 14 ##################################################...... ##############......#######.....................................................R..RRRRR 15 ##################################################...... ##############.............................RRRRRRR...RRRRR...............RRRRR...PP##### 16 ##################################################...... ############################...........RRRRR######PP..........#......#..#####....####### 17 ##################################################.......................................N...RRR#############PPPPPPPPPPPPPP#PPPPP#####PPPPPPPPPPP 18 ##################################################P###################################PPP########################################################
Note: See TracChangeset
for help on using the changeset viewer.