Changeset 6994
- Timestamp:
- 2015-07-23 15:01:38 (8 years ago)
- Location:
- 2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrolls/TheSideScrolls.cs
r6937 r6994 13 13 const int RUUDUN_KOKO = 40; 14 14 15 DoubleMeter elamaLaskuri; 16 IntMeter ammustenmaara = new IntMeter(0, 0, 25); 15 17 PlatformCharacter pelaaja1; 16 18 … … 23 25 Image possuKuva = LoadImage("the-boar"); 24 26 Image aseKuva = LoadImage("the-boar"); 27 Image ammoKuva = LoadImage("boar-ammo"); 28 Image backroundKuva = LoadImage("background"); 29 Image tileKuva = LoadImage("tile"); 25 30 public override void Begin() 26 31 { … … 28 33 LuoKentta(); 29 34 LisaaNappaimet(); 35 LuoElamaLaskuri(); 30 36 31 37 Camera.Follow(pelaaja1); 32 38 Camera.ZoomFactor = 1.2; 33 39 Camera.StayInLevel = true; 40 41 } 42 void LuoElamaLaskuri() 43 { 44 elamaLaskuri = new DoubleMeter(5); 45 elamaLaskuri.MaxValue = 5; 46 elamaLaskuri.LowerLimit += ElamaLoppui; 47 48 ProgressBar elamaPalkki = new ProgressBar(150, 20); 49 elamaPalkki.X = Screen.Left + 150; 50 elamaPalkki.Y = Screen.Top - 20; 51 elamaPalkki.BindTo(elamaLaskuri); 52 Add(elamaPalkki); 53 elamaPalkki.Angle = Angle.RightAngle; 54 elamaPalkki.Color = Color.Transparent; 55 56 elamaPalkki.BarColor = Color.Red; 57 58 elamaPalkki.BorderColor = Color.Black; 59 } 60 void ElamaLoppui() 61 { 62 MessageDisplay.Add("You Dieded"); 63 pelaaja1.Destroy(); 64 pelaaja1.Weapon.Destroy(); 65 } 66 void LuoPanosLaskuri() 67 { 68 69 Label panosNaytto = new Label(); 70 panosNaytto.X = Screen.Left + 200; 71 panosNaytto.Y = Screen.Top -120; 72 panosNaytto.TextColor = Color.Black; 73 panosNaytto.Color = Color.White; 74 75 panosNaytto.BindTo(ammustenmaara); 76 Add(panosNaytto); 77 panosNaytto.Title = "Boar count"; 78 79 34 80 } 35 81 void LuoKentta() … … 38 84 kentta.SetTileMethod('S', LisaaKivi); 39 85 kentta.SetTileMethod('D', LisaaTaso2); 86 kentta.SetTileMethod('d', LisaaFakeDirt); 40 87 kentta.SetTileMethod('T', LisaaTaso); 41 88 kentta.SetTileMethod('*', LisaaTahti); 42 89 kentta.SetTileMethod('P', LisaaPahis); 43 90 kentta.SetTileMethod('N', LisaaPelaaja); 91 kentta.SetTileMethod('A', LisaaAmmo); 92 kentta.SetTileMethod('t', LisaaTile); 44 93 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 45 94 Level.CreateBorders(); 46 95 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 47 } 96 Level.Background.Image = backroundKuva; 97 LuoPanosLaskuri(); 98 } 99 void LisaaTile(Vector paikka, double leveys, double korkeus) 100 { 101 PhysicsObject tile = PhysicsObject.CreateStaticObject(leveys, korkeus); 102 tile.Position = paikka; 103 Add(tile); 104 tile.Image = tileKuva; 105 } 106 48 107 49 108 void LisaaTaso(Vector paikka, double leveys, double korkeus) … … 60 119 Add(taso2); 61 120 taso2.Image = downdirtKuva; 121 } 122 void LisaaFakeDirt(Vector paikka, double leveys, double korkeus) 123 { 124 PhysicsObject fdirt = PhysicsObject.CreateStaticObject(leveys, korkeus); 125 fdirt.Position = paikka; 126 Add(fdirt); 127 fdirt.Image = downdirtKuva; 128 fdirt.IgnoresCollisionResponse = true; 62 129 } 63 130 void LisaaKivi(Vector paikka, double leveys, double korkeus) … … 80 147 void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 81 148 { 82 pelaaja1 = new PlatformCharacter( 100, 100);149 pelaaja1 = new PlatformCharacter(50, 50); 83 150 pelaaja1.Position = paikka; 84 151 pelaaja1.Mass = 4.0; … … 89 156 pelaaja1.Weapon = new AssaultRifle(40, 25); 90 157 91 pelaaja1.Weapon.Ammo.Value = 1000; 158 pelaaja1.Weapon.Ammo.Value = 0; 159 160 pelaaja1.Weapon.Ammo.MaxValue = 25; 161 162 pelaaja1.Weapon.CanHitOwner = true; 163 164 pelaaja1.Weapon.FireRate = 5.0; 92 165 93 166 pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 94 167 95 168 pelaaja1.Weapon.Image = aseKuva; 96 } 169 170 AddCollisionHandler(pelaaja1, "pahis", VihollisTormaus); 171 172 AddCollisionHandler(pelaaja1, "ammo", AmmoKeräys); 173 } 174 97 175 void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 98 176 { … … 105 183 if (ammus != null) 106 184 { 185 ammustenmaara.Value--; 186 pelaaja1.Weapon.Ammo.Value = ammustenmaara; 107 187 ammus.Image = possuKuva; 108 188 ammus.Size *= 12; 109 189 ammus.MaximumLifetime = TimeSpan.FromSeconds(10.0); 190 ammus.Tag = "ammus"; 110 191 } 192 } 193 void LisaaAmmo(Vector paikka, double leveys, double korkeus) 194 { 195 PhysicsObject ammo = PhysicsObject.CreateStaticObject(leveys, korkeus); 196 ammo.IgnoresCollisionResponse = true; 197 ammo.Position = paikka; 198 ammo.Image = ammoKuva; 199 ammo.Tag = "ammo"; 200 Add(ammo); 111 201 } 112 202 void LisaaNappaimet() … … 154 244 pahis.Image = possuKuva; 155 245 RandomMoverBrain satunnaisAivot = new RandomMoverBrain(200); 156 246 AddCollisionHandler(pahis, "ammus", AmmusTormaus); 157 247 satunnaisAivot.ChangeMovementSeconds = 3; 158 248 pahis.Tag = "pahis"; 159 249 pahis.Brain = satunnaisAivot; 160 250 161 251 } 252 void AmmusTormaus(PhysicsObject tormaaja, PhysicsObject kohde) 253 { 254 tormaaja.Destroy(); 255 MessageDisplay.Add("xp added"); 256 257 } 258 void VihollisTormaus(PhysicsObject tormaaja, PhysicsObject kohde) 259 { 260 elamaLaskuri.Value -= 1; 261 } 262 void AmmoKeräys(PhysicsObject tormaaja, PhysicsObject kohde) 263 { 264 pelaaja1.Weapon.Ammo.Value = +1; 265 ammustenmaara.Value++; 266 kohde.Destroy(); 267 } 162 268 } -
2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrolls/TheSideScrolls.csproj.Debug.cachefile
r6937 r6994 9 9 Content\shoulder.xnb 10 10 Content\the-boar.xnb 11 Content\puolipalkki.xnb 12 Content\tyhjapalkki.xnb 13 Content\taysipalkki.xnb 14 Content\ProgressBar.xnb 15 Content\boar-ammo.xnb 16 Content\background.xnb 17 Content\tile.xnb -
2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrolls/obj/x86/Debug/TheSideScrolls.csproj.FileListAbsolute.txt
r6937 r6994 17 17 C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\shoulder.xnb 18 18 C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\the-boar.xnb 19 C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\puolipalkki.xnb 20 C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\tyhjapalkki.xnb 21 C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\taysipalkki.xnb 22 C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\ProgressBar.xnb 23 C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\boar-ammo.xnb 24 C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\background.xnb 25 C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\tile.xnb -
2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrolls/obj/x86/Debug/cachefile-{2F9CC970-4606-409A-BE85-CDF1A2096940}-targetpath.txt
r6937 r6994 9 9 Content\shoulder.xnb 10 10 Content\the-boar.xnb 11 Content\puolipalkki.xnb 12 Content\tyhjapalkki.xnb 13 Content\taysipalkki.xnb 14 Content\ProgressBar.xnb 15 Content\boar-ammo.xnb 16 Content\background.xnb 17 Content\tile.xnb -
2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrollsContent/TheSideScrollsContent.contentproj
r6937 r6994 107 107 </Compile> 108 108 </ItemGroup> 109 <ItemGroup> 110 <Compile Include="puolipalkki.png"> 111 <Name>puolipalkki</Name> 112 <Importer>TextureImporter</Importer> 113 <Processor>TextureProcessor</Processor> 114 </Compile> 115 </ItemGroup> 116 <ItemGroup> 117 <Compile Include="tyhjapalkki.png"> 118 <Name>tyhjapalkki</Name> 119 <Importer>TextureImporter</Importer> 120 <Processor>TextureProcessor</Processor> 121 </Compile> 122 </ItemGroup> 123 <ItemGroup> 124 <Compile Include="taysipalkki.png"> 125 <Name>taysipalkki</Name> 126 <Importer>TextureImporter</Importer> 127 <Processor>TextureProcessor</Processor> 128 </Compile> 129 </ItemGroup> 130 <ItemGroup> 131 <Compile Include="ProgressBar.png"> 132 <Name>ProgressBar</Name> 133 <Importer>TextureImporter</Importer> 134 <Processor>TextureProcessor</Processor> 135 </Compile> 136 </ItemGroup> 137 <ItemGroup> 138 <Compile Include="boar-ammo.png"> 139 <Name>boar-ammo</Name> 140 <Importer>TextureImporter</Importer> 141 <Processor>TextureProcessor</Processor> 142 </Compile> 143 </ItemGroup> 144 <ItemGroup> 145 <Compile Include="background.jpg"> 146 <Name>background</Name> 147 <Importer>TextureImporter</Importer> 148 <Processor>TextureProcessor</Processor> 149 </Compile> 150 </ItemGroup> 151 <ItemGroup> 152 <Compile Include="tile.png"> 153 <Name>tile</Name> 154 <Importer>TextureImporter</Importer> 155 <Processor>TextureProcessor</Processor> 156 </Compile> 157 </ItemGroup> 109 158 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 110 159 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrollsContent/kentta1.txt
r6937 r6994 3 3 4 4 5 6 7 8 9 10 11 N 12 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT 13 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDTT 14 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSS TTTTTTTTTTTTTTTTTTTTTTTTTTTT 15 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSSSS SDDDDDDDDDD 16 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSSSSSSSSSSSSSSSSSSSSSS SDDDDDDDDDD 17 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSSSSSSSSSSSSSSSSSSSS SDDDDDDDDDDD 18 ssssssssssSSSSSSSSSS SDDDDDDDDD 5 .................................................................... 6 .................................................................... 7 PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 8 ......................................................................... 9 ....................................................................... 10 .......................................................................t.t.t..................... 11 .......N............AAA................................................ttttt.............................. 12 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT....................tt.tt.................................................... 13 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDTT...................tt.tt................................... 14 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSS....TTTTTTTTTTTTTTTTTTTTTTTTTT..................................... 15 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSS..........................SDDDDDDDDDD.................................................. 16 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSSSSSSSSSSSSSSSSSSSSSS.....SDDDDDDDDDDD.............................. 17 .........................................................SSSSSSSSSSSSSSS......SDDDDDDDDD........................... 18 ..........................................................SSSSSSSSSSSSSSS........SDDDD......................... 19 .................................................................................................................. 20 ......................................................................................................................... 21 ............................................................................................................................... 22 ........................................................................................................................................... 23 ................................................................................................................................. 24 .................................................................................................................................. -
2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrollsContent/obj/x86/Debug/ContentPipeline.xml
r6937 r6994 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2015-07-2 2T14:51:58.3971963+03:00</Time>38 <Time>2015-07-23T14:59:03.8181859+03:00</Time> 39 39 </Item> 40 40 <Item> … … 91 91 <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\the-boar.xnb</Output> 92 92 <Time>2015-07-22T14:26:33.2330691+03:00</Time> 93 </Item> 94 <Item> 95 <Source>puolipalkki.png</Source> 96 <Name>puolipalkki</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\puolipalkki.xnb</Output> 101 <Time>2015-07-23T10:33:57.5389951+03:00</Time> 102 </Item> 103 <Item> 104 <Source>tyhjapalkki.png</Source> 105 <Name>tyhjapalkki</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\tyhjapalkki.xnb</Output> 110 <Time>2015-07-23T10:34:01.6711951+03:00</Time> 111 </Item> 112 <Item> 113 <Source>taysipalkki.png</Source> 114 <Name>taysipalkki</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\taysipalkki.xnb</Output> 119 <Time>2015-07-23T10:34:08.0515951+03:00</Time> 120 </Item> 121 <Item> 122 <Source>ProgressBar.png</Source> 123 <Name>ProgressBar</Name> 124 <Importer>TextureImporter</Importer> 125 <Processor>TextureProcessor</Processor> 126 <Options>None</Options> 127 <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\ProgressBar.xnb</Output> 128 <Time>2015-07-23T10:34:27.6273951+03:00</Time> 129 </Item> 130 <Item> 131 <Source>boar-ammo.png</Source> 132 <Name>boar-ammo</Name> 133 <Importer>TextureImporter</Importer> 134 <Processor>TextureProcessor</Processor> 135 <Options>None</Options> 136 <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\boar-ammo.xnb</Output> 137 <Time>2015-07-23T12:46:41.7454859+03:00</Time> 138 </Item> 139 <Item> 140 <Source>background.jpg</Source> 141 <Name>background</Name> 142 <Importer>TextureImporter</Importer> 143 <Processor>TextureProcessor</Processor> 144 <Options>None</Options> 145 <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\background.xnb</Output> 146 <Time>2015-07-23T14:27:50.0307859+03:00</Time> 147 </Item> 148 <Item> 149 <Source>tile.png</Source> 150 <Name>tile</Name> 151 <Importer>TextureImporter</Importer> 152 <Processor>TextureProcessor</Processor> 153 <Options>None</Options> 154 <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\tile.xnb</Output> 155 <Time>2015-07-23T14:53:50.0501859+03:00</Time> 93 156 </Item> 94 157 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.