Changeset 7340


Ignore:
Timestamp:
2016-06-15 14:57:44 (3 years ago)
Author:
karkaite
Message:
 
Location:
2016/24/AnttuK/SUO
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/AnttuK/SUO/SUO/SUO/SUO.cs

    r7298 r7340  
    1010{ 
    1111    Image plImg = LoadImage("Untitled"); 
     12    Image alien = LoadImage("alien"); 
    1213    PhysicsObject player; 
    1314    IntMeter counter; 
     
    1617    public override void Begin() 
    1718    { 
    18         CreateCounter(); 
    1919        SetKeys(); 
    2020        SetLevel(); 
     
    3434        Add(counterDisp); 
    3535    } 
    36     void Restart(PhysicsObject obj1, PhysicsObject obj2) 
     36    void Restart(Boolean lose) 
    3737    { 
    3838        ClearAll(); 
    39         MessageDisplay.Add("You Lose! Try Again?"); 
    40         CreateCounter(); 
     39        if (lose) 
     40        { 
     41            MessageDisplay.Add("You Lose! Try Again?"); 
     42        } 
    4143        SetKeys(); 
    4244        SetLevel(); 
    4345    } 
    44     void Win(PhysicsObject obj1, PhysicsObject obj2) 
     46    void Win() 
    4547    { 
    4648        if (counter.Value == 0) 
     
    6163        Keyboard.Listen(Key.Up, ButtonState.Down, MovePlayer, null, new Vector(0, 50)); 
    6264        Keyboard.Listen(Key.Down, ButtonState.Down, MovePlayer, null, new Vector(0, -50)); 
    63         Keyboard.Listen(Key.R, ButtonState.Down, Restart, null, player,player); 
     65        Keyboard.Listen(Key.R, ButtonState.Down, Restart, null, false); 
    6466    } 
    6567    void SetLevel() 
    6668    { 
    67          
     69        CreateCounter(); 
    6870        TileMap tiles = TileMap.FromLevelAsset("level1"); 
    6971        tiles.SetTileMethod('#', CreateRect, Color.Gray); 
     
    9597        player.Tag = "player"; 
    9698        player.CollisionIgnoreGroup = 1; 
    97         AddCollisionHandler(player, "flag", Win); 
     99        AddCollisionHandler<PhysicsObject, PhysicsObject>(player, "flag", delegate { Win(); } ); 
    98100        AddCollisionHandler(player, "star", CountAndDestroy); 
    99101        Add(player); 
     
    113115        PhysicsObject enem = new PhysicsObject(width*0.75, height*0.75); 
    114116        enem.Position = pos; 
    115         enem.Shape = Shape.Diamond; 
    116         enem.Color = Color.Ruby; 
     117        enem.Image = alien; 
    117118        enem.Restitution = 1.0; 
    118119        enem.Tag = "enemy"; 
    119120        enem.Brain = smartEnem; 
    120  
    121         AddCollisionHandler(enem, "player", Restart); 
     121        // FIXME idiotic collisionhandler 
     122        AddCollisionHandler<PhysicsObject, PhysicsObject>(enem, "player", delegate { Restart(true); } ); 
    122123        Add(enem); 
    123124    } 
  • 2016/24/AnttuK/SUO/SUO/SUO/SUO.csproj.Debug.cachefile

    r7298 r7340  
    22Content\Untitled.xnb 
    33Content\music.xnb 
     4Content\alien.xnb 
    45Content\music.wma 
    56Content\level1.txt 
    67Content\Untitled.png 
    78Content\music.mp3 
     9Content\alien.png 
  • 2016/24/AnttuK/SUO/SUO/SUO/obj/x86/Debug/ContentPipeline-{943DB61E-18B1-4023-9157-F466AB52EC42}.xml

    r7298 r7340  
    2929      <Extra>C:\MyTemp\AnttuK\SUO\SUO\SUO\bin\x86\Debug\Content\music.wma</Extra> 
    3030      <Time>2016-06-14T14:45:05.959763+03:00</Time> 
     31    </Item> 
     32    <Item> 
     33      <Source>alien.png</Source> 
     34      <Name>alien</Name> 
     35      <Importer>TextureImporter</Importer> 
     36      <Processor>TextureProcessor</Processor> 
     37      <Options>None</Options> 
     38      <Output>C:\MyTemp\AnttuK\SUO\SUO\SUO\bin\x86\Debug\Content\alien.xnb</Output> 
     39      <Time>2016-06-15T13:09:50.7100596+03:00</Time> 
    3140    </Item> 
    3241    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/24/AnttuK/SUO/SUO/SUO/obj/x86/Debug/SUO.csproj.FileListAbsolute.txt

    r7298 r7340  
    1414C:\MyTemp\AnttuK\SUO\SUO\SUO\bin\x86\Debug\Content\music.wma 
    1515C:\MyTemp\AnttuK\SUO\SUO\SUO\bin\x86\Debug\Content\music.mp3 
     16C:\MyTemp\AnttuK\SUO\SUO\SUO\bin\x86\Debug\Content\alien.xnb 
     17C:\MyTemp\AnttuK\SUO\SUO\SUO\bin\x86\Debug\Content\alien.png 
  • 2016/24/AnttuK/SUO/SUO/SUO/obj/x86/Debug/cachefile-{943DB61E-18B1-4023-9157-F466AB52EC42}-targetpath.txt

    r7298 r7340  
    33Content\music.xnb 
    44Content\music.wma 
     5Content\alien.xnb 
    56Content\level1.txt 
    67Content\Untitled.png 
    78Content\music.mp3 
     9Content\alien.png 
  • 2016/24/AnttuK/SUO/SUO/SUOContent/SUOContent.contentproj

    r7298 r7340  
    6969    </Compile> 
    7070  </ItemGroup> 
     71  <ItemGroup> 
     72    <Compile Include="alien.png"> 
     73      <Name>alien</Name> 
     74      <Importer>TextureImporter</Importer> 
     75      <Processor>TextureProcessor</Processor> 
     76      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
     77    </Compile> 
     78  </ItemGroup> 
    7179  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    7280  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
Note: See TracChangeset for help on using the changeset viewer.