- Timestamp:
- 2012-07-04 14:43:05 (11 years ago)
- Location:
- 2012/27/JuhoK/Impossible
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/27/JuhoK/Impossible/Impossible/Impossible/Impossible.cs
r3537 r3541 9 9 public class Impossible : PhysicsGame 10 10 { 11 double moveSpeed = 1 000;11 double moveSpeed = 1600; 12 12 bool allowMove = false; 13 13 int kenttaNro = 1; … … 17 17 18 18 Image palikanKuva = LoadImage("palikka"); 19 Image piikinKuva = LoadImage("piikki"); 20 21 Vector currPos; 22 Vector prevPos; 19 23 20 24 public override void Begin() … … 38 42 39 43 if (allowMove == true) { 40 move(); 44 move(); 45 if (prevPos == currPos && cube.Position == currPos) 46 { 47 allowMove = false; 48 createExplosion(cube.Position); 49 cube.Destroy(); 50 } 51 else 52 { 53 prevPos = currPos; 54 currPos = cube.Position; 55 } 41 56 } 42 57 } … … 50 65 51 66 Keyboard.Listen(Key.Space, ButtonState.Down, jump, null); 67 Keyboard.Listen(Key.Enter, ButtonState.Pressed, startGame, null); 52 68 53 69 Gravity = new Vector(0, -7500); … … 66 82 ruudut.SetTileMethod('P', LuoPelaaja); 67 83 ruudut.SetTileMethod('M', LuoMaali); 84 ruudut.SetTileMethod('L', LuoPiikki); 68 85 ruudut.Execute(100, 100); 69 86 } … … 78 95 Add(palikka); 79 96 } 97 98 void LuoPiikki(Vector paikka, double leveys, double korkeus) 99 { 100 PhysicsObject Piikki = PhysicsObject.CreateStaticObject(leveys, korkeus); 101 Piikki.Position = paikka; 102 Piikki.Image = piikinKuva; 103 Piikki.Shape = Shape.Triangle; 104 Piikki.Color = Color.Pink; 105 Add(Piikki); 106 } 80 107 81 108 void LuoPelaaja(Vector paikka, double leveys, double korkeus) … … 85 112 cube.Position = paikka; 86 113 cube.CanRotate = false; 114 cube.Y += 1; 87 115 Add(cube); 88 116 allowMove = true; … … 119 147 Explosion explosion = new Explosion(100); 120 148 explosion.Position = position; 149 explosion.Size = new Vector(50, 50); 150 explosion.Speed = 1; 121 151 Add(explosion); 122 152 } -
2012/27/JuhoK/Impossible/Impossible/Impossible/Impossible.csproj.Debug.cachefile
r3537 r3541 2 2 Content\kentta1.xnb 3 3 Content\palikka.xnb 4 Content\piikki.xnb 4 5 Content\Backround.png 6 Content\piikki.png -
2012/27/JuhoK/Impossible/Impossible/ImpossibleContent/ImpossibleContent.contentproj
r3537 r3541 66 66 </Compile> 67 67 </ItemGroup> 68 <ItemGroup> 69 <Compile Include="piikki.png"> 70 <Name>piikki</Name> 71 <Importer>TextureImporter</Importer> 72 <Processor>TextureProcessor</Processor> 73 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 74 </Compile> 75 </ItemGroup> 68 76 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 69 77 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2012/27/JuhoK/Impossible/Impossible/ImpossibleContent/kentta1.txt
r3537 r3541 18 18 19 19 20 21 22 23 24 25 P 20 ===L 21 === L 22 === L 23 === 24 === 25 P === M 26 26 ==============================================================================================================
Note: See TracChangeset
for help on using the changeset viewer.