Changeset 3034
- Timestamp:
- 2012-06-14 15:09:52 (11 years ago)
- Location:
- 2012/24/EeroF/LabTank
- Files:
-
- 11 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/24/EeroF/LabTank/LabTank/LabTank/LabTank.cs
r3003 r3034 9 9 public class LabTank : PhysicsGame 10 10 { 11 const double nopeus = 200; 12 const double hyppyNopeus = 200; 11 const double kaantyy = 20; 12 const double nopeus = 500; 13 const double hyppyNopeus = 500; 13 14 const int RUUDUN_KOKO = 40; 14 15 15 16 PhysicsObject pelaaja1; 16 17 17 Image pelaajanKuva = LoadImage("norsu"); 18 19 Image pelaajanKuva = LoadImage("pelaaja"); 18 20 Image tahtiKuva = LoadImage("tahti"); 21 Image tasonKuva = LoadImage("taso"); 22 Image taustanKuva = LoadImage("tausta"); 19 23 20 24 SoundEffect maaliAani = LoadSoundEffect("maali"); … … 37 41 kentta.SetTileMethod('#', lisaaTaso); 38 42 kentta.SetTileMethod('*', lisaaTahti); 39 kentta.SetTileMethod('N', lisaaPelaaja); 43 kentta.SetTileMethod('P', lisaaPelaaja); 44 // kentta.SetTileMethod('A', lisaaMinitorni); 40 45 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 41 46 Level.CreateBorders(); 42 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 47 Level.Background.CreateGradient(Color.Black , Color.White); 48 Level.Background.Image = taustanKuva; 43 49 } 44 50 … … 48 54 taso.Position = paikka; 49 55 taso.Color = Color.Green; 56 50 57 Add(taso); 51 58 } … … 63 70 void lisaaPelaaja(Vector paikka, double leveys, double korkeus) 64 71 { 65 pelaaja1 = new PhysicsObject(leveys, korkeus); 72 pelaaja1 = new PhysicsObject (leveys, korkeus); 73 pelaaja1.CanRotate = false; 74 66 75 pelaaja1.Position = paikka; 67 pelaaja1.Mass = 4.0;76 pelaaja1.Mass = 100.0; 68 77 pelaaja1.Image = pelaajanKuva; 69 78 AddCollisionHandler(pelaaja1, kasittelePelaajanTormays); … … 77 86 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 78 87 79 // Keyboard.Listen(Key.Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 80 // Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 81 Keyboard.Listen(Key.Up, ButtonState.Down, hyppaa, "Liikkuu ylös", pelaaja1, hyppyNopeus); 82 Keyboard.Listen(Key.Down, ButtonState.Down, hyppaa, "Liikkuu alas", pelaaja1, -hyppyNopeus); 88 Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 89 Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 90 Keyboard.Listen(Key.W, ButtonState.Down, hyppaa, "Liikkuu ylös", pelaaja1, hyppyNopeus); 91 Keyboard.Listen(Key.S, ButtonState.Down, hyppaa, "Liikkuu alas", pelaaja1, -hyppyNopeus); 92 Keyboard.Listen(Key.Up, ButtonState.Down, kaanna, "Kääntyy", pelaaja1, kaantyy); 93 94 83 95 84 96 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 85 97 86 98 87 //ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus);88 //ControllerOne.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus);99 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 100 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 89 101 ControllerOne.Listen(Button.DPadUp, ButtonState.Down, hyppaa, "Pelaaja liikkuu ylös", pelaaja1, hyppyNopeus); 90 102 ControllerOne.Listen(Button.DPadDown, ButtonState.Down, hyppaa, "Pelaaja liikkuu alas", pelaaja1, -hyppyNopeus); … … 93 105 } 94 106 95 void liikuta(P latformCharacterhahmo, double nopeus)107 void liikuta(PhysicsObject hahmo, double nopeus) 96 108 { 97 hahmo. Walk(nopeus);109 hahmo.Velocity = new Vector (nopeus, 0); 98 110 } 99 111 … … 101 113 { 102 114 hahmo.Velocity = new Vector(0, nopeus); 115 103 116 } 104 117 … … 108 121 { 109 122 maaliAani.Play(); 110 MessageDisplay.Add(" Keräsit tähden!");111 123 MessageDisplay.Add("Voitit tason!"); 124 // kohde.Destroy(); 112 125 } 113 126 } 127 void lisaaMinitorni (Vector paikka, double y, double x ) 128 { 129 114 130 } 131 void kaanna(PhysicsObject hahmo, double kaantyy) 132 { 133 134 } 135 136 } -
2012/24/EeroF/LabTank/LabTank/LabTank/LabTank.csproj.Debug.cachefile
r3003 r3034 3 3 Content\tahti.xnb 4 4 Content\kentta1.xnb 5 Content\pelaaja.xnb 6 Content\tausta.xnb 7 Content\Tykkitorni.xnb 8 Content\Minitankki.xnb 9 Content\Taso.xnb 5 10 Content\kentta1.txt -
2012/24/EeroF/LabTank/LabTank/LabTank/bin/x86/Debug/Content/kentta1.txt
r3003 r3034 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 N28 2 ################################################################################### 3 # # 4 # # 5 ######## ############################################################### #### 6 ######## # # # 7 ######## # # # 8 ######## # # # 9 ######## # # # 10 ######## # # # 11 ######## # # 12 ######## # # 13 ######## # # 14 ######## # # 15 ### #### # # 16 ###*#### # # 17 ######## # # 18 ######## # # 19 ######## # # 20 ######## # # 21 ######## # # 22 ######## # # 23 ######## ################################################################## # 24 ######## # # 25 # # # 26 ########################################################################### ##### 27 # # 28 # P # 29 ################################################################################### -
2012/24/EeroF/LabTank/LabTank/LabTank/obj/x86/Debug/ContentPipeline-{93849E76-CF87-4581-B77C-74DA2F8B7CEC}.xml
r3003 r3034 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2012-06-13T14:04:06.4020513+03:00</Time> 38 <Time>2012-06-14T14:36:02.6196895+03:00</Time> 39 </Item> 40 <Item> 41 <Source>pelaaja.png</Source> 42 <Name>pelaaja</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\pelaaja.xnb</Output> 47 <Time>2012-06-13T13:55:27.7722513+03:00</Time> 48 </Item> 49 <Item> 50 <Source>tausta.png</Source> 51 <Name>tausta</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\tausta.xnb</Output> 56 <Time>2012-06-13T13:20:31.9089818+03:00</Time> 57 </Item> 58 <Item> 59 <Source>Tykkitorni.png</Source> 60 <Name>Tykkitorni</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Tykkitorni.xnb</Output> 65 <Time>2012-06-14T10:50:15.1267769+03:00</Time> 66 </Item> 67 <Item> 68 <Source>Minitankki.png</Source> 69 <Name>Minitankki</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Minitankki.xnb</Output> 74 <Time>2012-06-14T10:55:42.8520189+03:00</Time> 75 </Item> 76 <Item> 77 <Source>Taso.png</Source> 78 <Name>Taso</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Taso.xnb</Output> 83 <Time>2012-06-14T11:54:10.08295+03:00</Time> 39 84 </Item> 40 85 <BuildSuccessful>true</BuildSuccessful> … … 53 98 <Assembly> 54 99 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 55 <Value>2012-0 4-23T14:23:36+03:00</Value>100 <Value>2012-06-13T10:59:54+03:00</Value> 56 101 </Assembly> 57 102 <Assembly> -
2012/24/EeroF/LabTank/LabTank/LabTank/obj/x86/Debug/LabTank.csproj.FileListAbsolute.txt
r3003 r3034 12 12 C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\kentta1.xnb 13 13 C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\kentta1.txt 14 C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\pelaaja.xnb 15 C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\tausta.xnb 16 C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Tykkitorni.xnb 17 C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Minitankki.xnb 18 C:\MyTemp\EeroF\LabTank\LabTank\LabTank\bin\x86\Debug\Content\Taso.xnb -
2012/24/EeroF/LabTank/LabTank/LabTank/obj/x86/Debug/cachefile-{93849E76-CF87-4581-B77C-74DA2F8B7CEC}-targetpath.txt
r3003 r3034 3 3 Content\tahti.xnb 4 4 Content\kentta1.xnb 5 Content\pelaaja.xnb 6 Content\tausta.xnb 7 Content\Tykkitorni.xnb 8 Content\Minitankki.xnb 9 Content\Taso.xnb 5 10 Content\kentta1.txt -
2012/24/EeroF/LabTank/LabTank/LabTankContent/LabTankContent.contentproj
r3003 r3034 69 69 </Compile> 70 70 </ItemGroup> 71 <ItemGroup> 72 <Compile Include="pelaaja.png"> 73 <Name>pelaaja</Name> 74 <Importer>TextureImporter</Importer> 75 <Processor>TextureProcessor</Processor> 76 </Compile> 77 <Compile Include="tausta.png"> 78 <Name>tausta</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 </Compile> 82 </ItemGroup> 83 <ItemGroup> 84 <Compile Include="Tykkitorni.png"> 85 <Name>Tykkitorni</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 </ItemGroup> 90 <ItemGroup> 91 <Compile Include="Minitankki.png"> 92 <Name>Minitankki</Name> 93 <Importer>TextureImporter</Importer> 94 <Processor>TextureProcessor</Processor> 95 </Compile> 96 </ItemGroup> 97 <ItemGroup> 98 <Compile Include="Taso.png"> 99 <Name>Taso</Name> 100 <Importer>TextureImporter</Importer> 101 <Processor>TextureProcessor</Processor> 102 </Compile> 103 </ItemGroup> 71 104 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 72 105 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2012/24/EeroF/LabTank/LabTank/LabTankContent/kentta1.txt
r3003 r3034 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 N28 2 ################################################################################### 3 # # 4 # # 5 ######## ############################################################### #### 6 ######## # # # 7 ######## # # # 8 ######## # # # 9 ######## # # # 10 ######## # # # 11 ######## # # 12 ######## # # 13 ######## # # 14 ######## # # 15 ### #### # # 16 ###*#### # # 17 ######## # # 18 ######## # # 19 ######## # # 20 ######## # # 21 ######## # # 22 ######## # # 23 ######## ################################################################## # 24 ######## # # 25 # # # 26 ########################################################################### ##### 27 # # 28 # P # 29 ###################################################################################
Note: See TracChangeset
for help on using the changeset viewer.