Changeset 6143
- Timestamp:
- 2015-06-22 14:58:04 (8 years ago)
- Location:
- 2015/26/RonjaT/Pong
- Files:
-
- 2 added
- 2 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/RonjaT/Pong/Pong.sln
r6128 r6143 1 1 2 Microsoft Visual Studio Solution File, Format Version 1 1.003 # Visual Studio 201 04 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pong", "Pong\Pong\Pong.csproj", "{ 64721317-74D9-433C-8E15-C2194596B5C5}"2 Microsoft Visual Studio Solution File, Format Version 12.00 3 # Visual Studio 2012 4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pong", "Pong\Pong\Pong.csproj", "{CFC179FD-7820-4145-92E8-06442FEA502A}" 5 5 EndProject 6 Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "PongContent", "Pong\PongContent\PongContent.contentproj", "{ F0F7A32F-A56F-4A50-BACF-8F9BF9E37CDF}"6 Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "PongContent", "Pong\PongContent\PongContent.contentproj", "{B6340662-2EB8-4955-AED5-54EC1B1666FF}" 7 7 EndProject 8 8 Global … … 12 12 EndGlobalSection 13 13 GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 { 64721317-74D9-433C-8E15-C2194596B5C5}.Debug|x86.ActiveCfg = Debug|x8615 { 64721317-74D9-433C-8E15-C2194596B5C5}.Debug|x86.Build.0 = Debug|x8616 { 64721317-74D9-433C-8E15-C2194596B5C5}.Release|x86.ActiveCfg = Release|x8617 { 64721317-74D9-433C-8E15-C2194596B5C5}.Release|x86.Build.0 = Release|x8618 { F0F7A32F-A56F-4A50-BACF-8F9BF9E37CDF}.Debug|x86.ActiveCfg = Debug|x8619 { F0F7A32F-A56F-4A50-BACF-8F9BF9E37CDF}.Release|x86.ActiveCfg = Release|x8614 {CFC179FD-7820-4145-92E8-06442FEA502A}.Debug|x86.ActiveCfg = Debug|x86 15 {CFC179FD-7820-4145-92E8-06442FEA502A}.Debug|x86.Build.0 = Debug|x86 16 {CFC179FD-7820-4145-92E8-06442FEA502A}.Release|x86.ActiveCfg = Release|x86 17 {CFC179FD-7820-4145-92E8-06442FEA502A}.Release|x86.Build.0 = Release|x86 18 {B6340662-2EB8-4955-AED5-54EC1B1666FF}.Debug|x86.ActiveCfg = Debug|x86 19 {B6340662-2EB8-4955-AED5-54EC1B1666FF}.Release|x86.ActiveCfg = Release|x86 20 20 EndGlobalSection 21 21 GlobalSection(SolutionProperties) = preSolution -
2015/26/RonjaT/Pong/Pong/Pong/Pong.cs
r6128 r6143 9 9 public class Pong : PhysicsGame 10 10 { 11 11 Vector nopeusYlös = new Vector(0, 200); 12 Vector nopeusAlas = new Vector(0, -200); 13 Vector nopeusPysähdyksissä = new Vector(0, 0); 14 12 15 PhysicsObject pallo; 16 17 PhysicsObject maila1; 18 PhysicsObject maila2; 13 19 public override void Begin() 14 20 { 15 21 LuoKentta(); 16 17 Vector impulssi = new Vector(500.0, 0.0); 18 pallo.Hit(impulssi); 19 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 22 AsetaOhjaimet(); 23 AloitaPeli(); 20 24 21 25 } … … 30 34 Add(pallo); 31 35 36 maila1 = LuoMaila(Level.Left + 20.0, 0.0); 37 maila2 = LuoMaila(Level.Right - 20.0, 0.0); 38 39 32 40 Level.CreateBorders(1.0, false); 33 41 Level.Background.Color = Color.Black; … … 35 43 } 36 44 45 void AloitaPeli() 46 { 47 Vector impulssi = new Vector(500.0, 0.0); 48 pallo.Hit(impulssi); 49 } 50 51 52 53 PhysicsObject LuoMaila(double x, double y) 54 { 55 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 56 maila.Shape = Shape.Rectangle; 57 maila.X = x; 58 maila.Y = y; 59 maila.Restitution = 1.0; 60 Add(maila); 61 return maila; 62 } 63 64 void AsetaOhjaimet() 65 { 66 Keyboard.Listen(Key.A, ButtonState.Down, AsetaNopeus, "Pelaaja 1: Liikuta mailaa ylös",maila1,nopeusYlös ); 67 Keyboard.Listen(Key.A, ButtonState.Released, AsetaNopeus, null, maila1, nopeusPysähdyksissä); 68 69 70 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 71 Keyboard.Listen(Key.F1, ButtonState. 72 } 73 74 75 void AsetaNopeus(PhysicsObject maila, Vector nopeus) 76 { 77 maila.Velocity = nopeus; 78 } 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 37 146 } -
2015/26/RonjaT/Pong/Pong/Pong/Pong.csproj
r6128 r6143 2 2 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 3 3 <PropertyGroup> 4 <ProjectGuid>{ 64721317-74D9-433C-8E15-C2194596B5C5}</ProjectGuid>4 <ProjectGuid>{CFC179FD-7820-4145-92E8-06442FEA502A}</ProjectGuid> 5 5 <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> 6 6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> … … 15 15 <XnaPlatform>Windows</XnaPlatform> 16 16 <XnaProfile>Reach</XnaProfile> 17 <XnaCrossPlatformGroupID> 73c37857-4cb2-47ed-9e6b-3ba7df90e116</XnaCrossPlatformGroupID>17 <XnaCrossPlatformGroupID>4b32c1ef-8c2d-42b8-8b58-e44e26801e91</XnaCrossPlatformGroupID> 18 18 <XnaOutputType>Game</XnaOutputType> 19 19 <ApplicationIcon>Game.ico</ApplicationIcon> -
2015/26/RonjaT/Pong/Pong/Pong/Properties/AssemblyInfo.cs
r6128 r6143 23 23 // project is exposed to COM. On other platforms, it unique identifies the 24 24 // title storage container when deploying this assembly to the device. 25 [assembly: Guid(" 388dfb0e-b250-4286-958b-32fe04b8363e")]25 [assembly: Guid("40fe92f0-5fdf-4836-b601-ac1ad8d3e770")] 26 26 27 27 // Version information for an assembly consists of the following four values: -
2015/26/RonjaT/Pong/Pong/PongContent/PongContent.contentproj
r6128 r6143 2 2 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 3 3 <PropertyGroup> 4 <ProjectGuid>{ F0F7A32F-A56F-4A50-BACF-8F9BF9E37CDF}</ProjectGuid>4 <ProjectGuid>{B6340662-2EB8-4955-AED5-54EC1B1666FF}</ProjectGuid> 5 5 <ProjectTypeGuids>{96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> 6 6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Note: See TracChangeset
for help on using the changeset viewer.