- Timestamp:
- 2015-06-09 15:04:39 (8 years ago)
- Location:
- 2015/24/OttoK/Grand Theft Norsu II
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II.csproj.Debug.cachefile
r5931 r5951 5 5 Content\kaupunkitausta.xnb 6 6 Content\auto1kuva.xnb 7 Content\kursori1.xnb 7 8 Content\kentta1.txt -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/Grand_Theft_Norsu_II.cs
r5931 r5951 11 11 12 12 Image kaupunkitausta = LoadImage("kaupunkitausta"); 13 14 15 16 const double nopeus = 750; 13 14 double nopeus = 750; 17 15 const double hyppyNopeus = 1000; 18 16 const int RUUDUN_KOKO = 42; 19 20 21 17 22 18 PlatformCharacter pelaaja1; … … 25 21 Image tahtiKuva = LoadImage("tahti"); 26 22 Image auto1kuva = LoadImage("auto1kuva"); 23 Image kursorinkuva = LoadImage("kursori1"); 27 24 double hyppykerroin = 1.0; 28 25 29 26 SoundEffect maaliAani = LoadSoundEffect("maali"); 30 27 28 bool Autossa = false; 29 31 30 public override void Begin() 32 31 { 33 //IsFullScreen = true;32 IsFullScreen = false; 34 33 SetWindowSize(1024, 768, true); 35 34 Gravity = new Vector(0, -1000); … … 38 37 Vector paikkaRuudulla = Mouse.PositionOnScreen; 39 38 Vector paikkaKentalla = Mouse.PositionOnWorld; 39 40 40 41 41 LuoKentta(); … … 99 99 { 100 100 pelaaja1.Image = auto1kuva; 101 pelaaja1.Shape = Shape.FromImage(auto1kuva); 102 103 Vector autonPaikka = auto.Position; 101 //pelaaja1.Shape = Shape.FromImage(auto1kuva); 102 103 pelaaja1.Position = auto.Position; 104 pelaaja1.Size = auto.Size; 105 auto.Destroy(); 106 107 Autossa = true; 104 108 105 106 107 108 109 } 109 110 … … 113 114 void LisaaNappaimet() 114 115 { 116 115 117 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 116 118 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); … … 123 125 Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, AsetaHyppykerroin, "Korkeampi hyppy", 1.5); 124 126 Keyboard.Listen(Key.LeftControl, ButtonState.Released, AsetaHyppykerroin, null, 1.0); 125 Mouse.Listen(MouseButton.Left, ButtonState.Pressed, TarkistaHiirenPainallus, "Objektin kohdalla toiminto"); 126 127 //Mouse.Listen(MouseButton.Left, ButtonState.Pressed, TarkistaHiirenPainallus, "Objektin kohdalla toiminto"); 128 Keyboard.Listen(Key.F, ButtonState.Pressed, UlosAutosta, "Mene ulos autosta"); 129 130 Mouse.ListenWheel(ZoomaaKenttaa, ""); 127 131 128 132 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); … … 171 175 Add(auto1); 172 176 177 Mouse.ListenOn(auto1, MouseButton.Left, ButtonState.Pressed, () => MeneAutoon(auto1),"Mene Autoon"); 178 173 179 } 174 180 void AvaaKirjoitusIkkuna() 175 181 { 176 InputWindow kysymysIkkuna = new InputWindow(" ");182 InputWindow kysymysIkkuna = new InputWindow("Kirjoita koodi"); 177 183 kysymysIkkuna.TextEntered += ProcessInput; 178 184 Add(kysymysIkkuna); … … 182 188 { 183 189 string vastaus = ikkuna.InputBox.Text; 184 // tehdään jotain vastauksella 185 } 190 191 if (vastaus == "gravity0") 192 { 193 Gravity = new Vector(0, 0); 194 } 195 else if (vastaus == "gravity1") 196 { 197 Gravity = new Vector(0, -1000); 198 } 199 else if (vastaus == "createcar") 200 { 201 LuoAuto(pelaaja1.Position, 0, 0); 202 } 203 else if (vastaus == "canrotate") 204 { 205 pelaaja1.CanRotate = true; 206 207 } 208 else if (vastaus == "cantrotate") 209 { 210 pelaaja1.CanRotate = false; 211 } 212 else if (vastaus == "superspeed") 213 { 214 nopeus = 1500; 215 PoistaNappaimet(); 216 LisaaNappaimet(); 217 } 218 else if (vastaus == "normalspeed") 219 { 220 nopeus = 750; 221 PoistaNappaimet(); 222 LisaaNappaimet(); 223 } 224 else if (vastaus == "showcodes") 225 { 226 MessageDisplay.Add("gravity0, gravity1, createcar, canrotate, cantrotate, superspeed, normalspeed."); 227 } 228 229 } 230 231 232 233 234 235 236 237 238 239 186 240 void AsetaHyppykerroin(double haluttukerroin) 187 241 { 188 242 hyppykerroin = haluttukerroin; 189 243 } 244 void UlosAutosta() 245 { 246 if (Autossa == true) 247 { 248 249 pelaaja1.Image = pelaajanKuva; 250 pelaaja1.Size = new Vector(RUUDUN_KOKO, RUUDUN_KOKO); 251 LuoAuto(pelaaja1.Position, 0, 0); 252 Autossa = false; 253 } 254 255 } 256 void LuoSlider() 257 { 258 IntMeter zoomausKerroin = new IntMeter(0, 0, 5); 259 //zoomausKerroin.Changed += ZoomaaKenttaa; 260 261 Slider liukusaadin = new Slider(200, 50); 262 liukusaadin.BindTo(zoomausKerroin); 263 liukusaadin.X = Screen.LeftSafe + 200; 264 liukusaadin.Y = Screen.TopSafe - 40; 265 266 liukusaadin.Color = Color.Pink; 267 liukusaadin.Knob.Color = Color.Black; 268 liukusaadin.Track.Color = Color.Blue; 269 liukusaadin.BorderColor = Color.Red; 270 Add(liukusaadin); 271 } 272 273 274 void ZoomaaKenttaa() 275 { 276 double zoomi = Camera.ZoomFactor + Mouse.WheelChange; 277 double maxZoom = 0.1; 278 double maxZoomattu = 3.0; 279 280 281 if (zoomi < maxZoom) 282 { 283 Camera.ZoomFactor = maxZoom; 284 return; 285 } 286 287 if (zoomi > maxZoomattu) 288 { 289 Camera.ZoomFactor = maxZoomattu; 290 return; 291 } 292 293 if (Mouse.WheelChange > maxZoom) 294 { 295 Camera.ZoomFactor += maxZoom; 296 return; 297 } 298 299 if (Mouse.WheelChange < -maxZoom) 300 { 301 Camera.ZoomFactor -= maxZoom; 302 return; 303 } 304 305 Camera.ZoomFactor = zoomi; 306 } 307 void PoistaNappaimet() 308 { 309 Keyboard.Clear(); 310 311 } 190 312 } -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/bin/x86/Debug/Content/kentta1.txt
r5931 r5951 19 19 #..........................................................................................................................# 20 20 #............................................................................###...........................................# 21 #.......................................................... A.............####..............................................#21 #........................................................................####..............................................# 22 22 ############################################################################################################################# -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/obj/x86/Debug/Grand Theft Norsu II.csproj.FileListAbsolute.txt
r5931 r5951 28 28 C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\obj\x86\Debug\Grand Theft Norsu II.pdb 29 29 C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\auto1kuva.xnb 30 C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\kursori1.xnb -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r5931 r5951 5 5 Content\kaupunkitausta.xnb 6 6 Content\auto1kuva.xnb 7 Content\kursori1.xnb 7 8 Content\kentta1.txt -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu IIContent/Grand Theft Norsu IIContent.contentproj
r5931 r5951 82 82 </Compile> 83 83 </ItemGroup> 84 <ItemGroup> 85 <Compile Include="kursori1.png"> 86 <Name>kursori1</Name> 87 <Importer>TextureImporter</Importer> 88 <Processor>TextureProcessor</Processor> 89 </Compile> 90 </ItemGroup> 84 91 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 85 92 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu IIContent/kentta1.txt
r5931 r5951 19 19 #..........................................................................................................................# 20 20 #............................................................................###...........................................# 21 #.......................................................... A.............####..............................................#21 #........................................................................####..............................................# 22 22 ############################################################################################################################# -
2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu IIContent/obj/x86/Debug/ContentPipeline-.xml
r5931 r5951 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\kentta1.xnb</Output> 11 <Time>2015-06-09T1 1:37:03.6540905+03:00</Time>11 <Time>2015-06-09T14:56:36.8658082+03:00</Time> 12 12 </Item> 13 13 <Item> … … 54 54 <Options>None</Options> 55 55 <Output>C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\auto1kuva.xnb</Output> 56 <Time>2015-06-09T10:28:52.7008223+03:00</Time> 56 <Time>2015-06-09T12:48:16.7785516+03:00</Time> 57 </Item> 58 <Item> 59 <Source>kursori1.png</Source> 60 <Name>kursori1</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\kursori1.xnb</Output> 65 <Time>2015-06-09T13:18:40.3480394+03:00</Time> 57 66 </Item> 58 67 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.