- Timestamp:
- 2012-07-25 15:12:04 (11 years ago)
- Location:
- 2012/30/JuusoK/Fear_Calls/Fear_Calls
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/30/JuusoK/Fear_Calls/Fear_Calls/Fear_Calls/Fear_Calls.cs
r3728 r3756 8 8 public class Fear_Calls : PhysicsGame 9 9 { 10 Color PelaajanVari; 10 11 EasyHighScore top10 = new EasyHighScore(); 11 12 Image PeliHahmot = LoadImage( "Guests" ); … … 16 17 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 17 18 alkuValikko(); 19 18 20 } 19 21 … … 71 73 } 72 74 73 //void ValitsePelaaja(int valinta)74 //{75 // switch (valinta)76 // {77 // case 0:78 // //StartGame();79 // break;80 // case 1:81 // //Survival();82 // break;83 // case 2:84 // //Highscore();85 // break;86 // case 3:87 // //Exit();88 // break;89 // }90 //}91 92 75 void PelaajaValittiin(int valinta) 93 76 { … … 114 97 void GameStart(Color vari) 115 98 { 116 117 118 99 ClearGameObjects(); 100 PelaajanVari = vari; 101 TileMap ruudut = TileMap.FromLevelAsset("Kentta1"); 102 103 Camera.StayInLevel = true; 104 Camera.Zoom(2); 105 106 ruudut.SetTileMethod('.', LuoLattia); 107 ruudut.SetTileMethod('#', LuoSeinä); 108 ruudut.SetTileMethod('1', LuoPelaaja1); 109 ruudut.SetTileMethod('2', LuoPelaaja2); 110 ruudut.SetTileMethod('Z', LuoZombi); 111 ruudut.Execute(50,50); 112 } 113 114 void LuoSeinä(Vector paikka, double leveys, double korkeus) 115 { 116 PhysicsObject Seinä = PhysicsObject.CreateStaticObject(leveys, korkeus); 117 Seinä.Position = paikka; 118 Seinä.Shape = Shape.Rectangle; 119 Seinä.Color = Color.Gray; 120 Add(Seinä); 121 Seinä.CollisionIgnoreGroup = 1; 122 } 123 124 void LuoLattia(Vector paikka, double leveys, double korkeus) 125 { 126 PhysicsObject Lattia = PhysicsObject.CreateStaticObject(leveys, korkeus); 127 Lattia.Position = paikka; 128 Lattia.IgnoresCollisionResponse = true; 129 130 Add(Lattia); 131 Lattia.CollisionIgnoreGroup = 1; 132 } 133 134 void LuoPelaaja1(Vector paikka, double leveys, double korkeus) 135 { 136 PhysicsObject Pelaaja1 = new PhysicsObject(leveys, korkeus); 137 Pelaaja1.Position = paikka; 138 Pelaaja1.Shape = Shape.Circle; 139 Pelaaja1.Image = LoadImage("Player"); 140 Pelaaja1.Image.ReplaceColor(Color.White, PelaajanVari); 141 Add(Pelaaja1); 142 Camera.Follow(Pelaaja1); 143 144 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, 145 LiikutaPelaajaa, null, new Vector(-1000, 0), Pelaaja1); 146 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, 147 LiikutaPelaajaa, null, new Vector(1000, 0), Pelaaja1); 148 ControllerOne.Listen(Button.DPadUp, ButtonState.Down, 149 LiikutaPelaajaa, null, new Vector(0, 1000), Pelaaja1); 150 ControllerOne.Listen(Button.DPadDown, ButtonState.Down, 151 LiikutaPelaajaa, null, new Vector(0, -1000), Pelaaja1); 152 153 Pelaaja1.LinearDamping = 0.80; 154 Pelaaja1.MaxVelocity = 200; 155 Pelaaja1.Restitution = 0.0; 156 157 } 158 159 void LuoPelaaja2(Vector paikka, double leveys, double korkeus) 160 { 161 PhysicsObject Pelaaja2 = new PhysicsObject(leveys, korkeus); 162 Pelaaja2.Position = paikka; 163 Pelaaja2.Image = LoadImage("Player"); 164 Pelaaja2.Image.ReplaceColor(Color.White, PelaajanVari); 165 Add(Pelaaja2); 166 167 ControllerTwo.Listen(Button.DPadLeft, ButtonState.Down, 168 LiikutaPelaajaa, null, new Vector(-1000, 0), Pelaaja2); 169 ControllerTwo.Listen(Button.DPadRight, ButtonState.Down, 170 LiikutaPelaajaa, null, new Vector(1000, 0), Pelaaja2); 171 ControllerTwo.Listen(Button.DPadUp, ButtonState.Down, 172 LiikutaPelaajaa, null, new Vector(0, 1000), Pelaaja2); 173 ControllerTwo.Listen(Button.DPadDown, ButtonState.Down, 174 LiikutaPelaajaa, null, new Vector(0, -1000), Pelaaja2); 175 176 Pelaaja2.LinearDamping = 0.80; 177 Pelaaja2.MaxVelocity = 200; 178 Pelaaja2.Restitution = 0.0; 179 180 } 181 182 void LuoZombi(Vector paikka, double leveys, double korkeus) 183 { 184 PhysicsObject Zombi = new PhysicsObject(leveys, korkeus); 185 Zombi.Position = paikka; 186 Zombi.Shape = Shape.Rectangle; 187 Zombi.Color = Color.Gray; 188 Add(Zombi); 189 } 190 191 void LiikutaPelaajaa(Vector vektori, PhysicsObject pelaaja) 192 { 193 pelaaja.Push(vektori); 119 194 } 120 195 -
2012/30/JuusoK/Fear_Calls/Fear_Calls/Fear_CallsContent/Fear_CallsContent.contentproj
r3728 r3756 58 58 </Compile> 59 59 </ItemGroup> 60 <ItemGroup> 61 <Compile Include="Kentta1.txt"> 62 <Name>Kentta1</Name> 63 <Importer>TextFileImporter</Importer> 64 <Processor>TextFileContentProcessor</Processor> 65 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 66 </Compile> 67 </ItemGroup> 60 68 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 61 69 <!-- 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.