Changeset 7785 for 2016/27


Ignore:
Timestamp:
2016-07-05 14:53:40 (3 years ago)
Author:
karkaite
Message:
 
Location:
2016/27/PekkaP/FinnishTroops
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroops/FinnishTroops.cs

    r7781 r7785  
    1414 
    1515    PlatformCharacter pelaaja1; 
    16  
    1716    Image pelaajanKuva = LoadImage("SOTILAS"); 
    1817    Image tahtiKuva = LoadImage("tahti"); 
    19  
     18    Image pahisKuva = LoadImage("pahis"); 
    2019    SoundEffect maaliAani = LoadSoundEffect("maali"); 
    21  
     20    IntMeter pelaajan1Pisteet; 
    2221    public override void Begin() 
    2322    { 
     
    2524 
    2625        LuoKentta(); 
     26        LuoPisteLaskuri(Screen.Left +20.0, Screen.Top -20.0); 
    2727        LisaaNappaimet(); 
    2828 
     
    3232    } 
    3333 
     34 
    3435    void LuoKentta() 
    3536    { 
     
    3839        kentta.SetTileMethod('*', LisaaTahti); 
    3940        kentta.SetTileMethod('N', LisaaPelaaja); 
     41        kentta.SetTileMethod('M', LisaaPahis); 
    4042        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4143        Level.CreateBorders(); 
    42         Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
     44        Level.Background.CreateGradient(Color.OrangeRed, Color.Black); 
     45    } 
     46 
     47    void LisaaPahis(Vector paikka, double leveys, double korkeus) 
     48    { 
     49        PlatformCharacter pahis = new PlatformCharacter(leveys, korkeus); 
     50        pahis.Image = pahisKuva; 
     51        Add(pahis); 
     52 
     53        PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
     54        tasoAivot.JumpSpeed = 700; 
     55        tasoAivot.TriesToJump = true; 
     56        tasoAivot.Speed = 100; 
     57        tasoAivot.FallsOffPlatforms = true; 
     58        pahis.Brain = tasoAivot; 
     59 
    4360    } 
    4461 
     
    4764        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    4865        taso.Position = paikka; 
    49         taso.Color = Color.Green; 
     66        taso.Color = Color.Charcoal; 
    5067        Add(taso); 
    5168    } 
     
    5774        tahti.Position = paikka; 
    5875        tahti.Image = tahtiKuva; 
    59         tahti.Tag = "tahti"; 
     76        tahti.Tag = "Cash"; 
    6077        Add(tahti); 
    6178    } 
     
    6784        pelaaja1.Mass = 4.0; 
    6885        pelaaja1.Image = pelaajanKuva; 
    69         AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 
     86        AddCollisionHandler(pelaaja1, "Cash", TormaaTahteen); 
    7087        Add(pelaaja1); 
    7188    } 
     
    96113    void Hyppaa(PlatformCharacter hahmo, double nopeus) 
    97114    { 
    98         hahmo.Jump(nopeus); 
     115        pelaaja1.Jump(nopeus); 
    99116    } 
    100117 
    101     void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti) 
     118    void TormaaTahteen(PhysicsObject pelaaja1, PhysicsObject tahti) 
    102119    { 
    103120        maaliAani.Play(); 
    104         MessageDisplay.Add("Keräsit tähden!"); 
     121        MessageDisplay.Add("Cash"); 
    105122        tahti.Destroy(); 
     123        pelaajan1Pisteet.Value += 100; 
     124 
     125    } 
     126    
     127 
     128    IntMeter LuoPisteLaskuri(double x, double y) 
     129    { 
     130        pelaajan1Pisteet = new IntMeter(0); 
     131        pelaajan1Pisteet.MaxValue = 1900; 
     132 
     133        Label naytto = new Label(); 
     134        naytto.BindTo(pelaajan1Pisteet); 
     135        naytto.X = x; 
     136        naytto.Y = y; 
     137        naytto.TextColor = Color.Black; 
     138        naytto.BorderColor = Level.Background.Color; 
     139        naytto.Color = Level.Background.Color; 
     140        Add(naytto); 
     141 
     142 
     143        return pelaajan1Pisteet; 
    106144    } 
    107145} 
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroops/FinnishTroops.csproj.Debug.cachefile

    r7781 r7785  
    44Content\SOTILAS.xnb 
    55Content\kentta1.xnb 
     6Content\pahis.xnb 
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroops/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r7781 r7785  
    4545      <Options>None</Options> 
    4646      <Output>C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\bin\x86\Debug\Content\kentta1.xnb</Output> 
    47       <Time>2016-07-05T13:51:04.6811827+03:00</Time> 
     47      <Time>2016-07-05T14:51:46.5543593+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>pahis.png</Source> 
     51      <Name>pahis</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\bin\x86\Debug\Content\pahis.xnb</Output> 
     56      <Time>2016-07-05T14:48:54.3421471+03:00</Time> 
    4857    </Item> 
    4958    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroops/obj/x86/Debug/FinnishTroops.csproj.FileListAbsolute.txt

    r7781 r7785  
    1212C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\obj\x86\Debug\FinnishTroops.exe 
    1313C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\obj\x86\Debug\FinnishTroops.pdb 
     14C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\bin\x86\Debug\Content\pahis.xnb 
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroops/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r7781 r7785  
    44Content\SOTILAS.xnb 
    55Content\kentta1.xnb 
     6Content\pahis.xnb 
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroopsContent/FinnishTroopsContent.contentproj

    r7781 r7785  
    7474    </Compile> 
    7575  </ItemGroup> 
     76  <ItemGroup> 
     77    <Compile Include="pahis.png"> 
     78      <Name>pahis</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81    </Compile> 
     82  </ItemGroup> 
    7683  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    7784  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroopsContent/kentta1.txt

    r7781 r7785  
    1     
    2 ............##...........##...........##..........##..........##.........##.......... 
    3 ............##...........##...........##..........##..........##.........##.......... 
    4 ............##...........##...........##..........##..........##.........##.......... 
    5 ............##...........##...........##..........##..........##.........##.......... 
    6 ............##...........##...........##..........##..........##.........##.......... 
    7 ............##...........##...........##..........##..........##.........##.......... 
    8 ............##...........##...........##..........##..........##.........##.......... 
    9 ............##...........##...........##..........##..........##.........##.......... 
    10 ............##...........##...........##..........##..........##.........##.......... 
    11 ............##...........##...........##..........##..........##.........##.......... 
    12 ............##...........##...........##..........##..........##.........##.......... 
    13 ............##...........##...........##..........##..........##.........##.....##... 
    14 ............##...........##...........##..........##..........##.........##.......... 
    15 ............##...........##...........##..........##..........##.........##..##...... 
    16 ............##...........##...........##..........##..........##.........##.....#.... 
    17 ......##....###.##.###.#####.##.####.#####.#.##.#####.#####.#####.#####.###.......... 
    18 ............##...........##...........##..........##..........##.........##......##.. 
    19 ............##...........##...........##..........##..........##.........##.......... 
    20 .........##.................................................................##....... 
    21 ..................................................................................... 
    22 ##############...........###############..........##############.........############ 
    23 ............##...........##...........##..........##..........##.........##.......... 
    24 ..................###.......................###....................###............... 
    25 ........N............................................................................ 
    26 ##################################################################################### 
     1   .............................................. 
     2   .*........*.......*..*........*.....*.......*. 
     3   ###....#####....########....############....## 
     4   ................*............................. 
     5   .......#........#......M..*...........*....*.. 
     6   ########...#######....#########.....########## 
     7   ...........*.....*............................ 
     8   ...........#.....#....#.............#......... 
     9   ###.........*...###...##.*..##....###.*..###.. 
     10   ......*.....#...*........#....*.......#....... 
     11   ..N...#.....#...#........#....#.......#....... 
     12   ############################################## 
Note: See TracChangeset for help on using the changeset viewer.