- Timestamp:
- 2012-07-06 12:46:18 (11 years ago)
- Location:
- 2012/27/MaraP/MisterPoo/MisterPoo
- Files:
-
- 7 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/27/MaraP/MisterPoo/MisterPoo/MisterPoo/MisterPoo.cs
r3616 r3666 9 9 public class MisterPoo : PhysicsGame 10 10 { 11 MultiSelectWindow alkuValikko; 12 13 11 14 const double nopeus = 200; 12 15 const double hyppyNopeus = 1000; … … 29 32 public override void Begin() 30 33 { 31 MediaPlayer.Play( "Rainbow Trololol" ); 34 alkuValikko = new MultiSelectWindow("Pelin Alkuvalikko", 35 "Aloita peli", "Kentät", "Lopeta"); 36 alkuValikko.AddItemHandler(0, AloitaKentta1); 37 alkuValikko.AddItemHandler(1, KenttaValikko); 38 alkuValikko.AddItemHandler(2, Exit); 39 Add(alkuValikko); 40 } 41 42 void KenttaValikko() 43 { 44 MultiSelectWindow kenttaValikko = new MultiSelectWindow("Kentät", "Luola", "Joku", "Avaruus"); 45 kenttaValikko.AddItemHandler(0, AloitaKentta1); 46 kenttaValikko.AddItemHandler(2, AloitaKentta3); 47 Add(kenttaValikko); 48 } 49 50 void AloitaKentta3() 51 { 52 MediaPlayer.Play("Rainbow Trololol"); 32 53 kavelyVasemmalle = Image.Mirror(kavelyOikealle); 33 34 //GameObject alkuvalikko = ....35 54 36 55 Gravity = new Vector(0, -1000); 37 56 38 LuoKentta(); 57 LuoKentta("kentta3"); 58 LisaaNappaimet(); 59 60 Camera.Follow(pelaaja1); 61 Camera.ZoomToLevel(); 62 //Camera.StayInLevel = true; 63 64 Level.Background.Image = LoadImage("Battle MoD Level 3"); 65 } 66 67 void AloitaKentta1() 68 { 69 MediaPlayer.Play("Rainbow Trololol"); 70 kavelyVasemmalle = Image.Mirror(kavelyOikealle); 71 72 Gravity = new Vector(0, -1000); 73 74 LuoKentta("kentta1"); 39 75 LisaaNappaimet(); 40 76 … … 44 80 } 45 81 46 void LuoKentta( )82 void LuoKentta(string kenttaNimi) 47 83 { 48 TileMap kentta = TileMap.FromLevelAsset( "kentta1");84 TileMap kentta = TileMap.FromLevelAsset(kenttaNimi); 49 85 kentta.SetTileMethod('#', LisaaTaso); 50 86 kentta.SetTileMethod('*', LisaaTahti); 51 87 kentta.SetTileMethod('N', LisaaPelaaja); 88 kentta.SetTileMethod('n', LisaaNyan); 89 kentta.SetTileMethod('p', LisaaPlaneetta); 90 kentta.SetTileMethod('t', LisaaTaso2); 52 91 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 53 92 Level.CreateBorders(); 54 Level.Background.CreateGradient(Color. White, Color.SkyBlue);93 Level.Background.CreateGradient(Color.Black, Color.Lime); 55 94 } 56 95 … … 60 99 taso.Position = paikka; 61 100 taso.Color = Color.Green; 101 Add(taso); 102 } 103 104 void LisaaTaso2(Vector paikka, double leveys, double korkeus) 105 { 106 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys * 8, korkeus); 107 taso.Position = paikka; 108 taso.Image = LoadImage("taso"); 109 Add(taso); 110 } 111 112 void LisaaPlaneetta(Vector paikka, double leveys, double korkeus) 113 { 114 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 115 taso.Image = LoadImage("planeetta"); 116 taso.Position = paikka; 117 Add(taso); 118 } 119 120 void LisaaNyan(Vector paikka, double leveys, double korkeus) 121 { 122 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys * 15, korkeus); 123 taso.Image = LoadImage("nyan"); 124 taso.Position = paikka; 62 125 Add(taso); 63 126 } … … 99 162 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 100 163 101 Keyboard.Listen(Key. Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus);102 Keyboard.Listen(Key. Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus);103 Keyboard.Listen(Key. Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus);164 Keyboard.Listen(Key.A, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 165 Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 166 Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 104 167 105 168 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); -
2012/27/MaraP/MisterPoo/MisterPoo/MisterPooContent/MisterPooContent.contentproj
r3616 r3666 101 101 </Compile> 102 102 </ItemGroup> 103 <ItemGroup> 104 <Compile Include="Battle MoD Level 1.png"> 105 <Name>Battle MoD Level 1</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 </Compile> 109 </ItemGroup> 110 <ItemGroup> 111 <Compile Include="Battle MoD Level 2.png"> 112 <Name>Battle MoD Level 2</Name> 113 <Importer>TextureImporter</Importer> 114 <Processor>TextureProcessor</Processor> 115 </Compile> 116 </ItemGroup> 117 <ItemGroup> 118 <Compile Include="Battle MoD Level 3.png"> 119 <Name>Battle MoD Level 3</Name> 120 <Importer>TextureImporter</Importer> 121 <Processor>TextureProcessor</Processor> 122 </Compile> 123 </ItemGroup> 124 <ItemGroup> 125 <Compile Include="nyan.png"> 126 <Name>nyan</Name> 127 <Importer>TextureImporter</Importer> 128 <Processor>TextureProcessor</Processor> 129 </Compile> 130 <Compile Include="planeetta.png"> 131 <Name>planeetta</Name> 132 <Importer>TextureImporter</Importer> 133 <Processor>TextureProcessor</Processor> 134 </Compile> 135 <Compile Include="taso.png"> 136 <Name>taso</Name> 137 <Importer>TextureImporter</Importer> 138 <Processor>TextureProcessor</Processor> 139 </Compile> 140 </ItemGroup> 141 <ItemGroup> 142 <Compile Include="kentta3.txt"> 143 <Name>kentta3</Name> 144 <Importer>TextFileImporter</Importer> 145 <Processor>TextFileContentProcessor</Processor> 146 </Compile> 147 </ItemGroup> 103 148 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 104 149 <!-- 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.