- Timestamp:
- 2010-08-05 07:52:04 (13 years ago)
- Location:
- 2010/23/hniemi/Matopeli
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/hniemi/Matopeli/Content/Content.contentproj
r1564 r1614 1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 2 2 <PropertyGroup> 3 3 <ProjectGuid>c1880545-8a98-46cd-a250-6300a283f9f2</ProjectGuid> … … 34 34 <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> 35 35 </ItemGroup> 36 <ItemGroup> 37 <Compile Include="speed.png"> 38 <Name>speed</Name> 39 <Importer>TextureImporter</Importer> 40 <Processor>TextureProcessor</Processor> 41 </Compile> 42 </ItemGroup> 36 43 </Project> -
2010/23/hniemi/Matopeli/Peli.cs
r1612 r1614 22 22 Timer liikutusajastin; 23 23 Timer kerattavienLisaysAjastin; 24 IntMeter pistelaskuri; 25 26 Image nopeusKuva = LoadImage("speed"); 24 27 25 28 protected override void Begin() … … 29 32 LuoMato(madonPituus); 30 33 LisaaOhjaimet(); 34 LisaaPistelaskuri(); 31 35 AloitaPeli(); 32 36 } … … 34 38 void LuoKentta() 35 39 { 40 Level.BackgroundColor = new Color(50, 50, 50); 36 41 Level.Height = 500; 37 42 Level.Width = 500; … … 39 44 ruutujaPystysuunnassa = (int)Math.Floor(Level.Height / ruudunKoko); 40 45 ruutujaVaakasuunnassa = (int)Math.Floor(Level.Width / ruudunKoko); 46 Camera.ZoomToLevel(); 47 Camera.ZoomFactor /= 1.5; 41 48 } 42 49 … … 69 76 Keyboard.Listen(Key.Right, ButtonState.Pressed, AsetaSuunta, "Kääntää oikealle", Direction.Right); 70 77 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistuu pelistä"); 78 } 79 80 void LisaaPistelaskuri() 81 { 82 pistelaskuri = new IntMeter(0); 83 Label pisteteksti = new Label("Pisteesi"); 84 pisteteksti.Position = new Vector(0, Screen.Top - 45); 85 pisteteksti.Color = Color.White; 86 Add(pisteteksti); 87 88 Label pistenaytto = new Label(); 89 pistenaytto.Position = new Vector(0, Screen.Top - 80); 90 pistenaytto.Color = Color.Magenta; 91 pistenaytto.BindTo(pistelaskuri); 92 Add(pistenaytto); 71 93 } 72 94 … … 111 133 } 112 134 113 if (seuraavanRuudunOlio.Tag.ToString() == "kerattava")135 if (seuraavanRuudunOlio.Tag.ToString().Contains("kerattava")) // Siltä varalta Contains-metodi, että tagissa joutuu jatkossa viemään jotain muutakin 114 136 { 115 137 seuraavanRuudunOlio.Destroy(); 116 138 kerattavat.Remove(seuraavanRuudunOlio); 117 madonPituus++;139 pistelaskuri.Value++; 118 140 LisaaPalaMatoon(); 119 141 }
Note: See TracChangeset
for help on using the changeset viewer.