Changeset 1235 for 2010/27


Ignore:
Timestamp:
2010-07-09 13:07:27 (13 years ago)
Author:
juoshako
Message:

Br3ak 1t 100% valmis!

Location:
2010/27/juoshako/Br3ak 1t
Files:
8 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2010/27/juoshako/Br3ak 1t/Content/Content.contentproj

    r1149 r1235  
    1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 
     1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 
    22  <PropertyGroup> 
    33    <ProjectGuid>c3e53c07-d49e-4b6c-8534-dcfc9ec3c7d4</ProjectGuid> 
     
    3434    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> 
    3535  </ItemGroup> 
     36  <ItemGroup> 
     37    <Compile Include="Palikka.png"> 
     38      <Name>Palikka</Name> 
     39      <Importer>TextureImporter</Importer> 
     40      <Processor>TextureProcessor</Processor> 
     41    </Compile> 
     42  </ItemGroup> 
     43  <ItemGroup> 
     44    <Compile Include="Laatta.png"> 
     45      <Name>Laatta</Name> 
     46      <Importer>TextureImporter</Importer> 
     47      <Processor>TextureProcessor</Processor> 
     48    </Compile> 
     49  </ItemGroup> 
     50  <ItemGroup> 
     51    <Compile Include="Laatta %28vastavärit%29.png"> 
     52      <Name>Laatta %28vastavärit%29</Name> 
     53      <Importer>TextureImporter</Importer> 
     54      <Processor>TextureProcessor</Processor> 
     55    </Compile> 
     56  </ItemGroup> 
     57  <ItemGroup> 
     58    <Compile Include="n49_chandra_big.jpg"> 
     59      <Name>n49_chandra_big</Name> 
     60      <Importer>TextureImporter</Importer> 
     61      <Processor>TextureProcessor</Processor> 
     62    </Compile> 
     63  </ItemGroup> 
     64  <ItemGroup> 
     65    <Compile Include="button-3.wav"> 
     66      <Name>button-3</Name> 
     67      <Importer>WavImporter</Importer> 
     68      <Processor>SoundEffectProcessor</Processor> 
     69    </Compile> 
     70  </ItemGroup> 
     71  <ItemGroup> 
     72    <Compile Include="button-4.wav"> 
     73      <Name>button-4</Name> 
     74      <Importer>WavImporter</Importer> 
     75      <Processor>SoundEffectProcessor</Processor> 
     76    </Compile> 
     77  </ItemGroup> 
     78  <ItemGroup> 
     79    <Compile Include="Menu.png"> 
     80      <Name>Menu</Name> 
     81      <Importer>TextureImporter</Importer> 
     82      <Processor>TextureProcessor</Processor> 
     83    </Compile> 
     84  </ItemGroup> 
     85  <ItemGroup> 
     86    <Compile Include="midnight-ride.mp3"> 
     87      <Name>midnight-ride</Name> 
     88      <Importer>Mp3Importer</Importer> 
     89      <Processor>SongProcessor</Processor> 
     90    </Compile> 
     91  </ItemGroup> 
    3692</Project> 
  • 2010/27/juoshako/Br3ak 1t/Peli.cs

    r1193 r1235  
    55using Jypeli.Assets; 
    66 
     7 
     8 
     9/// <summary> 
     10/// Br3ak1t 
     11/// Tekijä: Juha-Matti Hakojärvi 
     12/// </summary> 
    713public class Laatta : PhysicsObject 
    814{ 
     
    2733    const int ruudunKorkeus = 50; 
    2834 
    29     Vector nopeusVasemmalle = new Vector (-200.0, 0); 
    30     Vector nopeusOikealle = new Vector(200.0, 0); 
     35    Vector nopeusVasemmalle = new Vector (-800.0, 0); 
     36    Vector nopeusOikealle = new Vector(800.0, 0); 
    3137 
    3238    PhysicsObject maila; 
     
    3541    IntMeter pisteLaskuri; 
    3642 
     43    SoundEffect osuuLaattaanAani; 
     44    SoundEffect TuhoaaLaatanAani; 
     45 
    3746    List<Label> valikonKohdat; 
     47 
     48    const double pallonYNopeus = 800; 
    3849 
    3950    protected override void Begin() 
     
    5061        LuoLaskuri(); 
    5162        AsetaOhjaimet(); 
     63        LataaAanet(); 
    5264        //LuoMaila(); 
     65 
    5366 
    5467        Vector impulssi = new Vector(0.0, 500.0); 
    5568        pallo.Hit(impulssi); 
    5669    } 
     70 
     71    void LataaAanet() 
     72    { 
     73        osuuLaattaanAani = LoadSoundEffect("button-3"); 
     74        TuhoaaLaatanAani = LoadSoundEffect("button-4"); 
     75    } 
     76 
    5777    void Lopeta() 
    5878    { 
    5979        Exit(); 
    6080    } 
     81 
     82    protected override void Update(Time time) 
     83    { 
     84        if ( pallo != null && Math.Abs(pallo.Velocity.Y) < pallonYNopeus) 
     85        { 
     86            pallo.Velocity = new Vector(pallo.Velocity.X, pallo.Velocity.Y * 1.1); 
     87        } 
     88 
     89        base.Update(time); 
     90    } 
     91 
    6192    void LuoMaila() 
    6293    { 
    6394        maila = PhysicsObject.CreateStaticObject(300, 30); 
    64         //maila.Shape = Shapes.Circle; 
     95        maila.Shape = Shapes.Rectangle; 
    6596        maila.X = 0; 
    6697        maila.Y = Level.Bottom + 100; 
     
    6899        maila.KineticFriction = 1; 
    69100        maila.Color = Color.Blue; 
     101        maila.Restitution = 1.0; 
    70102        Add(maila); 
    71103    } 
     
    77109        ruudut['.'] = LuoTiili; 
    78110        ruudut.Insert (ruudunLeveys, ruudunKorkeus); 
     111        Image tausta = LoadImage("n49_chandra_big"); 
     112        Level.Background.Image = tausta; 
     113        Level.Background.Scale = 4; 
     114        Level.Background.FitToLevel(); 
    79115        Camera.ZoomToLevel(); 
     116 
     117        Level.BackgroundColor = Color.Black; 
    80118 
    81119        pallo = new PhysicsObject(40, 40); 
     
    83121        pallo.X = 0; 
    84122        pallo.Y = Level.Bottom+110; 
    85         pallo.Color = Color.Black; 
     123        pallo.Color = Color.Red; 
     124        pallo.KineticFriction = 0; 
    86125        Add (pallo); 
    87126 
    88127        LuoMaila(); 
    89  
     128        MediaPlayer.Play("midnight-ride"); 
     129         
    90130        AddCollisionHandler(pallo, KasittelePallonTormays); 
     131        Mouse.IsCursorVisible = false;MediaPlayer.Play("midnight-ride"); 
     132         
    91133    } 
    92134    PhysicsObject LuoPalikka() 
     
    97139        palikka.Restitution = 1.0; 
    98140        palikka.Tag = "palikka"; 
     141        palikka.Image = LoadImage ("Palikka"); 
    99142        return palikka; 
    100143    } 
    101144    PhysicsObject LuoLaatta() 
    102145    { 
    103         Laatta laatta = new Laatta(48.0, 48.0); 
     146        Laatta laatta = new Laatta(48, 48); 
    104147        laatta.Tag = "laatta";      
     148        laatta.Image = LoadImage("Laatta"); 
     149        laatta.Restitution = 1.0; 
    105150        return laatta; 
    106151    } 
     
    124169                Timer.SingleShot(0.1, kohde.Destroy); 
    125170                pisteLaskuri.Value++; 
     171                TuhoaaLaatanAani.Play(); 
    126172            } 
    127173            else 
    128174            { 
    129175                ((Laatta)kohde).OnkoJoOsuttuKerran = true; 
    130                 kohde.Color = Color.Gray; 
     176                kohde.Image = LoadImage("Laatta (vastavärit)"); 
     177                osuuLaattaanAani.Play(); 
    131178            } 
    132179 
     
    135182        if (kohde.Tag.ToString() == "tiili") 
    136183        { 
    137             MessageDisplay.Add("Peli loppui"); 
     184            MessageDisplay.Add("Peli loppui, paina ESC palataksesi päävalikkoon."); 
     185            MessageDisplay.TextColor = Color.Red; 
    138186            PeliPaattyi(); 
    139187        } 
     
    155203    { 
    156204         
    157         if (( nopeus.X < 0 ) && ( maila.X < Level.Left)) 
     205        if (( nopeus.X < 0 ) && ( maila.Left-50 < Level.Left)) 
    158206        { 
    159207            maila.Velocity = Vector.Zero; 
    160208            return; 
    161209        } 
    162             if (( nopeus.X > 0 ) && (maila.X > Level.Right)) 
     210            if (( nopeus.X > 0 ) && (maila.Right+50 > Level.Right)) 
    163211            { 
    164212                maila.Velocity = Vector.Zero; 
     
    181229        Label pisteTeksti = new Label("Pisteitä"); 
    182230        pisteTeksti.X = Screen.Left + 50; 
    183         pisteTeksti.X = Screen.Top - 100; 
     231        pisteTeksti.Y = Screen.Top - 100; 
    184232        pisteTeksti.TextColor = Color.Red; 
    185233        Add(pisteTeksti); 
     
    197245    { 
    198246        ClearAll(); 
     247         
    199248        Mouse.IsCursorVisible = true; 
    200249        valikonKohdat = new List<Label>(); 
    201  
     250        Image tausta = LoadImage("Menu"); 
     251        Level.Background.Image = tausta; 
    202252        Label kohta1 = new Label("Aloita uusi peli"); 
    203253        kohta1.Position = new Vector(0, 40); 
Note: See TracChangeset for help on using the changeset viewer.