- Timestamp:
- 2017-06-15 15:04:36 (6 years ago)
- Location:
- 2017/24/LeeviE
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/24/LeeviE/Peli/Jump/Jump/Jump/Jump.cs
r8720 r8740 22 22 Image taahti = LoadImage("tääthi"); 23 23 Image vihu1 = LoadImage("Vihu"); 24 24 int kenttaNro = 1; 25 25 26 26 27 27 28 28 public override void Begin() 29 30 31 32 33 34 35 36 { 37 38 39 LuoKentta(); 29 { 30 SeuraavaKentta(); 31 32 40 33 //Luolaatta(0.0, -100.0); 41 34 //Luolaatta(100.0, -200.0); … … 46 39 47 40 48 GameObject taustakuva = new GameObject(9300.0, 2000.0); 49 taustakuva.Image = tausta; 50 Add(taustakuva, -3); 51 Layers[-3].RelativeTransition = new Vector(0.5, 0.5); 52 taustakuva.Y = 200.0; 53 54 55 56 57 58 59 Asetaohjaimet(); 60 61 62 63 Gravity = new Vector(0.0, -2200.0); 64 65 Camera.Follow(pelaaja); 66 67 41 42 } 43 void LuoMaali(Vector paikka, double leveys, double korkeus) 44 { 45 PhysicsObject maali = new PhysicsObject(100.0, 100.0); 46 47 maali.Position = paikka; 48 maali.Tag = "maali"; 49 50 Add(maali); 51 52 } 53 void LuoVihollinen(Vector paikka, double leveys, double korkeus) 54 { 68 55 PhysicsObject vihollinen = new PhysicsObject(84.0, 124.0); 69 56 vihollinen.Image = vihu1; 70 57 vihollinen.CanRotate = false; 71 58 SmoothTextures = false; 59 vihollinen.Position = paikka; 60 vihollinen.Tag = "vihollinen"; 72 61 Add(vihollinen); 73 vihollinen.Tag = "vihollinen"; 74 75 RandomGen for (int i = 0; i < 20; i++) 76 { 77 78 } 79 80 81 } 82 83 84 85 62 63 } 64 65 86 66 void LuoPelaaja(Vector paikka, double leveys, double korkeus) 87 67 { … … 92 72 AddCollisionHandler(pelaaja, "tahti", TormaaTahteen); 93 73 AddCollisionHandler(pelaaja, "vihollinen", TormaaViholliseen); 74 AddCollisionHandler(pelaaja, "maali", TormasiMaaliin); 94 75 //pelaaja.Weapon = new AssaultRifle(30, 10); 95 76 //pelaaja.Weapon.Ammo.Value = 10000; … … 103 84 104 85 } 105 86 void SeuraavaKentta() 87 { 88 ClearAll(); 89 90 if (kenttaNro == 1) LuoKentta("kentta1"); 91 else if (kenttaNro == 2) LuoKentta("kentta2"); 92 else if (kenttaNro == 2) Exit(); 93 94 GameObject taustakuva = new GameObject(9300.0, 2000.0); 95 taustakuva.Image = tausta; 96 Add(taustakuva, -3); 97 Layers[-3].RelativeTransition = new Vector(0.5, 0.5); 98 taustakuva.Y = 200.0; 99 100 101 102 103 104 105 Asetaohjaimet(); 106 107 108 109 Gravity = new Vector(0.0, -2200.0); 110 111 Camera.Follow(pelaaja); 112 113 114 115 116 117 } 106 118 void TormaaTahteen(PhysicsObject pelaaja, PhysicsObject tahti) 107 119 { … … 113 125 { 114 126 pelaaja.Destroy(); 115 MessageDisplay.Add("Kuolit ");127 MessageDisplay.Add("Kuolit."); 116 128 } 117 129 … … 130 142 } 131 143 132 void LuoKentta( )144 void LuoKentta(string kentta) 133 145 { 134 146 //PhysicsObject plat1 = new PhysicsObject(100.0, 20.0); … … 137 149 //plat1.MakeStatic(); 138 150 139 TileMap ruudut = TileMap.FromLevelAsset( "kentta1");151 TileMap ruudut = TileMap.FromLevelAsset(kentta); 140 152 ruudut.SetTileMethod('#', LuoPalikka); 141 153 ruudut.SetTileMethod('*', LuoTahti); 142 154 ruudut.SetTileMethod('!', LuoPelaaja); 155 ruudut.SetTileMethod('v', LuoVihollinen); 156 ruudut.SetTileMethod('M', LuoMaali); 143 157 ruudut.Execute( 100.0, 100.0); 144 158 145 159 146 147 148 } 149 150 160 161 162 } 163 void TormasiMaaliin(PhysicsObject pelaaja, PhysicsObject maali) 164 { 165 kenttaNro++; 166 SeuraavaKentta(); 167 } 168 151 169 152 170 void LuoPalikka(Vector paikka, double leveys, double korkeus) -
2017/24/LeeviE/Peli/Jump/Jump/Jump/Jump.csproj.Debug.cachefile
r8702 r8740 11 11 Content\tÀÀthi.xnb 12 12 Content\Vihu.xnb 13 Content\kentta2.xnb -
2017/24/LeeviE/Peli/Jump/Jump/Jump/obj/x86/Debug/ContentPipeline-{2750B644-1BA7-4D9C-B766-2A8DD7E77FC1}.xml
r8702 r8740 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\LeeviE\Peli\Jump\Jump\Jump\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2017-06-1 4T14:57:06.9173888+03:00</Time>38 <Time>2017-06-15T15:00:49.8540514+03:00</Time> 39 39 </Item> 40 40 <Item> … … 110 110 <Time>2017-06-15T11:43:01.1866565+03:00</Time> 111 111 </Item> 112 <Item> 113 <Source>kentta2.txt</Source> 114 <Name>kentta2</Name> 115 <Importer>TextFileImporter</Importer> 116 <Processor>TextFileContentProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\LeeviE\Peli\Jump\Jump\Jump\bin\x86\Debug\Content\kentta2.xnb</Output> 119 <Time>2017-06-15T14:19:17.6352347+03:00</Time> 120 </Item> 112 121 <BuildSuccessful>true</BuildSuccessful> 113 122 <Settings> -
2017/24/LeeviE/Peli/Jump/Jump/Jump/obj/x86/Debug/Jump.csproj.FileListAbsolute.txt
r8702 r8740 19 19 C:\MyTemp\LeeviE\Peli\Jump\Jump\Jump\bin\x86\Debug\Content\tÀÀthi.xnb 20 20 C:\MyTemp\LeeviE\Peli\Jump\Jump\Jump\bin\x86\Debug\Content\Vihu.xnb 21 C:\MyTemp\LeeviE\Peli\Jump\Jump\Jump\bin\x86\Debug\Content\kentta2.xnb -
2017/24/LeeviE/Peli/Jump/Jump/Jump/obj/x86/Debug/cachefile-{2750B644-1BA7-4D9C-B766-2A8DD7E77FC1}-targetpath.txt
r8702 r8740 11 11 Content\tÀÀthi.xnb 12 12 Content\Vihu.xnb 13 Content\kentta2.xnb -
2017/24/LeeviE/Peli/Jump/Jump/JumpContent/JumpContent.contentproj
r8702 r8740 129 129 </Compile> 130 130 </ItemGroup> 131 <ItemGroup> 132 <Compile Include="kentta2.txt"> 133 <Name>kentta2</Name> 134 <Importer>TextFileImporter</Importer> 135 <Processor>TextFileContentProcessor</Processor> 136 </Compile> 137 </ItemGroup> 131 138 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 132 139 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2017/24/LeeviE/Peli/Jump/Jump/JumpContent/kentta1.txt
r8675 r8740 2 2 3 3 4 #######################################################################################################################################.....# .......#5 #............................................................................#...............................................................#. .....#6 #......................................... ...................................#.................................................................#....#7 #............................................................... .....#.......#...............................................*...............#......#4 #######################################################################################################################################.....#M......# 5 #............................................................................#...............................................................#.!....# 6 #.........................................v..................................#.................................................................#....# 7 #...............................................................v....#.......#...............................................*...............#......# 8 8 #..............................##..#..............................*..#.......#..............................................###...........###.......# 9 #.............................................*.....#..##....#..###..#..#....#................. .....###.................##............##............#10 #.......................#..###........#.....######.........#.........#.......#.............#..####.......#..... ..*..##............##................#11 #.............. ....###.*..............#...#..........................#.......#......#..##..............*.#....####..................................#12 #. !...........###.....................#.#............................##..........#.......................#..#.......................................#13 # ..................................*..#..............................#......*............................#..........................................#9 #.............................................*.....#..##....#..###..#..#....#.................v....###.................##............##............# 10 #.......................#..###........#.....######.........#.........#.......#.............#..####.......#.....v.*..##............##................# 11 #..............v...###................#...#..........................#.......#......#..##..............*.#....####..................................# 12 #.............###.....................#.#............................##..........#.......................#..#.......................................# 13 #!....#................v..............#..............................#......*............................#..........................................# 14 14 #################################################################################################################################################### -
2017/24/LeeviE/kentta1.txt
r8702 r8740 11 11 #..................###.*..............#..............................#.......#......#..##................#....####..................................# 12 12 #.!...........###.....................#.#............................##..................................#..........................................# 13 #....... ..............................#..............................#......*............................#..........................................#13 #.......v.............................#..............................#......*............................#..........................................# 14 14 #################################################################################################################################################### -
2017/24/LeeviE/kentta2.txt
r8720 r8740 3 3 #................................................#..............#######################..#......# 4 4 #.............................................#..#..............#.....................#....#....# 5 #....................v...v....................#..#. .......v.....#......v..............#......#..#5 #....................v...v....................#..#.M......v.....#......v..............#......#..# 6 6 #................############..##.......#######..################...############......#.........# 7 7 #..........#.#..........#####.....####........#.....................#............######.....#...#
Note: See TracChangeset
for help on using the changeset viewer.