- Timestamp:
- 2016-06-16 15:00:10 (7 years ago)
- Location:
- 2016/24/OliverK
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/24/OliverK/Pong/Pong/Pong/Pong.cs
r7287 r7391 64 64 65 65 void hidasta() { 66 pallo.Velocity /=2; 66 { 67 pallo.Velocity /= 2; 67 68 68 69 } -
2016/24/OliverK/pomppupeli/pomppupeli/pomppupeli/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r7332 r7391 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\OliverK\pomppupeli\pomppupeli\pomppupeli\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2016-06-1 5T14:21:02.0051113+03:00</Time>38 <Time>2016-06-16T14:33:24.4675539+03:00</Time> 39 39 </Item> 40 40 <Item> … … 101 101 <Time>2016-06-15T11:14:46.1756165+03:00</Time> 102 102 </Item> 103 <Item> 104 <Source>nyan cat.png</Source> 105 <Name>nyan cat</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\OliverK\pomppupeli\pomppupeli\pomppupeli\bin\x86\Debug\Content\nyan cat.xnb</Output> 110 <Time>2016-06-16T10:32:44.3469004+03:00</Time> 111 </Item> 103 112 <BuildSuccessful>true</BuildSuccessful> 104 113 <Settings> -
2016/24/OliverK/pomppupeli/pomppupeli/pomppupeli/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r7332 r7391 10 10 Content\golden block.xnb 11 11 Content\images.xnb 12 Content\nyan cat.xnb -
2016/24/OliverK/pomppupeli/pomppupeli/pomppupeli/obj/x86/Debug/pomppupeli.csproj.FileListAbsolute.txt
r7332 r7391 18 18 C:\MyTemp\OliverK\pomppupeli\pomppupeli\pomppupeli\bin\x86\Debug\Content\golden block.xnb 19 19 C:\MyTemp\OliverK\pomppupeli\pomppupeli\pomppupeli\bin\x86\Debug\Content\images.xnb 20 C:\MyTemp\OliverK\pomppupeli\pomppupeli\pomppupeli\bin\x86\Debug\Content\nyan cat.xnb -
2016/24/OliverK/pomppupeli/pomppupeli/pomppupeli/pomppupeli.cs
r7332 r7391 9 9 public class pomppupeli : PhysicsGame 10 10 { 11 double nopeus = 1000;12 const double hyppyNopeus = 750;11 double nopeus = 700; 12 const double hyppyNopeus = 800; 13 13 const int RUUDUN_KOKO = 40; 14 14 … … 16 16 17 17 Image palikkakuva = LoadImage("images"); 18 Image ukkonKuva = LoadImage("ukko"); 18 19 Image pelaajanKuva = LoadImage("ukko2"); 19 Image tahtiKuva = LoadImage("DL2"); 20 Image dl2Kuva = LoadImage("DL2"); 21 Image nyancat = LoadImage("nyan cat"); 20 22 Image taustakuva = LoadImage("tausta2"); 21 23 SoundEffect maaliAani = LoadSoundEffect("maali"); 22 24 23 24 25 IPhysicsObject ukko2; 25 26 IntMeter pistelaskuri; 27 28 29 PhysicsObject ukko2; 26 30 27 31 public double Velocity { get; private set; } 32 28 33 29 34 public override void Begin() … … 34 39 LuoKentta(); 35 40 LisaaNappaimet(); 36 AsetaOhujaimet(); 41 luoajastin(); 42 LuoPistelaskuri(); 43 LuoAikalaskuri(); 44 37 45 38 46 Camera.Follow(pelaaja1); … … 45 53 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 46 54 kentta.SetTileMethod('E', LisaaTaso); 47 kentta.SetTileMethod('*', Lisaa Tahti);55 kentta.SetTileMethod('*', LisaaDL2); 48 56 kentta.SetTileMethod('N', LisaaPelaaja); 49 57 kentta.SetTileMethod('#', lisaaPalikka); … … 55 63 //Add(tausta, -3); 56 64 65 66 67 68 57 69 } 58 70 … … 75 87 } 76 88 77 void LisaaTahti(Vector paikka, double leveys, double korkeus) 78 { 79 PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys, korkeus); 80 tahti.IgnoresCollisionResponse = true; 81 tahti.Position = paikka; 82 tahti.Image = tahtiKuva; 83 tahti.Tag = "tahti"; 84 Add(tahti); 89 void LisaaDL2(Vector paikka, double leveys, double korkeus) 90 { 91 PlatformCharacter dl2 = new PlatformCharacter(leveys, korkeus); 92 dl2.Position = paikka; 93 dl2.Image = dl2Kuva; 94 dl2.Tag = "DL2"; 95 Add(dl2); 96 97 85 98 } 86 99 … … 91 104 pelaaja1.Mass = 4.0; 92 105 pelaaja1.Image = pelaajanKuva; 93 AddCollisionHandler(pelaaja1, " tahti", TormaaTahteen);106 AddCollisionHandler(pelaaja1, "DL2", TormaaTahteen); 94 107 Add(pelaaja1); 95 108 } … … 110 123 ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 111 124 112 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 125 126 113 127 } 114 128 … … 125 139 void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti) 126 140 { 141 pistelaskuri.Value += 1; 127 142 maaliAani.Play(); 128 143 MessageDisplay.Add("SAIT DAIMOND LUKON!"); 129 144 tahti.Destroy(); 130 145 } 131 void AsetaOhujaimet() 132 { 133 Keyboard.Listen(Key.Z, ButtonState.Down, hidasta, "Hidasta palloa"); 134 Keyboard.Listen(Key.A, ButtonState.Down, nopeuta, "Nopeuta palloa"); 135 136 } 137 138 void hidasta() 139 { 140 nopeus -= 100; 141 142 } 143 void nopeuta() 144 { 145 nopeus += 100; 146 147 148 149 } 146 void luoajastin() 147 { 148 149 Timer ajastin = new Timer(); 150 ajastin.Interval = 1.5; 151 ajastin.Timeout += luoolio; 152 ajastin.Start(); 153 154 155 156 157 } 158 159 void luoolio() 160 { 161 //PlatformCharacter nyanCat = new PlatformCharacter(50.0, 40.0); 162 //nyanCat.Position = new Vector(RandomGen.NextDouble(Level.Left, Level.Right), RandomGen.NextDouble(Level.Bottom, Level.Top)); 163 //nyanCat.Image = nyancat; 164 //Add(nyanCat); 165 166 FollowerBrain seuraajanAivot = new FollowerBrain(pelaaja1); 167 168 seuraajanAivot.Speed = 150; // Millä nopeudella kohdetta seurataan 169 seuraajanAivot.DistanceFar = 600; // Etäisyys jolla aletaan seurata kohdetta 170 seuraajanAivot.DistanceClose = 200; // Etäisyys jolloin ollaan lähellä kohdetta 171 172 //nyanCat.Brain = seuraajanAivot; 173 174 175 } 176 177 178 179 180 void LuoAikalaskuri() 181 { 182 Timer aikaLaskuri = new Timer(); 183 aikaLaskuri.Start(); 184 185 Label aikaNaytto = new Label(); 186 aikaNaytto.TextColor = Color.White; 187 aikaNaytto.Position = new Vector(500, 400); 188 aikaNaytto.DecimalPlaces = 1; 189 aikaNaytto.BindTo(aikaLaskuri.SecondCounter); 190 Add(aikaNaytto); 191 } 192 193 194 195 void LuoPistelaskuri() 196 { 197 pistelaskuri = new IntMeter(0,0,46); 198 pistelaskuri.UpperLimit += lopetapeli; 199 Label pisteNaytto = new Label(); 200 pisteNaytto.X = Screen.Left + 100; 201 pisteNaytto.Y = Screen.Top - 100; 202 pisteNaytto.TextColor = Color.Black; 203 pisteNaytto.Color = Color.White; 204 205 pisteNaytto.BindTo(pistelaskuri); 206 Add(pisteNaytto); 207 } 208 209 210 void lopetapeli() 211 { 212 MessageDisplay.Add("YOU WINNER"); 213 214 } 215 150 216 } -
2016/24/OliverK/pomppupeli/pomppupeli/pomppupeli/pomppupeli.csproj.Debug.cachefile
r7332 r7391 10 10 Content\golden block.xnb 11 11 Content\images.xnb 12 Content\nyan cat.xnb -
2016/24/OliverK/pomppupeli/pomppupeli/pomppupeliContent/kentta1.txt
r7332 r7391 1 2 3 * * 4 ########### #### ########### 5 6 * * * * * 7 ### ## ### # ### ## ### 8 9 * * * * * 10 ### #### ### #### ### 11 12 * * * * 13 #### #### #### #### 14 15 N 16 ############################# 1 2 3 yfuhfsghfgsfhsuhufgsdfghsdsf 4 p**************************a 5 k a 6 w ## d 7 q ** s 8 d x 9 e ## ## d 10 g ** ** f 11 t v 12 ö ## ## ## b 13 s ** ** ** f 14 d b 15 l ## ## ## ## f 16 d ** ** ** ** v 17 e j 18 e ## ## ## ## ## t 19 j e 20 w y 21 f ## ## ## ## ## ## h 22 f j 23 n N y 24 ############################ -
2016/24/OliverK/pomppupeli/pomppupeli/pomppupeliContent/pomppupeliContent.contentproj
r7332 r7391 114 114 </Compile> 115 115 </ItemGroup> 116 <ItemGroup> 117 <Compile Include="nyan cat.png"> 118 <Name>nyan cat</Name> 119 <Importer>TextureImporter</Importer> 120 <Processor>TextureProcessor</Processor> 121 </Compile> 122 </ItemGroup> 116 123 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 117 124 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.