- Timestamp:
- 2014-07-01 11:04:31 (9 years ago)
- Location:
- 2014/27/NoelV/turhakepeli
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/27/NoelV/turhakepeli/turhakepeli/turhakepeli/obj/x86/Debug/ContentPipeline-{8C608BBB-CC9B-467B-9EA1-3FA736E42C66}.xml
r5179 r5210 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\NoelV\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\pelaaja.xnb</Output> 11 <Time>2014-06-30T13:12:12.9045679+03:00</Time> 11 <Time>2014-06-30T14:56:17.0914386+03:00</Time> 12 </Item> 13 <Item> 14 <Source>kentta.png</Source> 15 <Name>kentta</Name> 16 <Importer>TextureImporter</Importer> 17 <Processor>TextureProcessor</Processor> 18 <Options>None</Options> 19 <Output>C:\MyTemp\NoelV\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\kentta.xnb</Output> 20 <Time>2014-07-01T10:25:33.4263453+03:00</Time> 21 </Item> 22 <Item> 23 <Source>valikko.png</Source> 24 <Name>valikko</Name> 25 <Importer>TextureImporter</Importer> 26 <Processor>TextureProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\MyTemp\NoelV\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\valikko.xnb</Output> 29 <Time>2014-07-01T10:54:43.8773729+03:00</Time> 12 30 </Item> 13 31 <BuildSuccessful>true</BuildSuccessful> -
2014/27/NoelV/turhakepeli/turhakepeli/turhakepeli/obj/x86/Debug/cachefile-{8C608BBB-CC9B-467B-9EA1-3FA736E42C66}-targetpath.txt
r5179 r5210 1 1 Content\pelaaja.xnb 2 Content\kentta.xnb 3 Content\valikko.xnb -
2014/27/NoelV/turhakepeli/turhakepeli/turhakepeli/obj/x86/Debug/turhakepeli.csproj.FileListAbsolute.txt
r5179 r5210 8 8 C:\MyTemp\NoelV\turhakepeli\turhakepeli\turhakepeli\obj\x86\Debug\turhakepeli.pdb 9 9 C:\MyTemp\NoelV\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\pelaaja.xnb 10 C:\MyTemp\NoelV\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\kentta.xnb 11 C:\MyTemp\NoelV\turhakepeli\turhakepeli\turhakepeli\bin\x86\Debug\Content\valikko.xnb -
2014/27/NoelV/turhakepeli/turhakepeli/turhakepeli/turhakepeli.cs
r5179 r5210 11 11 PhysicsObject pelaaja; 12 12 Image hahmo = LoadImage("pelaaja"); 13 Image valikonKuva = LoadImage("valikko"); 13 14 14 15 public override void Begin() 15 16 { 16 17 SmoothTextures = false; 18 Level.Background.Color = Color.Brown; 17 19 18 Luo Pelaaja();20 LuoKentta(); 19 21 LisaaOhjaimet(); 20 22 21 //Camera.FollowedObject = pelaaja; 23 24 Camera.Zoom(4); 25 Camera.FollowedObject = pelaaja; 22 26 23 27 PhysicsObject turhake = new PhysicsObject(10, 10); … … 28 32 } 29 33 30 31 void LuoPelaaja()32 {33 pelaaja = new PhysicsObject(100.0, 100.0);34 pelaaja.Image = hahmo;35 Add(pelaaja);36 }37 34 38 35 void LisaaOhjaimet() … … 49 46 Keyboard.Listen(Key.A, ButtonState.Down, Liiku, null, new Vector(-1000, 0)); 50 47 Keyboard.Listen(Key.A, ButtonState.Released, Liiku, null, Vector.Zero); 51 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");48 Keyboard.Listen(Key.Escape, ButtonState.Pressed, KysyPoistumista, "Lopeta peli"); 52 49 } 50 53 51 54 52 void Liiku(Vector vektori) … … 71 69 else pelaaja.Push(vektori); 72 70 } 71 void KysyPoistumista() 72 { 73 IsPaused = true; 74 MultiSelectWindow valikko = new MultiSelectWindow("menu", "back to game", "quit game"); 75 valikko.AddItemHandler(1, Exit); 76 valikko.AddItemHandler(0, delegate { IsPaused = false; }); 77 valikko.Color = Color.Black; 78 valikko.Color = Color.Transparent; 79 valikko.SelectionColor = Color.Black; 80 valikko.Image = valikonKuva; 81 Add(valikko); 82 } 83 84 85 void LuoKentta() 86 { 87 //1. Luetaan kuva uuteen ColorTileMappiin, kuvan nimen perässä ei .png-päätettä. 88 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("kentta"); 89 90 //2. Kerrotaan mitä aliohjelmaa kutsutaan, kun tietyn värinen pikseli tulee vastaan kuvatiedostossa. 91 ruudut.SetTileMethod(Color.Blue, LuoPelaaja); 92 ruudut.SetTileMethod(Color.Black, LuoSeina); 93 94 //3. Execute luo kentän 95 // Parametreina leveys ja korkeus 96 ruudut.Execute(20, 20); 97 } 98 99 100 void LuoPelaaja(Vector paikka, double leveys, double korkeus) 101 { 102 pelaaja = new PhysicsObject(leveys, korkeus); 103 pelaaja.Image = hahmo; 104 pelaaja.Position = paikka; 105 pelaaja.CanRotate = false; 106 pelaaja.Restitution = 0; 107 pelaaja.MaxVelocity = 300; 108 Add(pelaaja); 109 } 110 111 112 void LuoSeina(Vector paikka, double leveys, double korkeus) 113 { 114 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 115 taso.Position = paikka; 116 taso.CollisionIgnoreGroup = 1; 117 Add(taso); 118 } 119 73 120 } -
2014/27/NoelV/turhakepeli/turhakepeli/turhakepeli/turhakepeli.csproj.Debug.cachefile
r5179 r5210 1 1 Content\pelaaja.xnb 2 Content\kentta.xnb 3 Content\valikko.xnb -
2014/27/NoelV/turhakepeli/turhakepeli/turhakepeliContent/turhakepeliContent.contentproj
r5179 r5210 52 52 </Compile> 53 53 </ItemGroup> 54 <ItemGroup> 55 <Compile Include="kentta.png"> 56 <Name>kentta</Name> 57 <Importer>TextureImporter</Importer> 58 <Processor>TextureProcessor</Processor> 59 </Compile> 60 </ItemGroup> 61 <ItemGroup> 62 <Compile Include="valikko.png"> 63 <Name>valikko</Name> 64 <Importer>TextureImporter</Importer> 65 <Processor>TextureProcessor</Processor> 66 </Compile> 67 </ItemGroup> 54 68 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 55 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.