Changeset 3541 for 2012


Ignore:
Timestamp:
2012-07-04 14:43:05 (11 years ago)
Author:
jumakall
Message:
 
Location:
2012/27/JuhoK/Impossible
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • 2012/27/JuhoK/Impossible/Impossible/Impossible/Impossible.cs

    r3537 r3541  
    99public class Impossible : PhysicsGame 
    1010{ 
    11     double moveSpeed = 1000; 
     11    double moveSpeed = 1600; 
    1212    bool allowMove = false; 
    1313    int kenttaNro = 1; 
     
    1717 
    1818    Image palikanKuva = LoadImage("palikka"); 
     19    Image piikinKuva = LoadImage("piikki"); 
     20 
     21    Vector currPos; 
     22    Vector prevPos; 
    1923 
    2024    public override void Begin() 
     
    3842 
    3943        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            } 
    4156        } 
    4257    } 
     
    5065 
    5166        Keyboard.Listen(Key.Space, ButtonState.Down, jump, null); 
     67        Keyboard.Listen(Key.Enter, ButtonState.Pressed, startGame, null); 
    5268 
    5369        Gravity = new Vector(0, -7500); 
     
    6682        ruudut.SetTileMethod('P', LuoPelaaja); 
    6783        ruudut.SetTileMethod('M', LuoMaali); 
     84        ruudut.SetTileMethod('L', LuoPiikki); 
    6885        ruudut.Execute(100, 100); 
    6986    } 
     
    7895        Add(palikka); 
    7996    } 
     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    } 
    80107 
    81108    void LuoPelaaja(Vector paikka, double leveys, double korkeus) 
     
    85112        cube.Position = paikka; 
    86113        cube.CanRotate = false; 
     114        cube.Y += 1; 
    87115        Add(cube); 
    88116        allowMove = true; 
     
    119147        Explosion explosion = new Explosion(100); 
    120148        explosion.Position = position; 
     149        explosion.Size = new Vector(50, 50); 
     150        explosion.Speed = 1; 
    121151        Add(explosion); 
    122152    } 
  • 2012/27/JuhoK/Impossible/Impossible/Impossible/Impossible.csproj.Debug.cachefile

    r3537 r3541  
    22Content\kentta1.xnb 
    33Content\palikka.xnb 
     4Content\piikki.xnb 
    45Content\Backround.png 
     6Content\piikki.png 
  • 2012/27/JuhoK/Impossible/Impossible/ImpossibleContent/ImpossibleContent.contentproj

    r3537 r3541  
    6666    </Compile> 
    6767  </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> 
    6876  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    6977  <!--  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  
    1818 
    1919 
    20  
    21  
    22  
    23  
    24  
    25 P                                                                                                            M 
     20                        ===L 
     21                     ===    L 
     22                  ===        L 
     23               === 
     24            === 
     25P        ===                                                                                                 M 
    2626============================================================================================================== 
Note: See TracChangeset for help on using the changeset viewer.