Changeset 6379


Ignore:
Timestamp:
2015-06-25 15:02:09 (4 years ago)
Author:
samkasha
Message:
 
Location:
2015/26/SamuH/AwesomeGuest
Files:
6 added
14 edited

Legend:

Unmodified
Added
Removed
  • 2015/26/SamuH/AwesomeGuest/AwesomeGuest/AwesomeGuest/AwesomeGuest.cs

    r6268 r6379  
    1414 
    1515    PlatformCharacter pelaaja1; 
     16    Image vpiikkikuva = LoadImage("vpiikit"); 
     17    Image tiilikuva = LoadImage("tiili"); 
    1618    Image piikkikuva = LoadImage("piikit"); 
    1719    Image telelapionkuva = LoadImage("telelapio"); 
     
    2527 
    2628    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     29     
    2730 
    2831    public override void Begin() 
    2932    { 
    30         Gravity = new Vector(0, -1000); 
     33        IsFullScreen = true; 
     34        AloitaKenttaAlusta(); 
     35    } 
     36    void AloitaKenttaAlusta() 
     37    { 
     38        ClearAll(); 
     39        Gravity = new Vector(0, -1200); 
    3140 
    3241        LuoKentta(); 
     
    3746        Camera.StayInLevel = true; 
    3847    } 
    39  
    4048    void LuoKentta()  
    4149    { 
    4250        TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
     51        kentta.SetTileMethod('F', LisaaFplokki); 
     52        kentta.SetTileMethod('v', LisaaVpiikit); 
    4353        kentta.SetTileMethod('s', Lisaapiikit); 
    4454        kentta.SetTileMethod('t', Lisaatelelapio); 
     
    6171        taso.Position = paikka; 
    6272        taso.Color = Color.Green; 
     73        taso.Image = tiilikuva; 
    6374        Add(taso); 
    6475        SmoothTextures = false; 
     
    7586    } 
    7687 
     88 
     89    void LisaaFplokki(Vector paikka, double leveys, double korkeus) 
     90    { 
     91        PhysicsObject plokki = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     92        plokki.IgnoresCollisionResponse = true; 
     93        plokki.Position = paikka; 
     94        plokki.Image = tiilikuva; 
     95        plokki.Tag = "plokki"; 
     96        Add(plokki); 
     97    } 
     98 
    7799    void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    78100    { 
     
    81103        pelaaja1.Mass = 4.0; 
    82104        pelaaja1.Image = pelaajanKuva; 
     105        AddCollisionHandler(pelaaja1, "piikit", tormaapiikkeihin); 
    83106        AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 
    84107        pelaaja1.CanRotate = true; 
     
    122145    void Lisaalapio(Vector paikka, double leveys, double korkeus) 
    123146    { 
    124         PhysicsObject lapio = new PhysicsObject(leveys * 3.5 , korkeus*6.5); 
     147        PlatformCharacter lapio = new PlatformCharacter(75.0, 240.0); 
    125148        lapio.Image = lapionkuva; 
    126149        lapio.Position = paikka + new Vector(0, lapio.Height/2); 
    127         RandomMoverBrain satunnaisAivot = new RandomMoverBrain(200); 
    128         satunnaisAivot.ChangeMovementSeconds = 3; 
    129         ; lapio.Brain = satunnaisAivot; 
    130         satunnaisAivot.Speed = 600; 
    131150        Add(lapio); 
    132     } 
     151        PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
     152        tasoAivot.Speed = 100; 
     153        lapio.Brain = tasoAivot; 
     154    }   
    133155    void Lisaakenttälapio (Vector paikka, double leveys, double korkeus) 
    134156    { 
    135         PhysicsObject kenttälapio = new PhysicsObject(leveys, korkeus * 2.0); 
    136         kenttälapio.Image = klkuva; 
    137         kenttälapio.Position = paikka + new Vector(0, korkeus); 
    138         Add(kenttälapio); 
    139  
     157        PlatformCharacter lapio = new PlatformCharacter(30.0, 60.0); 
     158        lapio.Image = klkuva; 
     159        lapio.Position = paikka + new Vector(0, korkeus); 
     160        lapio.Tag = ("lapio"); 
     161        Add(lapio); 
     162        PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
     163        tasoAivot.Speed = 100; 
     164        lapio.Brain = tasoAivot; 
    140165} 
    141166    void Lisaafiskars (Vector paikka, double leveys, double korkeus) 
     
    145170        fiskars.Position = paikka + new Vector(0, korkeus); 
    146171        Add(fiskars); 
    147         RandomMoverBrain satunnaisAivot = new RandomMoverBrain(200); 
    148         satunnaisAivot.ChangeMovementSeconds = 3; 
    149       ;  fiskars.Brain = satunnaisAivot; 
    150       satunnaisAivot.Speed = 600; 
     172       // RandomMoverBrain satunnaisAivot = new RandomMoverBrain(200); 
     173       // satunnaisAivot.ChangeMovementSeconds = 3; 
     174      ;  //fiskars.Brain = satunnaisAivot; 
     175     // satunnaisAivot.Speed = 600; 
    151176    } 
    152177    void Lisaapizzalapio(Vector paikka, double leveys, double korkeus) 
     
    186211        piikit.Image = piikkikuva; 
    187212        Add(piikit); 
    188     } 
    189  
     213        piikit.Tag = "piikit"; 
     214    } 
     215    void LisaaVpiikit(Vector paikka, double leveys, double korkeus) 
     216    { 
     217        PhysicsObject vpiikit = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     218        vpiikit.Position = paikka; 
     219        vpiikit.Image = vpiikkikuva; 
     220        Add(vpiikit); 
     221        vpiikit.Tag = "piikit"; 
     222    } 
     223    void tormaapiikkeihin(PhysicsObject pelaaja1, PhysicsObject piikit) 
     224    { 
     225         
     226        MessageDisplay.Add("Rekt n00b"); 
     227        pelaaja1.Destroy(); 
     228        Timer.SingleShot(1.5,AloitaKenttaAlusta); 
     229 
     230 
     231    } 
     232 
     233   
    190234} 
  • 2015/26/SamuH/AwesomeGuest/AwesomeGuest/AwesomeGuest/AwesomeGuest.csproj.Debug.cachefile

    r6268 r6379  
    1212Content\tyhjÀ.xnb 
    1313Content\piikit.xnb 
     14Content\tiili.xnb 
     15Content\vpiikit.xnb 
  • 2015/26/SamuH/AwesomeGuest/AwesomeGuest/AwesomeGuest/obj/x86/Debug/AwesomeGuest.csproj.FileListAbsolute.txt

    r6268 r6379  
    2020C:\MyTemp\SamuH\AwesomeGuest\AwesomeGuest\AwesomeGuest\bin\x86\Debug\Content\tyhjÀ.xnb 
    2121C:\MyTemp\SamuH\AwesomeGuest\AwesomeGuest\AwesomeGuest\bin\x86\Debug\Content\piikit.xnb 
     22C:\MyTemp\SamuH\AwesomeGuest\AwesomeGuest\AwesomeGuest\bin\x86\Debug\Content\tiili.xnb 
     23C:\MyTemp\SamuH\AwesomeGuest\AwesomeGuest\AwesomeGuest\bin\x86\Debug\Content\vpiikit.xnb 
  • 2015/26/SamuH/AwesomeGuest/AwesomeGuest/AwesomeGuest/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r6268 r6379  
    1212Content\tyhjÀ.xnb 
    1313Content\piikit.xnb 
     14Content\tiili.xnb 
     15Content\vpiikit.xnb 
  • 2015/26/SamuH/AwesomeGuest/AwesomeGuest/AwesomeGuestContent/AwesomeGuestContent.contentproj

    r6268 r6379  
    126126    </Compile> 
    127127  </ItemGroup> 
     128  <ItemGroup> 
     129    <Compile Include="tiili.png"> 
     130      <Name>tiili</Name> 
     131      <Importer>TextureImporter</Importer> 
     132      <Processor>TextureProcessor</Processor> 
     133    </Compile> 
     134  </ItemGroup> 
     135  <ItemGroup> 
     136    <Compile Include="vpiikit.png"> 
     137      <Name>vpiikit</Name> 
     138      <Importer>TextureImporter</Importer> 
     139      <Processor>TextureProcessor</Processor> 
     140    </Compile> 
     141  </ItemGroup> 
    128142  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    129143  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/26/SamuH/AwesomeGuest/AwesomeGuest/AwesomeGuestContent/kentta1.txt

    r6268 r6379  
    1 .....................................................................................................................................................................................................................................................................................................................................................................................................#.....................................#.. 
    2 ....................................................................................................................................................................................................................................................................................................................................................................................................#......................................#.. 
    3 ...................................................................................................................................................................................................................................................................................................................................................................................................#........................................#. 
    4 ..................................................................................................................................................................................................................................................................................................................................................................................................#.......................................#... 
    5 ..................................................................................................................................................................................................................................................................................................................................................................................................#..........................................# 
    6 ...................................................................................................................#.....#..................................................................................................................................................................................................................................................................................................................#. 
    7 ....................................................................................................#.......................................................................................................................................................................................................................................................................................................................................#. 
    8 ........................................................................................#######.................#............................................####....#............................................................................................................................................................................................................................############################################ 
    9 .......................................................................................#...................###.............................................#.................................................................................................................................................................................................................................................................................................................................................... 
    10 ...................................................................................#.....................................................................#..................................................................................................................................................................................................................................................................................... 
    11 ........................................................................................................................................................#...................................................................................................................................................................................................................................................................................... 
    12 ...................................................       ###########......######..............................................................#....#.......................................................................................................................................................................................................................................................................................... 
    13 ........................................................                                                                ....................................................................................................................................................................................................................................................................................................................................................... 
    14 .....................................................  #..                                                      ......................................................#.................................................................................................................................................................................................................................................................................................... 
    15 .......N.................f..k...p.l..r..t........  #.                                                                   ...........................................#........................................................................................................................................................................................................................................................................................................... 
    16 ##. ##############################################                                                                      ........................................................................................................................................................................................................................................................................................................................................................... 
    17 .#..#...........................................................................................................................#..............................................................................................................................................................................................................................................................................................................  
    18 .#..#..........................................................................................................................................................................................................................................................................................................................................................................................................................................  
    19 .#..#..........................................................................................................................................................................................................................................................................................................................................................................................................................................  
    20 .#..#..........................................................................................................................................................................................................................................................................................................................................................................................................................................  
    21  #  #.......................................................................................................................................................................................................................................................................................................................................................................................................................................... 
    22 .#..#.......................................................................................................................................................................................................................................................................................................................................................................................................................................... 
    23 .#..#sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss..............................................................................................................................................................         
    24 .#..##############################################################################################################################################################################################################..............................................................................................................................................................         
    25 .#................................................................................................................................................................................................................       
    26 .#################################################################################################################################################################################################################.................................................................................................................................................................      
    27 ................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
    28 ................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
    29 ................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
    30 ................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
    31 ................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
    32 ................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
    33 ................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
    34 .................................................................................................................................................................................................................................................................................................................................................................................................................................................                                                                                                                                
     1############################################################################################################################################################################################################################################################################################################################################################################################################################################################################## 
     2#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 
     3#..................................................................................................................................................................................................................................................................................................................................................................................................#...............#........................#................................. 
     4#.................................................................................................................................................................................................................................................................................................................................................................................................#................#.........................#................................ 
     5#.....................................................................................................................................................................................................................................................................................................................................................................####..............................F..#..F....#.........................#................................ 
     6#..................................................................................................................................................................................................................................................................................................................................................................#......F..........................#.............#.........................#................................ 
     7#.................................................................................................................................................................................................................................................................................................................................................########FFFF#######........FFFF.######.....#....#...........#....#.........................#................................ 
     8#.......................................................................................###FF##....#.............#...........................................#FFF#....#.....#..................................................................................................................................................................#.............................................................................................#................................ 
     9#..........................................................................................................###...................................................................................................................................................................................................................................................................................................................l...........#................................ 
     10#..................................................................................#......................................................................#....................F....................................................................................................................#...#........................#.###...F..#.........................................................######....#####...................####................................ 
     11#.......................................................F.............................................................................................................................................................................................................................................................................................................................................................#....................#.................................. 
     12#...................................................#...... ##FFFFFF###......######..................................F...........................#....#..............................#...................................................................................................#...#..F.#......................###...#......................................................................................#....................#.................................. 
     13#............................................................................................................................................#.......................................................................................................................................#.....................#FFFFFF#...................................................................................................######################.................................. 
     14#..................................#..................#F.....................................................................#.....#...F..#.....................................................#......#.....................................................................#...F............................................................................................................................................................................................ 
     15#..N...................#.....###........#.....#####.....................................................................................................................................###....................................#....#...........................#......#F........#####..................................#..................................................................................................................................................... 
     16#######..F..#....#.......................................................................................................................................................................................................#..F................................................................................................................................................................................................................................................. 
     17......................................................................................................................................................................................................................................................###F.......###.......................................................................................................................................................................................................... 
     18.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     19.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     20.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     21.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     22.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     23ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss 
     24############################################################################################################################################################################################################################################################################################################################################################################################################################################################################## 
     25.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     26.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     27.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     28.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     29.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     30.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     31.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     32.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     33.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 
     34.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................                                                                                                                            
  • 2015/26/SamuH/AwesomeGuest/AwesomeGuest/AwesomeGuestContent/obj/x86/Debug/ContentPipeline-.xml

    r6268 r6379  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\SamuH\AwesomeGuest\AwesomeGuest\AwesomeGuest\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2015-06-24T14:54:04.6704216+03:00</Time> 
     38      <Time>2015-06-25T14:45:13.8832932+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    119119      <Time>2015-06-24T14:39:56.7956426+03:00</Time> 
    120120    </Item> 
     121    <Item> 
     122      <Source>tiili.png</Source> 
     123      <Name>tiili</Name> 
     124      <Importer>TextureImporter</Importer> 
     125      <Processor>TextureProcessor</Processor> 
     126      <Options>None</Options> 
     127      <Output>C:\MyTemp\SamuH\AwesomeGuest\AwesomeGuest\AwesomeGuest\bin\x86\Debug\Content\tiili.xnb</Output> 
     128      <Time>2015-06-25T11:45:35.75701+03:00</Time> 
     129    </Item> 
     130    <Item> 
     131      <Source>vpiikit.png</Source> 
     132      <Name>vpiikit</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135      <Options>None</Options> 
     136      <Output>C:\MyTemp\SamuH\AwesomeGuest\AwesomeGuest\AwesomeGuest\bin\x86\Debug\Content\vpiikit.xnb</Output> 
     137      <Time>2015-06-25T12:58:38.4409145+03:00</Time> 
     138    </Item> 
    121139    <BuildSuccessful>true</BuildSuccessful> 
    122140    <Settings> 
Note: See TracChangeset for help on using the changeset viewer.