Changeset 1093
- Timestamp:
- 2010-07-06 14:53:06 (13 years ago)
- Location:
- 2010/27/juliuski/pong
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/juliuski/pong/Content/Content.contentproj
r1063 r1093 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>f9c780b3-7d12-46e1-a31f-6304b90aa913</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="Pong.PNG"> 38 <Name>Pong</Name> 39 <Importer>TextureImporter</Importer> 40 <Processor>TextureProcessor</Processor> 41 </Compile> 42 </ItemGroup> 36 43 </Project> -
2010/27/juliuski/pong/Ohjelma.cs
r1063 r1093 8 8 { 9 9 #if !DEBUG 10 game.IsFullScreen = true; 10 SetWindowSize( 600,600,false); 11 12 11 13 #endif 12 14 game.Run(); 13 15 } 16 14 17 } 18 19 20 15 21 } 16 22 -
2010/27/juliuski/pong/Peli.cs
r1063 r1093 6 6 public class Peli : PhysicsGame 7 7 { 8 Vector nopeusYlos = new Vector(0, 200);9 Vector nopeusAlas = new Vector(0, - 200);10 8 Vector nopeusYlos = new Vector(0, 700); 9 Vector nopeusAlas = new Vector(0, -700); 10 PhysicsObject pallo2; 11 11 PhysicsObject pallo; 12 12 PhysicsObject maila1; … … 25 25 protected override void Begin() 26 26 { 27 27 28 luokentta(); 28 29 AsetaOhjaimet(); 29 30 aloitapeli(); 30 31 LisaaLaskurit(); 32 31 33 32 34 … … 37 39 void luokentta() 38 40 { 39 pallo = new PhysicsObject(40.0, 40.0); 41 42 pallo = new PhysicsObject(20.0, 20.0); 40 43 Add(pallo); 41 pallo.Shape = Shapes. Triangle;42 pallo.Color = Color. Pink;44 pallo.Shape = Shapes.Rectangle; 45 pallo.Color = Color.White; 43 46 pallo.X = -200.0; 44 47 pallo.Y = 0.0; 45 pallo.Restitution = 1.1; 46 Level.BackgroundColor = Color.Green; 48 pallo.Restitution = 1; 49 pallo2 = new PhysicsObject(20.0, 20.0); 50 Add(pallo2); 51 pallo2.Shape = Shapes.Rectangle; 52 pallo2.Color = Color.White; 53 pallo2.X = -220.0; 54 pallo2.Y = 0.0; 55 pallo2.Restitution = 1; 56 57 Level.BackgroundColor = Color.Black; 47 58 Camera.ZoomToLevel(); 48 59 vasenReuna = Level.CreateLeftBorder(); 49 vasenReuna.Restitution = 1 .0;60 vasenReuna.Restitution = 1; 50 61 vasenReuna.IsVisible = false; 51 62 oikeaReuna = Level.CreateRightBorder(); 52 oikeaReuna.Restitution = 1 .0;63 oikeaReuna.Restitution = 1; 53 64 oikeaReuna.IsVisible = false; 54 65 alaReuna = Level.CreateBottomBorder(); 55 alaReuna.Restitution = 1 .0;66 alaReuna.Restitution = 1; 56 67 alaReuna.IsVisible = false; 57 68 ylaReuna = Level.CreateTopBorder(); 58 ylaReuna.Restitution = 1 .0;69 ylaReuna.Restitution = 1; 59 70 ylaReuna.IsVisible = false; 60 71 maila1 = LuoMaila(Level.Left + 20.0, 0.0); 61 72 maila2 = LuoMaila(Level.Right - 20.0, 0.0); 62 73 AddCollisionHandler(pallo, KasittelePallonTormays); 63 74 AddCollisionHandler(pallo2, KasittelePallonTormays); 64 75 65 76 } … … 69 80 pallo.Hit(impulssi); 70 81 82 pallo2.Hit(impulssi); 71 83 72 84 … … 75 87 { 76 88 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 77 maila.Shape = Shapes.Circle; 89 maila.Shape = Shapes.Rectangle; 90 78 91 maila.X = x; 79 92 maila.Y = y; 80 maila.Restitution = 1.0 01;93 maila.Restitution = 1.0; 81 94 Add(maila); 82 95 … … 95 108 Keyboard.Listen(Key.Down, ButtonState.Down, AsetaNopeus, "Pelaaja 2: Liikuta mailaa alas", maila2, nopeusAlas); 96 109 Keyboard.Listen(Key.Down, ButtonState.Released, AsetaNopeus, null, maila2, Vector.Zero); 97 110 98 111 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 99 112 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu"); … … 132 145 { 133 146 IntMeter laskuri = new IntMeter(0); 134 laskuri.MaxValue = 10;147 laskuri.MaxValue = 9; 135 148 Label naytto = new Label(); 136 149 naytto.BindTo(laskuri); … … 144 157 145 158 146 void KasittelePallonTormays(PhysicsObject pallo, PhysicsObject kohde)159 void KasittelePallonTormays(PhysicsObject erkki, PhysicsObject kohde) 147 160 { 148 161 if (kohde == oikeaReuna) … … 155 168 } 156 169 } 157 158 159 170 } 160 -
2010/27/juliuski/pong/pong.csproj
r1063 r1093 89 89 <Content Include="Game.ico" /> 90 90 <Content Include="GameThumbnail.png" /> 91 <Content Include="Pong.ico" /> 92 <Content Include="Pong.PNG" /> 91 93 </ItemGroup> 92 94 <ItemGroup> -
2010/27/juliuski/pong/pong.sln
r1063 r1093 6 6 Global 7 7 GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 Debug|Mixed Platforms = Debug|Mixed Platforms 8 9 Debug|x86 = Debug|x86 10 Debug|Xbox 360 = Debug|Xbox 360 11 Release|Mixed Platforms = Release|Mixed Platforms 9 12 Release|x86 = Release|x86 13 Release|Xbox 360 = Release|Xbox 360 10 14 EndGlobalSection 11 15 GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 {B4190151-FC24-49BF-9FDE-91A528B40C64}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 17 {B4190151-FC24-49BF-9FDE-91A528B40C64}.Debug|Mixed Platforms.Build.0 = Debug|x86 12 18 {B4190151-FC24-49BF-9FDE-91A528B40C64}.Debug|x86.ActiveCfg = Debug|x86 13 19 {B4190151-FC24-49BF-9FDE-91A528B40C64}.Debug|x86.Build.0 = Debug|x86 20 {B4190151-FC24-49BF-9FDE-91A528B40C64}.Debug|Xbox 360.ActiveCfg = Debug|x86 21 {B4190151-FC24-49BF-9FDE-91A528B40C64}.Release|Mixed Platforms.ActiveCfg = Release|x86 22 {B4190151-FC24-49BF-9FDE-91A528B40C64}.Release|Mixed Platforms.Build.0 = Release|x86 14 23 {B4190151-FC24-49BF-9FDE-91A528B40C64}.Release|x86.ActiveCfg = Release|x86 15 24 {B4190151-FC24-49BF-9FDE-91A528B40C64}.Release|x86.Build.0 = Release|x86 25 {B4190151-FC24-49BF-9FDE-91A528B40C64}.Release|Xbox 360.ActiveCfg = Release|x86 26 {F9C780B3-7D12-46E1-A31F-6304B90AA913}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 16 27 {F9C780B3-7D12-46E1-A31F-6304B90AA913}.Debug|x86.ActiveCfg = Debug|x86 28 {F9C780B3-7D12-46E1-A31F-6304B90AA913}.Debug|Xbox 360.ActiveCfg = Debug|x86 29 {F9C780B3-7D12-46E1-A31F-6304B90AA913}.Release|Mixed Platforms.ActiveCfg = Release|x86 17 30 {F9C780B3-7D12-46E1-A31F-6304B90AA913}.Release|x86.ActiveCfg = Release|x86 31 {F9C780B3-7D12-46E1-A31F-6304B90AA913}.Release|Xbox 360.ActiveCfg = Release|x86 18 32 EndGlobalSection 19 33 GlobalSection(SolutionProperties) = preSolution
Note: See TracChangeset
for help on using the changeset viewer.