Changeset 7900 for 2016


Ignore:
Timestamp:
2016-07-06 14:57:01 (3 years ago)
Author:
saalniit
Message:
 
Location:
2016/27/SamuelN/PlatformJumper
Files:
3 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2016/27/SamuelN/PlatformJumper/PlatformJumper/PlatformJumper/PlatformJumper.cs

    r7861 r7900  
    66using Jypeli.Effects; 
    77using Jypeli.Widgets; 
     8 
    89 
    910public class PlatformJumper : PhysicsGame 
     
    1819    Image tahtiKuva = LoadImage("Diamond"); 
    1920    Image ruohokuva = LoadImage("ruoho"); 
     21    Image vihukuva = LoadImage("pig"); 
    2022 
    2123 
    2224    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     25 
     26 
    2327 
    2428    public override void Begin() 
     
    2832        LuoKentta(); 
    2933        LisaaNappaimet(); 
     34        LuoPistelaskuri(); 
    3035 
    3136        Camera.Follow(pelaaja1); 
     
    4045        kentta.SetTileMethod('t', LisaaTahti); 
    4146        kentta.SetTileMethod('p', LisaaPelaaja); 
     47        kentta.SetTileMethod('v', LisaaVihu); 
    4248        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4349        Level.CreateBorders(); 
    44         Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
     50        Level.Background.CreateGradient(Color.Red, Color.Blue); 
    4551    } 
    4652 
     
    105111    { 
    106112        maaliAani.Play(); 
    107         MessageDisplay.Add("Keräsit timantin!"); 
     113        pisteLaskuri.Value += 1; 
    108114        tahti.Destroy(); 
     115 
     116        Explosion rajahdys = new Explosion(50); 
     117        rajahdys.Position = tahti.Position; 
     118        Add(rajahdys); 
     119 
     120        rajahdys.Speed = 500.0; 
     121        rajahdys.Force = 10000; 
     122        pelaaja1.IgnoresExplosions = true; 
     123 
    109124    } 
     125    IntMeter pisteLaskuri; 
     126 
     127    void LuoPistelaskuri() 
     128    { 
     129        pisteLaskuri = new IntMeter(0); 
     130 
     131        Label pisteNaytto = new Label(); 
     132        pisteNaytto.X = Screen.Left + 100; 
     133        pisteNaytto.Y = Screen.Top - 100; 
     134        pisteNaytto.TextColor = Color.Black; 
     135        pisteNaytto.Color = Color.White; 
     136 
     137        pisteNaytto.BindTo(pisteLaskuri); 
     138        Add(pisteNaytto); 
     139    } 
     140    void LisaaVihu(Vector paikka, double korkeus, double leveys) 
     141    { 
     142    PhysicsObject vihu = new PhysicsObject(korkeus, leveys); 
     143        vihu.Position = paikka; 
     144        vihu.Image = vihukuva; 
     145        Add(vihu); 
    110146} 
     147} 
  • 2016/27/SamuelN/PlatformJumper/PlatformJumper/PlatformJumper/PlatformJumper.csproj.Debug.cachefile

    r7861 r7900  
    55Content\ruoho.xnb 
    66Content\wallpaper.xnb 
     7Content\pig.xnb 
  • 2016/27/SamuelN/PlatformJumper/PlatformJumper/PlatformJumper/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r7861 r7900  
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\SamuelN\PlatformJumper\PlatformJumper\PlatformJumper\bin\x86\Debug\Content\kentta1.xnb</Output> 
    20       <Time>2016-07-06T11:09:32.279686+03:00</Time> 
     20      <Time>2016-07-06T14:37:30.4950369+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    5555      <Output>C:\MyTemp\SamuelN\PlatformJumper\PlatformJumper\PlatformJumper\bin\x86\Debug\Content\wallpaper.xnb</Output> 
    5656      <Time>2016-07-06T11:00:16.3871023+03:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>pig.jpg</Source> 
     60      <Name>pig</Name> 
     61      <Importer>TextureImporter</Importer> 
     62      <Processor>TextureProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\SamuelN\PlatformJumper\PlatformJumper\PlatformJumper\bin\x86\Debug\Content\pig.xnb</Output> 
     65      <Time>2016-07-06T14:53:14.5459367+03:00</Time> 
    5766    </Item> 
    5867    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/27/SamuelN/PlatformJumper/PlatformJumper/PlatformJumper/obj/x86/Debug/PlatformJumper.csproj.FileListAbsolute.txt

    r7861 r7900  
    1313C:\MyTemp\SamuelN\PlatformJumper\PlatformJumper\PlatformJumper\bin\x86\Debug\Content\ruoho.xnb 
    1414C:\MyTemp\SamuelN\PlatformJumper\PlatformJumper\PlatformJumper\bin\x86\Debug\Content\wallpaper.xnb 
     15C:\MyTemp\SamuelN\PlatformJumper\PlatformJumper\PlatformJumper\bin\x86\Debug\Content\pig.xnb 
  • 2016/27/SamuelN/PlatformJumper/PlatformJumper/PlatformJumper/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r7861 r7900  
    55Content\ruoho.xnb 
    66Content\wallpaper.xnb 
     7Content\pig.xnb 
  • 2016/27/SamuelN/PlatformJumper/PlatformJumper/PlatformJumperContent/PlatformJumperContent.contentproj

    r7861 r7900  
    8585    </Compile> 
    8686  </ItemGroup> 
     87  <ItemGroup> 
     88    <Compile Include="pig.jpg"> 
     89      <Name>pig</Name> 
     90      <Importer>TextureImporter</Importer> 
     91      <Processor>TextureProcessor</Processor> 
     92    </Compile> 
     93  </ItemGroup> 
    8794  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    8895  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/27/SamuelN/PlatformJumper/PlatformJumper/PlatformJumperContent/kentta1.txt

    r7861 r7900  
    1                                                                                   p 
     1v..................v..................v 
     2...................t................... 
     3..................###.................. 
     4....................................... 
     5................t.....t................ 
     6...............###...###............... 
     7....................................... 
     8.............t...........t............. 
     9............###.........###............ 
     10....................................... 
     11..........t.................t.......... 
     12.........###...............###......... 
     13....................................... 
     14.......t.......................t....... 
     15......###.....................###...... 
     16....................................... 
     17....t.............................t.... 
     18...###...........................###... 
     19....................................... 
     20.t...................................t. 
     21###.................................### 
     22....................................... 
     23...................p.................. 
     24####################################### 
    225 
    3  
    4  
    5  
    6  
    7  
    8  
    9  
    10                                                                           ########### 
    11  
    12  
    13  
    14 t                t                       t                   t                 t                 t 
    15 ################################################################################################### 
Note: See TracChangeset for help on using the changeset viewer.