Changeset 8083 for 2016/30/TimoH
- Timestamp:
- 2016-07-25 14:43:04 (7 years ago)
- Location:
- 2016/30/TimoH
- Files:
-
- 52 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/30/TimoH/Ponki/Ponki/Ponki/Ponki.cs
r8082 r8083 9 9 public class Ponki : PhysicsGame 10 10 { 11 Image oliokuva = LoadImage("kuva1"); 11 12 12 13 13 Vector nopeus ylos = new Vector(0, 200);14 Vector nopeus alas = new Vector(0, -200);14 Vector nopeusYlos = new Vector(0, 200); 15 Vector nopeusAlas = new Vector(0, -200); 15 16 16 17 PhysicsObject pallo; 17 18 PhysicsObject maila; 18 19 PhysicsObject kapula; 20 21 IntMeter pelaajan1Pisteet; 22 IntMeter pelaajan2Pisteet; 19 23 20 24 21 25 public override void Begin() 22 26 { … … 24 28 asetaohjaimet(); 25 29 aloitapeli(); 30 LisaaLaskurit(); 26 31 32 27 33 28 34 // TODO: Kirjoita ohjelmakoodisi tähän 29 35 30 36 31 37 } 32 38 … … 38 44 pallo.Color = Color.Red; 39 45 pallo.Restitution = 1; 46 pallo.Image = oliokuva; 40 47 41 maila = luo maila(Level.Left + 20, 0);42 kapula = luo maila(Level.Right - 20, 0);48 maila = luoKapulat(Level.Left + 20, 0); 49 kapula = luoKapulat(Level.Right - 20, 0); 43 50 44 51 AddCollisionHandler(pallo, KasittelePallonTormays); 52 53 54 PhysicsObject vasenReuna = Level.CreateLeftBorder(); 55 vasenReuna.Restitution = 10.0; 56 vasenReuna.IsVisible = false; 57 58 PhysicsObject oikeaReuna = Level.CreateRightBorder(); 59 oikeaReuna.Restitution = 10.0; 60 oikeaReuna.KineticFriction = 0.0; 61 oikeaReuna.IsVisible = false; 62 63 PhysicsObject ylaReuna = Level.CreateTopBorder(); 64 ylaReuna.Restitution = 10.0; 65 ylaReuna.KineticFriction = 0.0; 66 ylaReuna.IsVisible = false; 67 68 PhysicsObject alaReuna = Level.CreateBottomBorder(); 69 alaReuna.Restitution = 10.0; 70 alaReuna.IsVisible = false; 71 alaReuna.KineticFriction = 0.0; 45 72 46 73 … … 48 75 49 76 Level.Background.Color = Color.Green; 50 Level.CreateBorders(1, false);77 51 78 52 79 Camera.ZoomToLevel(); … … 54 81 } 55 82 83 void KasittelePallonTormays(PhysicsObject pallo, PhysicsObject kohde) 84 { 85 86 } 87 56 88 void aloitapeli() 57 89 { 58 Vector Intussi = new Vector( 1000, 0);90 Vector Intussi = new Vector(500, 0); 59 91 pallo.Hit(Intussi); 60 92 … … 78 110 void asetaohjaimet() 79 111 { 80 Keyboard.Listen(Key.W, ButtonState.Down, asetanopeus, "pelaaja 1 : Liikuta mailaa ylös", maila, nopeusYlos);81 Keyboard.Listen(Key.W, ButtonState.Released, asetanopeus, null, maila, Vector.Zero);112 Keyboard.Listen(Key.W, ButtonState.Down, AsetaNopeus, "pelaaja 1 : Liikuta mailaa ylös", maila, nopeusYlos); 113 Keyboard.Listen(Key.W, ButtonState.Released, AsetaNopeus, null, maila, Vector.Zero); 82 114 Keyboard.Listen(Key.S, ButtonState.Down, AsetaNopeus, "Pelaaja 1: Liikuta mailaa alas", maila, nopeusAlas); 83 115 Keyboard.Listen(Key.S, ButtonState.Released, AsetaNopeus, null, maila, Vector.Zero); … … 94 126 } 95 127 96 void asetanopeus(PhysicsObject maila, Vector nopeus)128 void AsetaNopeus(PhysicsObject maila, Vector nopeus) 97 129 { 130 if ((nopeus.Y < 0) && (maila.Bottom < Level.Bottom)) 131 { 132 maila.Velocity = Vector.Zero; 133 return; 134 } 135 if ((nopeus.Y > 0) && (maila.Top > Level.Top)) 136 { 137 maila.Velocity = Vector.Zero; 138 return; 139 } 140 98 141 maila.Velocity = nopeus; 142 } 99 143 144 void LisaaLaskurit() 145 { 146 147 pelaajan1Pisteet = LuoPisteLaskuri(Screen.Left + 100.0, Screen.Top - 100.0); 148 pelaajan2Pisteet = LuoPisteLaskuri(Screen.Right - 100.0, Screen.Top - 100.0); 149 } 150 151 IntMeter LuoPisteLaskuri(double x, double y) 152 { 153 IntMeter laskuri = new IntMeter(0); 154 laskuri.MaxValue = 10; 155 return laskuri; 156 157 Label naytto = new Label(); 158 naytto.BindTo(laskuri); 159 naytto.X = x; 160 naytto.Y = y; 161 naytto.TextColor = Color.White; 162 naytto.BorderColor = Level.Background.Color; 163 naytto.Color = Level.Background.Color; 164 Add(naytto); 100 165 } 101 166 } -
2016/30/TimoH/Ponki/Ponki/Ponki/obj/x86/Debug/ContentPipeline-{C8D4B25E-4416-496F-9869-BB2E7E5F486A}.xml
r8082 r8083 2 2 <XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 3 3 <Asset Type="Pipeline:BuildItemCollection"> 4 <Item> 5 <Source>kuva1.png</Source> 6 <Name>kuva1</Name> 7 <Importer>TextureImporter</Importer> 8 <Processor>TextureProcessor</Processor> 9 <Options>None</Options> 10 <Output>C:\MyTemp\TimoH\Ponki\Ponki\Ponki\bin\x86\Debug\Content\kuva1.xnb</Output> 11 <Time>2016-07-25T14:16:12.1626193+03:00</Time> 12 </Item> 4 13 <BuildSuccessful>true</BuildSuccessful> 5 14 <Settings> … … 16 25 <Assemblies> 17 26 <Assembly> 27 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 28 <Value>2015-02-09T20:18:44+02:00</Value> 29 </Assembly> 30 <Assembly> 31 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</Key> 32 <Value>2011-09-01T16:22:30+03:00</Value> 33 </Assembly> 34 <Assembly> 35 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</Key> 36 <Value>2011-09-01T16:22:30+03:00</Value> 37 </Assembly> 38 <Assembly> 39 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</Key> 40 <Value>2011-09-01T16:22:30+03:00</Value> 41 </Assembly> 42 <Assembly> 43 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</Key> 44 <Value>2011-09-01T16:22:30+03:00</Value> 45 </Assembly> 46 <Assembly> 47 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</Key> 48 <Value>2011-09-01T16:22:30+03:00</Value> 49 </Assembly> 50 <Assembly> 51 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</Key> 52 <Value>2011-09-01T16:22:30+03:00</Value> 53 </Assembly> 54 <Assembly> 55 <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 56 <Value>2015-02-17T22:27:18+02:00</Value> 57 </Assembly> 58 <Assembly> 18 59 <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 19 60 <Value>2015-09-16T19:26:07.6285999+03:00</Value> -
2016/30/TimoH/Ponki/Ponki/Ponki/obj/x86/Debug/Ponki.csproj.FileListAbsolute.txt
r8082 r8083 7 7 C:\MyTemp\TimoH\Ponki\Ponki\Ponki\obj\x86\Debug\Ponki.exe 8 8 C:\MyTemp\TimoH\Ponki\Ponki\Ponki\obj\x86\Debug\Ponki.pdb 9 C:\MyTemp\TimoH\Ponki\Ponki\Ponki\bin\x86\Debug\Content\kuva1.xnb -
2016/30/TimoH/Ponki/Ponki/PonkiContent/PonkiContent.contentproj
r8082 r8083 45 45 <Reference Include="AnimationExtension" /> 46 46 </ItemGroup> 47 <ItemGroup> 48 <Compile Include="kuva1.png"> 49 <Name>kuva1</Name> 50 <Importer>TextureImporter</Importer> 51 <Processor>TextureProcessor</Processor> 52 </Compile> 53 </ItemGroup> 47 54 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 48 55 <!-- 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.