Changeset 7415 for 2016/24/HenriH


Ignore:
Timestamp:
2016-06-17 10:58:31 (3 years ago)
Author:
karkaite
Message:
 
Location:
2016/24/HenriH/PerunanIhmeellisetSeikkailut
Files:
3 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/HenriH/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut.cs

    r7384 r7415  
    2121    Image TykkiKuva = LoadImage("tykki"); 
    2222    Image avainkuva = LoadImage("avain"); 
     23    Image Maalikuva = LoadImage("maalikuva"); 
    2324 
    2425    SoundEffect maaliAani = LoadSoundEffect("maali"); 
    2526    int scrollausnopeus = -5; 
    2627    bool peliPaattynyt = false; 
    27     bool onkoAvainKeratty = false; 
    2828 
    2929    List<GameObject> taustakuvat; 
     
    4444    void LuoKentta() 
    4545    { 
    46         onkoAvainKeratty = false; 
    4746        TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
    4847        kentta.SetTileMethod('#', LisaaTaso); 
     
    5251        kentta.SetTileMethod('T', LisaaTykki); 
    5352        kentta.SetTileMethod('A', LisaaAvain); 
     53        kentta.SetTileMethod('M', Lisaamaali); 
    5454        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    5555 
     
    5757        Level.Background.CreateGradient(Color.DarkRed, Color.Black); 
    5858    } 
    59  
     59    void Lisaamaali(Vector paikka, double leveys, double korkeus) 
     60    { 
     61        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     62        taso.Position = paikka; 
     63        taso.Image = Maalikuva; 
     64        taso.Tag = "maali"; 
     65        Add(taso); 
     66    } 
    6067    void LisaaTaso(Vector paikka, double leveys, double korkeus) 
    6168    { 
     
    7683 
    7784        Timer ajastin = new Timer(); 
    78         ajastin.Interval = 5.0; 
     85        ajastin.Interval = 5.5; 
    7986        ajastin.Timeout += delegate 
    8087        { 
     
    125132        AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 
    126133        AddCollisionHandler(pelaaja1, "hodari", TormaaHodariin); 
     134        AddCollisionHandler(pelaaja1, "maali", TormaaMaaliin); 
    127135        Add(pelaaja1); 
    128136        AddCollisionHandler(pelaaja1, "avain", TormaaAvaimeen); 
     
    162170        if (onkoTormannyt) return; 
    163171        onkoTormannyt = true; 
     172 
     173        aloitetaankoAlusta(); 
     174     
     175    } 
     176    void aloitetaankoAlusta() 
     177    { 
    164178        MultiSelectWindow ikkuna = new MultiSelectWindow("haluatko pelata uudelleen?", "kyllä", "ei"); 
    165179        ikkuna.AddItemHandler(0, aloitaAlusta); 
     
    167181        Add(ikkuna); 
    168182 
    169      
    170183    } 
    171184    void TormaaAvaimeen(PhysicsObject hahmo, PhysicsObject avain) 
    172185    { 
    173186        avain.Destroy(); 
    174         onkoAvainKeratty = true; 
    175  
    176     } 
    177  
     187 
     188    } 
     189    void TormaaMaaliin(PhysicsObject hahmo, PhysicsObject avain) 
     190    { 
     191 
     192       if(GetObjects(x => (string)x.Tag == "avain").Count > 0) return; 
     193 
     194        MessageDisplay.Add("Pääsit maaliin!"); 
     195        aloitetaankoAlusta(); 
     196 
     197    } 
    178198    void LisaaAvain(Vector paikka,Double leveys, Double korkeus) 
    179199    { 
  • 2016/24/HenriH/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut.csproj.Debug.cachefile

    r7384 r7415  
    77Content\tykinkuula.xnb 
    88Content\avain.xnb 
     9Content\maalikuva.xnb 
  • 2016/24/HenriH/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r7384 r7415  
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\HenriH\PerunanIhmeellisetSeikkailut\PerunanIhmeellisetSeikkailut\PerunanIhmeellisetSeikkailut\bin\x86\Debug\Content\kentta1.xnb</Output> 
    20       <Time>2016-06-16T14:55:57.4697115+03:00</Time> 
     20      <Time>2016-06-17T10:53:14.9204072+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    7474      <Time>2016-06-16T14:00:12.8729115+03:00</Time> 
    7575    </Item> 
     76    <Item> 
     77      <Source>maalikuva.png</Source> 
     78      <Name>maalikuva</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81      <Options>None</Options> 
     82      <Output>C:\MyTemp\HenriH\PerunanIhmeellisetSeikkailut\PerunanIhmeellisetSeikkailut\PerunanIhmeellisetSeikkailut\bin\x86\Debug\Content\maalikuva.xnb</Output> 
     83      <Time>2016-06-17T09:39:29.1998072+03:00</Time> 
     84    </Item> 
    7685    <BuildSuccessful>true</BuildSuccessful> 
    7786    <Settings> 
  • 2016/24/HenriH/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/obj/x86/Debug/PerunanIhmeellisetSeikkailut.csproj.FileListAbsolute.txt

    r7384 r7415  
    1515C:\MyTemp\HenriH\PerunanIhmeellisetSeikkailut\PerunanIhmeellisetSeikkailut\PerunanIhmeellisetSeikkailut\bin\x86\Debug\Content\tykinkuula.xnb 
    1616C:\MyTemp\HenriH\PerunanIhmeellisetSeikkailut\PerunanIhmeellisetSeikkailut\PerunanIhmeellisetSeikkailut\bin\x86\Debug\Content\avain.xnb 
     17C:\MyTemp\HenriH\PerunanIhmeellisetSeikkailut\PerunanIhmeellisetSeikkailut\PerunanIhmeellisetSeikkailut\bin\x86\Debug\Content\maalikuva.xnb 
  • 2016/24/HenriH/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r7384 r7415  
    77Content\tykinkuula.xnb 
    88Content\avain.xnb 
     9Content\maalikuva.xnb 
  • 2016/24/HenriH/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailutContent/PerunanIhmeellisetSeikkailutContent.contentproj

    r7384 r7415  
    9999    </Compile> 
    100100  </ItemGroup> 
     101  <ItemGroup> 
     102    <Compile Include="maalikuva.png"> 
     103      <Name>maalikuva</Name> 
     104      <Importer>TextureImporter</Importer> 
     105      <Processor>TextureProcessor</Processor> 
     106    </Compile> 
     107  </ItemGroup> 
    101108  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    102109  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/24/HenriH/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailut/PerunanIhmeellisetSeikkailutContent/kentta1.txt

    r7384 r7415  
    1 ..................................................#...........................................................................................................................................................A# 
     1..................................................#.............................................................A..............................................................................................# 
    22..................................................#........................T#################################################################################################################################### 
    33....................................###########...#........................T...#.....................................................T...........#.............................................................# 
    4 ..............................................T...#.....H.....H.....H..........#..........................................................T......#.............................................................# 
    5 .....#...........................#............#H..#...######################..H#.................................................................T.............................................................# 
    6 .....#..#....##...............................T...#........................#...#..................................................T##########################################################################..# 
    7 .....#.......................#................#...##.......................#...#..#############################################...#.......#....................................................................# 
    8 .....#...............#.....#..................#...#........................T...#..............H........H..........H...........#...#.......#..................................................................#.# 
    9 ...#.#........................................T..H#..#.....................#...##.............................................T...#.......###############......................................................# 
    10 ..............................................#...#........................TH..#..............................................T...#.......#............#................................................#......# 
    11 ..#...........................................T...#........................T...#######H##########H#########H#########H#####...#H..........#............#................##############################.........# 
    12 ..............................................#...############..############..........#..........#.........#.........#.......########..####.....#......##################......................................T 
     4..............................................T...#.....H.....H.....H..........#..........................................................T......#M............................................................# 
     5.....#...........................#............#H..#...######################..H#.................................................................T##########################################################...# 
     6.....#..#....##...............................T...#......A.................#...#..................................................T###############.............................................................# 
     7.....#.......................#................#...##.......................#...#..#############################################...#.......#...................................................................## 
     8.....#...............#.....#..................#...#........................T...#..............H........H..........H...........#...#.......#A...................................................................# 
     9.....#........................................T..H#..#.....................#...##.............................................T...#.......##############....................................................#..# 
     10..#...........................................#...#........................TH..#..............................................T...#.......#............#.......................................................# 
     11..............................................T...#........................T...#######H##########H#########H#########H#####...#H..........#............###############################################.........# 
     12..............................................#...############..############..........#..........#.........#.........#.......########..####.....#.........................................................T....# 
    1313.#............................................T...#..........#.............T..................................................T...#.............#.......................................................T####### 
    14 N#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH#H.......#...................TH.....................................................T.............#..........................#...................................T 
     14N#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH#H.......#...................TH.....................................................T.............T..........................#...................................T 
    1515################################################################################################################################################################################################################ 
Note: See TracChangeset for help on using the changeset viewer.