Changeset 4886 for 2014/23/OtsoL


Ignore:
Timestamp:
2014-06-06 10:08:48 (7 years ago)
Author:
koannak
Message:
 
Location:
2014/23/OtsoL/Are you alone/Are you alone
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • 2014/23/OtsoL/Are you alone/Are you alone/Are you alone/Are_you_alone.cs

    r4884 r4886  
    3939    Image kirjak = LoadImage("bookself"); 
    4040    Image spessuK = LoadImage("demon key"); 
     41    Image patsaankuva = LoadImage("statue"); 
    4142 
    4243    SoundEffect roar1 = LoadSoundEffect("monter roar"); 
     
    4748    Vihollinen vihollinen; 
    4849    private List<Vihollinen> listaVihollisista = new List<Vihollinen>(); 
    49     int kenttanumero = 3; 
     50    int kenttanumero = 0; 
    5051    int esnumero = 0; 
    5152 
     
    5657    public override void Begin() 
    5758    { 
    58  
    5959        // TODO: Kirjoita ohjelmakoodisi tähän 
    60         luokentta(kenttanumero); 
    61          
     60 
     61        MultiSelectWindow valikko = new MultiSelectWindow("Are you alone?", "Start game", "Exit"); 
     62        valikko.Color = Color.DarkRed; 
     63        valikko.SetButtonColor(Color.DarkRed); 
     64        valikko.AddItemHandler(0, delegate { luokentta(kenttanumero); }); 
     65        valikko.AddItemHandler(1, delegate { Exit(); }); 
     66        Add(valikko); 
    6267    } 
    6368 
     
    143148        map.SetTileMethod(new Color(50, 200, 50), luokirjahylly); 
    144149        map.SetTileMethod(new Color(255, 20, 255), luospessuovi); 
     150        map.SetTileMethod(new Color(190, 190, 190), luopatsas); 
    145151 
    146152 
     
    168174 
    169175 
     176    } 
     177    void luopatsas(Vector paikka, double leveys, double korkeus) 
     178    { 
     179        PhysicsObject patsas = PhysicsObject.CreateStaticObject(100, 100); 
     180        patsas.Position = paikka; 
     181        patsas.Image = patsaankuva; 
     182        patsas.Tag = "patsas"; 
     183        Add(patsas); 
     184        AddCollisionHandler(patsas, "aj", ajnerokkuudet); 
    170185    } 
    171186    void luospessuavain(Vector paikka, double leveys, double korkeus) 
     
    190205        spessunautto.X = Screen.Left + 90; 
    191206        spessunautto.Y = Screen.Top - 130; 
     207        spessunautto.Title = "Demon keys"; 
    192208        spessunautto.TextColor = Color.Red; 
    193209        spessunautto.Color = Color.Black; 
     
    197213    void luospessuovi(Vector paikka, double leveys, double korkeus) 
    198214    { 
    199  
    200215        PhysicsObject spessuovi = PhysicsObject.CreateStaticObject(100, 100); 
    201216        spessuovi.Position = paikka; 
     
    271286        else if (asia.Tag == "piano") 
    272287        { 
    273             MessageDisplay.Add("Aj, You can't play piano right now."); 
    274  
     288            MessageDisplay.Add("Aj, You don't know how to play piano."); 
    275289        } 
    276290        else if (asia.Tag == "kirjahylly") 
    277291        { 
    278             MessageDisplay.Add("You can read books later Aj."); 
     292            MessageDisplay.Add("You can't read Aj."); 
     293        } 
     294        else if (asia.Tag == "patsas") 
     295        { 
     296            MessageDisplay.Add("It's a fine statue."); 
    279297        } 
    280298    } 
     
    441459        avainnautto.Color = Color.Black; 
    442460        avainnautto.BindTo(avainlaskuri); 
     461        avainnautto.Title = "Keys"; 
    443462        Add(avainnautto); 
    444463    } 
  • 2014/23/OtsoL/Are you alone/Are you alone/Are you aloneContent/Are you aloneContent.contentproj

    r4884 r4886  
    339339    </Compile> 
    340340  </ItemGroup> 
     341  <ItemGroup> 
     342    <Compile Include="statue.png"> 
     343      <Name>statue</Name> 
     344      <Importer>TextureImporter</Importer> 
     345      <Processor>TextureProcessor</Processor> 
     346    </Compile> 
     347  </ItemGroup> 
    341348  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    342349  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
Note: See TracChangeset for help on using the changeset viewer.