- Timestamp:
- 2015-06-10 11:33:35 (7 years ago)
- Location:
- 2015/24/TuroR/Omapeli
- Files:
-
- 9 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/24/TuroR/Omapeli/Omapeli/Omapeli/Omapeli.cs
r5962 r5980 9 9 public class Omapeli : PhysicsGame 10 10 { 11 Image taustaKuva = LoadImage(""); 12 13 Image ukkoAmpuu = LoadImage("ukko ampuu2"); 14 11 15 IntMeter pisteLaskuri; 16 IntMeter ammusLaskuri; 12 17 13 18 Image panoksenKuva = LoadImage("panos"); 14 19 15 Image[] pallonKuvat = LoadImages("apina", "UUS APINA", "sukkamato", "silma", "kännykkä", "Cannon" );20 Image[] pallonKuvat = LoadImages("apina", "UUS APINA", "sukkamato", "silma", "kännykkä", "Cannon", "possu", "tamm", "putin"); 16 21 17 22 AssaultRifle pelaajan1Ase; … … 19 24 Image ukonKuva = LoadImage("ukko"); 20 25 26 27 21 28 public override void Begin() 22 29 { 30 31 23 32 LuoUusiApina(); 24 33 … … 41 50 Add(alaReuna); 42 51 52 53 43 54 PlatformCharacter2 ukko = new PlatformCharacter2(50, 50); 44 55 ukko.Shape = Shape.Circle; … … 47 58 Add(ukko); 48 59 ukko.Image = ukonKuva; 60 //ukko.Animation = new Animation(ukkoAmpuu); 49 61 50 62 pelaajan1Ase = new AssaultRifle(30, 10); … … 52 64 pelaajan1Ase.Y = -12; 53 65 54 pelaajan1Ase.Ammo.Value = 100 0;66 pelaajan1Ase.Ammo.Value = 100; 55 67 pelaajan1Ase.ProjectileCollision = AmmusOsui; 56 68 ukko.Add(pelaajan1Ase); 57 69 58 70 LuoPistelaskuri(); 71 LuoAmmusLaskuri(); 59 72 60 73 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 61 74 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 62 Mouse.Listen(MouseButton.Left, ButtonState.Down, AmmuAseella, "Ammu", pelaajan1Ase); 75 Mouse.Listen(MouseButton.Left, ButtonState.Down, AmmuAseella, "Ammu",ukko, pelaajan1Ase); 76 Mouse.Listen(MouseButton.Left, ButtonState.Released, AmpumisenLopetus, null, ukko); 63 77 Keyboard.Listen(Key.W, ButtonState.Down, Hyppääukolla, "Hyppää", ukko); 64 78 Keyboard.Listen(Key.A, ButtonState.Down, Liiku, "Liiku", ukko, Direction.Left); … … 86 100 } 87 101 88 void AmmuAseella( AssaultRifle ase)102 void AmmuAseella(PlatformCharacter2 ukko, AssaultRifle ase) 89 103 { 90 104 PhysicsObject ammus = ase.Shoot(); … … 92 106 if (ammus != null) 93 107 { 108 ammusLaskuri.Value += 1; 94 109 ammus.Image = panoksenKuva; 95 110 ammus.Velocity = ammus.AbsoluteAngle.GetVector()*3000; 111 ukko.Image = ukkoAmpuu; 96 112 } 97 113 } 114 115 void AmpumisenLopetus(PlatformCharacter2 ukko) 116 { 117 ukko.Image = ukonKuva; 118 } 119 98 120 99 121 void Hyppääukolla(PlatformCharacter2 ukko) … … 116 138 void LuoUusiApina() 117 139 { 118 PhysicsObject apina = new PhysicsObject( 50, 50);140 PhysicsObject apina = new PhysicsObject(60, 60); 119 141 apina.Shape = Shape.Circle; 120 142 apina.IgnoresGravity = true; … … 142 164 Add(pisteNaytto); 143 165 } 166 167 void LuoAmmusLaskuri() 168 { 169 ammusLaskuri = new IntMeter(0); 170 171 Label ammusNaytto = new Label(); 172 ammusNaytto.X = Screen.Right - 100; 173 ammusNaytto.Y = Screen.Top - 100; 174 ammusNaytto.TextColor = Color.Black; 175 ammusNaytto.Color = Color.White; 176 177 ammusNaytto.BindTo(ammusLaskuri); 178 Add(ammusNaytto); 179 } 144 180 } -
2015/24/TuroR/Omapeli/Omapeli/Omapeli/Omapeli.csproj.Debug.cachefile
r5962 r5980 7 7 Content\silma.xnb 8 8 Content\kÀnnykkÀ.xnb 9 Content\possu.xnb 10 Content\ukko ampuu2.xnb 11 Content\Tamm.xnb 12 Content\putin.xnb -
2015/24/TuroR/Omapeli/Omapeli/Omapeli/obj/x86/Debug/ContentPipeline-{595E6F62-26BF-42FB-ABC6-C9280882E6ED}.xml
r5962 r5980 74 74 <Time>2015-06-09T14:21:53.6725679+03:00</Time> 75 75 </Item> 76 <Item> 77 <Source>possu.png</Source> 78 <Name>possu</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\possu.xnb</Output> 83 <Time>2015-06-10T09:15:02.9086286+03:00</Time> 84 </Item> 85 <Item> 86 <Source>ukko ampuu2.png</Source> 87 <Name>ukko ampuu2</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\ukko ampuu2.xnb</Output> 92 <Time>2015-06-10T09:49:07.1646528+03:00</Time> 93 </Item> 94 <Item> 95 <Source>Tamm.png</Source> 96 <Name>Tamm</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\Tamm.xnb</Output> 101 <Time>2015-06-10T10:44:31.7111348+03:00</Time> 102 </Item> 103 <Item> 104 <Source>putin.png</Source> 105 <Name>putin</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\putin.xnb</Output> 110 <Time>2015-06-10T11:22:27.9375718+03:00</Time> 111 </Item> 76 112 <BuildSuccessful>true</BuildSuccessful> 77 113 <Settings> -
2015/24/TuroR/Omapeli/Omapeli/Omapeli/obj/x86/Debug/Omapeli.csproj.FileListAbsolute.txt
r5962 r5980 25 25 C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\silma.xnb 26 26 C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\kÀnnykkÀ.xnb 27 C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\possu.xnb 28 C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\ukko ampuu2.xnb 29 C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\Tamm.xnb 30 C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\putin.xnb -
2015/24/TuroR/Omapeli/Omapeli/Omapeli/obj/x86/Debug/cachefile-{595E6F62-26BF-42FB-ABC6-C9280882E6ED}-targetpath.txt
r5962 r5980 7 7 Content\silma.xnb 8 8 Content\kÀnnykkÀ.xnb 9 Content\possu.xnb 10 Content\ukko ampuu2.xnb 11 Content\Tamm.xnb 12 Content\putin.xnb -
2015/24/TuroR/Omapeli/Omapeli/OmapeliContent/OmapeliContent.contentproj
r5962 r5980 101 101 </Compile> 102 102 </ItemGroup> 103 <ItemGroup> 104 <Compile Include="possu.png"> 105 <Name>possu</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 </Compile> 109 </ItemGroup> 110 <ItemGroup> 111 <Compile Include="ukko ampuu2.png"> 112 <Name>ukko ampuu2</Name> 113 <Importer>TextureImporter</Importer> 114 <Processor>TextureProcessor</Processor> 115 </Compile> 116 </ItemGroup> 117 <ItemGroup> 118 <Compile Include="Tamm.png"> 119 <Name>Tamm</Name> 120 <Importer>TextureImporter</Importer> 121 <Processor>TextureProcessor</Processor> 122 </Compile> 123 </ItemGroup> 124 <ItemGroup> 125 <Compile Include="putin.png"> 126 <Name>putin</Name> 127 <Importer>TextureImporter</Importer> 128 <Processor>TextureProcessor</Processor> 129 </Compile> 130 </ItemGroup> 103 131 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 104 132 <!-- 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.