Changeset 1213 for 2010


Ignore:
Timestamp:
2010-07-09 10:45:08 (13 years ago)
Author:
frjolehm
Message:

Lisäsin 2 uutta mappia.

Location:
2010/27/frjolehm/The King of the island/The King of the island
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2010/27/frjolehm/The King of the island/The King of the island/Content/Content.contentproj

    r1190 r1213  
    9898    </Compile> 
    9999  </ItemGroup> 
     100  <ItemGroup> 
     101    <Compile Include="Kenttä3.png"> 
     102      <Name>Kenttä3</Name> 
     103      <Importer>TextureImporter</Importer> 
     104      <Processor>TextureProcessor</Processor> 
     105    </Compile> 
     106  </ItemGroup> 
     107  <ItemGroup> 
     108    <Compile Include="Kenttä4.png"> 
     109      <Name>Kenttä4</Name> 
     110      <Importer>TextureImporter</Importer> 
     111      <Processor>TextureProcessor</Processor> 
     112    </Compile> 
     113  </ItemGroup> 
    100114</Project> 
  • 2010/27/frjolehm/The King of the island/The King of the island/Peli.cs

    r1190 r1213  
    7171            pelaaja1 = LuoUkko(Level.Left + 30,Level.Bottom + 75,85, 75,"Tipu1"); 
    7272            pelaaja2 = LuoUkko(Level.Left+ 30,Level.Bottom + 200,85, 75,"Tipu2"); 
    73  
    7473            LuoAikaLaskuri(); 
    7574        } 
     
    7877         
    7978            Camera.Reset(); 
     79 
     80            Camera.Y = Level.Bottom + 250; 
     81            double ZoomKerroin = Screen.Height / 800; 
     82            Camera.Zoom(ZoomKerroin); //0.85 
    8083 
    8184            LuoKenttä(30000, 1000); 
     
    103106            LuoKenttä(800, 700); 
    104107            Camera.ZoomToLevel(); 
     108            Level.Background.Image = LoadImage("Kenttä3"); 
    105109            Camera.Y = 0; 
    106110 
     
    108112 
    109113            pelaaja1 = LuoUkko(Level.Left + 100, Level.Bottom + 75, 85, 75, "Tipu1"); 
    110             pelaaja2 = LuoUkko(Level.Left + 30, Level.Bottom + 75, 85, 75, "Tipu2"); 
     114            pelaaja2 = LuoUkko(Level.Right - 100, Level.Bottom + 75, 85, 75, "Tipu2"); 
    111115 
    112116            Gravity = new Vector(0, -600); 
    113  
     117            AjastaPallot(Color.Blue); 
    114118            LuoAikaLaskuri(); 
    115119        } 
    116  
     120        else if (peliMuoto == 4) 
     121        { 
     122            Camera.Reset(); 
     123 
     124            LuoKenttä(800, 700); 
     125            Camera.ZoomToLevel(); 
     126            Level.Background.Image = LoadImage("Kenttä4"); 
     127            Camera.Y = 0; 
     128 
     129            LuoElämät(); 
     130 
     131            pelaaja1 = LuoUkko(Level.Left + 100, Level.Bottom + 75, 85, 75, "Tipu1"); 
     132            pelaaja2 = LuoUkko(Level.Right - 100, Level.Bottom + 75, 85, 75, "Tipu2"); 
     133 
     134            Gravity = new Vector(0, -700); 
     135            AjastaPallot(Color.Yellow); 
     136            LuoAikaLaskuri(); 
     137        } 
     138 
     139    } 
     140 
     141    void AjastaPallot(Color väri) 
     142    { 
     143        Timer palloAjastin = new Timer(); 
     144        palloAjastin.Interval = 5; 
     145        palloAjastin.Trigger += LuoPallo; 
     146        Add(palloAjastin); 
     147        palloAjastin.Tag = väri; 
     148        palloAjastin.Start(); 
     149    } 
     150 
     151    void LuoPallo(Timer sender) 
     152    { 
     153        PhysicsObject pallo = new PhysicsObject(20, 20, Shapes.Circle); 
     154        pallo.Color = (Color)sender.Tag; 
     155        pallo.Hit(new Vector(RandomGen.NextDouble(-100, 100), RandomGen.NextDouble(-200, -400))); 
     156        pallo.Y = Level.Top - 300; 
     157        AddCollisionHandler(pallo, Voitto); 
     158        pallo.Restitution = 1.0; 
     159        Add(pallo); 
    117160    } 
    118161 
     
    295338                    LuoVoittaja(pelaaja1, pelaaja2); 
    296339                } 
    297                 else if (peliMuoto == 2) 
     340                else if (peliMuoto == 2 || peliMuoto == 3) 
    298341                { 
    299342                    Pelaajan1joukkue--; 
     
    309352                    LuoVoittaja(pelaaja2, pelaaja1); 
    310353                } 
    311                 else if (peliMuoto == 2) 
     354                else if (peliMuoto == 2 || peliMuoto == 3) 
    312355                { 
    313356                    Pelaajan2joukkue--; 
Note: See TracChangeset for help on using the changeset viewer.