- Timestamp:
- 2012-06-28 13:21:31 (11 years ago)
- Location:
- 2012/26/TuomasL
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/26/TuomasL/PhysicsManipulator/PhysicsManipulator.sln
r3227 r3310 4 4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhysicsManipulator", "PhysicsManipulator\PhysicsManipulator\PhysicsManipulator.csproj", "{FD8971B9-987E-435A-A5EE-CD2301309951}" 5 5 EndProject 6 Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "PhysicsManipulatorContent", "PhysicsManipulator\PhysicsManipulatorContent\PhysicsManipulatorContent.contentproj", "{5D4EA7BB-3318-49BF-9E07-7D91E8F2A90E}" 6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhysicsManipulatorContent", "PhysicsManipulator\PhysicsManipulatorContent\PhysicsManipulatorContent.contentproj", "{5D4EA7BB-3318-49BF-9E07-7D91E8F2A90E}" 7 EndProject 8 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6E3BCF4C-689C-4667-B0A6-C2CE7CFFA07C}" 7 9 EndProject 8 10 Global … … 22 24 HideSolutionNode = FALSE 23 25 EndGlobalSection 26 GlobalSection(NestedProjects) = preSolution 27 {FD8971B9-987E-435A-A5EE-CD2301309951} = {6E3BCF4C-689C-4667-B0A6-C2CE7CFFA07C} 28 EndGlobalSection 24 29 EndGlobal -
2012/26/TuomasL/PhysicsManipulator/PhysicsManipulator/PhysicsManipulator/PhysicsManipulator.cs
r3293 r3310 8 8 9 9 //Lisätyt aliohjelmat: GetAllObjects, GetShapedObjects, GetObjectsByType, 10 //MakeTransparent, DestroyAll, DestroyShaped, Destroy 10 //MakeTransparent, DestroyAll, DestroyShaped, Destroy, GetButton 11 11 12 12 public class PhysicsManipulator : PhysicsGame { 13 13 14 TileMap map = TileMap.FromLevelAsset("kenttä"); 15 List<Vector> reitti = new List<Vector>(); 16 PhysicsObject pelaaja; 17 14 18 public override void Begin() { 15 19 20 map.SetTileMethod('1', TeeReitti); 21 vihu.Tag = "1"; 22 23 Image img = LoadImage("MainWithButtons"); 24 Image img2 = LoadImage("MainWithOutButtons"); 16 25 26 ImageButtons button = new ImageButtons(); 27 button.GetButton(img, img2, Color.White); 17 28 18 29 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 19 30 Mouse.Listen(MouseButton.Left, ButtonState.Pressed, Hiiren1Painettu, "Painetaan hiiren vasenta nappia"); 20 31 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 32 } 33 34 protected override void Update(Time time) { 35 base.Update(time); 36 37 Liiku(vihu); 21 38 } 22 39 … … 58 75 59 76 } 77 78 void TeeReitti(Vector paikka, double x, double y) { 79 80 for(int i = 0; i < map.ColumnCount; i++) { 81 82 for (int i2 = 0; i2 < map.RowCount; i2++) { 83 84 switch (map.GetTile(i, i2)) { 85 86 case '1': 87 88 reitti.Insert(0, new Vector(i * 100 - 750, (i2 * 100 - 750) * -1)); 89 break; 90 case '2': 91 92 reitti.Insert(1, new Vector(i * 100 - 750, (i2 * 100 - 750) * -1)); 93 break; 94 case '3': 95 96 reitti.Insert(2, new Vector(i * 100 - 750, (i2 * 100 - 750) * -1)); 97 break; 98 case '4': 99 100 reitti.Insert(3, new Vector(i * 100 - 750, (i2 * 100 - 750) * -1)); 101 break; 102 default: 103 break; 104 } 105 } 106 } 107 } 108 109 void Liiku(PhysicsObject obj) { 110 111 if (pelaaja.Position.X > -600 & pelaaja.Position.X < 600 & pelaaja.Position.Y > -600 & pelaaja.Position.Y < 600) { 112 113 114 } else { 115 116 if (obj.Position == reitti[(int)obj.Tag]) { 117 118 if (reitti.Count != (int)obj.Tag) obj.Tag = (int)obj.Tag + 1; 119 else obj.Tag = 0; 120 } 121 122 Vector hit = reitti[(int)obj.Tag]; 123 obj.Hit(hit); 124 } 125 } 60 126 } -
2012/26/TuomasL/PhysicsManipulator/PhysicsManipulator/PhysicsManipulator/PhysicsManipulator.csproj
r3246 r3310 123 123 <ItemGroup> 124 124 <ProjectReference Include="..\PhysicsManipulatorContent\PhysicsManipulatorContent.contentproj"> 125 <Name>PhysicsManipulatorContent </Name>125 <Name>PhysicsManipulatorContent %28Content%29</Name> 126 126 <XnaReferenceType>Content</XnaReferenceType> 127 <Project>{5D4EA7BB-3318-49BF-9E07-7D91E8F2A90E}</Project> 127 128 </ProjectReference> 128 129 </ItemGroup> -
2012/26/TuomasL/PhysicsManipulator/PhysicsManipulator/PhysicsManipulatorContent/PhysicsManipulatorContent.contentproj
r3293 r3310 45 45 </ItemGroup> 46 46 <ItemGroup> 47 <Compile Include="Porkkana.png"> 48 <Name>Porkkana</Name> 47 <Compile Include="MainWithButtons.png"> 48 <Name>MainWithButtons</Name> 49 <Importer>TextureImporter</Importer> 50 <Processor>TextureProcessor</Processor> 51 </Compile> 52 <Compile Include="MainWithOutButtons.png"> 53 <Name>MainWithOutButtons</Name> 54 <Importer>TextureImporter</Importer> 55 <Processor>TextureProcessor</Processor> 56 </Compile> 57 </ItemGroup> 58 <ItemGroup> 59 <Compile Include="GameThumbnail.png"> 60 <Name>GameThumbnail</Name> 49 61 <Importer>TextureImporter</Importer> 50 62 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.