Changeset 1892 for 2011


Ignore:
Timestamp:
2011-06-10 12:24:07 (12 years ago)
Author:
iltakuop
Message:
 
Location:
2011/23/iltakuop/Blocks/Blocks
Files:
1 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • 2011/23/iltakuop/Blocks/Blocks/Blocks/Peli2.cs

    r1871 r1892  
    5959    Image mailanKuva = LoadImage("Maila"); 
    6060    Image elämänKuva = LoadImage("elämä"); 
     61    Image tasomKuva = LoadImage("mtaso"); 
    6162 
    6263    List<Image> kuvat = new List<Image>(); 
     
    7273    List<Label> valikonKohdat; 
    7374    List<PhysicsObject> tasot = new List<PhysicsObject>(); 
     75    List<PhysicsObject> mtasot = new List<PhysicsObject>(); 
    7476    List<PhysicsObject> taso2t = new List<PhysicsObject>(); 
    7577    List<PhysicsObject> tntt = new List<PhysicsObject>(); 
     
    202204 
    203205        Label kohta1 = new Label("Palikat"); 
    204         kohta1.Position = new Vector(-200, 200); 
     206        kohta1.Position = new Vector(-300, 200); 
    205207        valikonKohdat.Add(kohta1); 
    206208        kohta1.TextColor = Color.White; 
    207209 
    208210        Label kohta2 = new Label("Powerupit"); 
    209         kohta2.Position = new Vector(200, 200); 
     211        kohta2.Position = new Vector(300, 200); 
    210212        valikonKohdat.Add(kohta2); 
    211213        kohta2.TextColor = Color.White; 
     
    216218        kohta1a.TextColor = Color.White; 
    217219 
    218          
    219  
    220220        Label kohta1b1 = new Label("Vahvistettu palikka, vaatii"); 
    221221        kohta1b1.Position = new Vector(Level.Left + 283, 100); 
     
    228228        kohta1b2.TextColor = Color.White; 
    229229 
    230  
    231230        Label kohta1c1 = new Label("TNT palikka, räjähtää"); 
    232231        kohta1c1.Position = new Vector(Level.Left + 261, 25); 
     
    240239 
    241240        Label kohta1d = new Label("Tuhoutumaton seinä"); 
    242         kohta1d.Position = new Vector(Level.Left + 257, -50); 
     241        kohta1d.Position = new Vector(Level.Left + 258, -50); 
    243242        valikonKohdat.Add(kohta1d); 
    244243        kohta1d.TextColor = Color.White; 
     244 
     245        Label kohta1e1 = new Label("Tykkipalikka, ampuu alas kuteja,"); 
     246        kohta1e1.Position = new Vector(Level.Left + 320, -100); 
     247        valikonKohdat.Add(kohta1e1); 
     248        kohta1e1.TextColor = Color.White; 
     249 
     250        Label kohta1e2 = new Label("jotka voivat tuhota mailan"); 
     251        kohta1e2.Position = new Vector(Level.Left + 288, -125); 
     252        valikonKohdat.Add(kohta1e2); 
     253        kohta1e2.TextColor = Color.White; 
     254 
     255 
     256 
     257        Label kohta2a1 = new Label("Pistepowerupit, kerää ne ja"); 
     258        kohta2a1.Position = new Vector(Level.Left + 800, 150); 
     259        valikonKohdat.Add(kohta2a1); 
     260        kohta2a1.TextColor = Color.White; 
     261 
     262        Label kohta2a2 = new Label("saat pisteitä, jotka"); 
     263        kohta2a2.Position = new Vector(Level.Left + 758, 125); 
     264        valikonKohdat.Add(kohta2a2); 
     265        kohta2a2.TextColor = Color.White; 
     266 
     267        Label kohta2a3 = new Label("vaihtelevat 1 000 - 5 000"); 
     268        kohta2a3.Position = new Vector(Level.Left + 792, 100); 
     269        valikonKohdat.Add(kohta2a3); 
     270        kohta2a3.TextColor = Color.White; 
     271 
     272        Label kohta2b1 = new Label("Mailapowerupit, kerää mailaa"); 
     273        kohta2b1.Position = new Vector(Level.Left + 814, 50); 
     274        valikonKohdat.Add(kohta2b1); 
     275        kohta2b1.TextColor = Color.White; 
     276 
     277        Label kohta2b2 = new Label("suurentavaa poweruppia, mutta"); 
     278        kohta2b2.Position = new Vector(Level.Left + 828, 25); 
     279        valikonKohdat.Add(kohta2b2); 
     280        kohta2b2.TextColor = Color.White; 
     281 
     282        Label kohta2b3 = new Label("varo mailaa pienentävää poweruppia"); 
     283        kohta2b3.Position = new Vector(Level.Left + 854, 0); 
     284        valikonKohdat.Add(kohta2b3); 
     285        kohta2b3.TextColor = Color.White; 
     286 
     287        Label kohta2c1 = new Label("Pallopowerupit, kerää palloa"); 
     288        kohta2c1.Position = new Vector(Level.Left + 809, -50); 
     289        valikonKohdat.Add(kohta2c1); 
     290        kohta2c1.TextColor = Color.White; 
     291 
     292        Label kohta2c2 = new Label("suurentavaa poweruppia, mutta"); 
     293        kohta2c2.Position = new Vector(Level.Left + 828, -75); 
     294        valikonKohdat.Add(kohta2c2); 
     295        kohta2c2.TextColor = Color.White; 
     296 
     297        Label kohta2c3 = new Label("varo palloa pienentävää poweruppia"); 
     298        kohta2c3.Position = new Vector(Level.Left + 851, -100); 
     299        valikonKohdat.Add(kohta2c3); 
     300        kohta2c3.TextColor = Color.White; 
     301 
     302        Label kohta2d1 = new Label("Elämäpowerupit, saat niistä"); 
     303        kohta2d1.Position = new Vector(Level.Left + 808, -150); 
     304        valikonKohdat.Add(kohta2d1); 
     305        kohta2d1.TextColor = Color.White; 
     306 
     307        elämä = new PhysicsObject(25, 25); 
     308        elämä.IgnoresCollisionResponse = true; 
     309        elämä.Position = new Vector(Level.Left + 620, -140); 
     310        elämä.Image = elämänKuva; 
     311        Add(elämä); 
     312 
     313        PhysicsObject Power8 = new PhysicsObject(25, 25); 
     314        Power8.IgnoresCollisionResponse = true; 
     315        Power8.Position = new Vector(Level.Left + 620, -80); 
     316        Power8.Image = kuvat[7]; 
     317        Add(Power8); 
     318 
     319        PhysicsObject Power9 = new PhysicsObject(25, 25); 
     320        Power9.IgnoresCollisionResponse = true; 
     321        Power9.Position = new Vector(Level.Left + 590, -50); 
     322        Power9.Image = kuvat[8]; 
     323        Add(Power9); 
     324 
     325        PhysicsObject Power7 = new PhysicsObject(25, 25); 
     326        Power7.IgnoresCollisionResponse = true; 
     327        Power7.Position = new Vector(Level.Left + 620, 10); 
     328        Power7.Image = kuvat[6]; 
     329        Add(Power7); 
     330 
     331        PhysicsObject Power6 = new PhysicsObject(25, 25); 
     332        Power6.IgnoresCollisionResponse = true; 
     333        Power6.Position = new Vector(Level.Left + 590, 40); 
     334        Power6.Image = kuvat[5]; 
     335        Add(Power6); 
     336 
     337        PhysicsObject Power2 = new PhysicsObject(25, 25); 
     338        Power2.IgnoresCollisionResponse = true; 
     339        Power2.Position = new Vector(Level.Left + 620, 100); 
     340        Power2.Image = kuvat[2]; 
     341        Add(Power2); 
     342 
     343        PhysicsObject Power3 = new PhysicsObject(25, 25); 
     344        Power3.IgnoresCollisionResponse = true; 
     345        Power3.Position = new Vector(Level.Left + 590, 130); 
     346        Power3.Image = kuvat[1]; 
     347        Add(Power3); 
     348 
     349        Label kohta2d2 = new Label("lisäelämän ja 200 lisäpistettä"); 
     350        kohta2d2.Position = new Vector(Level.Left + 816, -175); 
     351        valikonKohdat.Add(kohta2d2); 
     352        kohta2d2.TextColor = Color.White; 
    245353 
    246354        foreach (Label valikonKohta in valikonKohdat) 
     
    255363 
    256364        PhysicsObject ohjeTaso2 = lisaaTaso2(); 
    257         ohjeTaso2.Position = new Vector(Level.Left + 100, 80); 
     365        ohjeTaso2.Position = new Vector(Level.Left + 100, 85); 
    258366        ohjeTaso2.Size = new Vector(80, 20); 
    259367        Add(ohjeTaso2); 
     
    269377        Add(ohjeTuhoutumaton); 
    270378 
    271  
    272         Keyboard.Listen(Key.Escape, ButtonState.Pressed, Lopeta, ""); 
     379        //PhysicsObject ohjeTuhoutumaton = lisaaTasoTuhoutumaton(); TYKKIPALIKKA 
     380        //ohjeTuhoutumaton.Position = new Vector(Level.Left + 100, -90); 
     381        //ohjeTuhoutumaton.Size = new Vector(80, 20); 
     382        //Add(ohjeTuhoutumaton); 
     383 
     384        //PhysicsObject ohjePower1 = ; 
     385        //ohjePower1.Position = new Vector(Level.Left + 600, 150); 
     386        //ohjePower1.Size = new Vector(20, 20); 
     387        //Add(ohjePower1); 
     388 
     389 
     390 
     391        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Valikko, ""); 
    273392    } 
    274393 
     
    311430        //kohta3.TextSize = ; 
    312431 
    313         Label kohta3a = new Label("Miro Aurala"); 
     432        Label kohta3a = new Label("Miro Aurela"); 
    314433        kohta3a.Position = new Vector(0, -100); 
    315434        valikonKohdat.Add(kohta3a); 
     
    326445        kohta3c.TextColor = Color.White; 
    327446 
    328         Label kohta3d = new Label("Jyväskylän yliopisto & Keski-Suomen opisto"); 
     447        Label kohta3d = new Label("Ville Hakulinen"); 
    329448        kohta3d.Position = new Vector(0, -175); 
    330449        valikonKohdat.Add(kohta3d); 
    331450        kohta3d.TextColor = Color.White; 
    332451 
     452        Label kohta3e = new Label("Jyväskylän yliopisto & Keski-Suomen opisto"); 
     453        kohta3e.Position = new Vector(0, -200); 
     454        valikonKohdat.Add(kohta3e); 
     455        kohta3e.TextColor = Color.White; 
     456 
    333457        foreach (Label valikonKohta in valikonKohdat) 
    334458        { 
     
    336460        } 
    337461 
    338         Keyboard.Listen(Key.Escape, ButtonState.Pressed, Lopeta, ""); 
     462        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Valikko, ""); 
    339463    } 
    340464 
     
    390514        Mouse.IsCursorVisible = true; 
    391515        Mouse.ListenMovement(1.0, ValikossaLiikkuminen2, null); 
    392         Keyboard.Listen(Key.Escape, ButtonState.Pressed, Lopeta, ""); 
     516        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Valikko, ""); 
    393517    } 
    394518 
     
    577701            TarkistaVoitto(); 
    578702        } 
     703 
     704        if (kohde.Tag.ToString() == "-taso") 
     705        { 
     706            pisteet -= 100; 
     707            mtasot.Remove(kohde); 
     708            Timer.SingleShot(0.01, kohde.Destroy); 
     709        } 
     710 
    579711        if (kohde.Tag.ToString() == "taso2") 
    580712        { 
     
    594726             
    595727        } 
     728 
     729 
    596730        if (kohde.Tag.ToString() == "TNT") 
    597731        { 
     
    830964            kentta['_'] = LuoAlaReuna; 
    831965            kentta['y'] = LuoYläReuna; 
     966            kentta['M'] = lisaamTaso; 
    832967            kentta.Insert(20, 20); 
    833968        } 
     
    854989    } 
    855990 
     991    PhysicsObject lisaamTaso() 
     992    { 
     993        PhysicsObject mtaso = PhysicsObject.CreateStaticObject(40, 10); 
     994        mtaso.Tag = "-taso"; 
     995        mtaso.Image = tasomKuva; 
     996        mtaso.Restitution = 1.0; 
     997        mtasot.Add(mtaso); 
     998        return mtaso; 
     999    } 
     1000 
     1001    PhysicsObject lisaaTykkiTaso() 
     1002    { 
     1003        PhysicsObject taso = PhysicsObject.CreateStaticObject(40, 10); 
     1004        taso.Tag = "taso"; 
     1005        taso.Image = tasoKuva; 
     1006        taso.Restitution = 1.0; 
     1007        tasot.Add(taso); 
     1008        return taso; 
     1009    } 
     1010 
     1011 
    8561012    PhysicsObject lisaaTasoTuhoutumaton() 
    8571013    { 
  • 2011/23/iltakuop/Blocks/Blocks/BlocksContent/BlocksContent.contentproj

    r1837 r1892  
    197197    </Compile> 
    198198  </ItemGroup> 
     199  <ItemGroup> 
     200    <Compile Include="mtaso.png"> 
     201      <Name>mtaso</Name> 
     202      <Importer>TextureImporter</Importer> 
     203      <Processor>TextureProcessor</Processor> 
     204    </Compile> 
     205  </ItemGroup> 
    199206  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    200207  <!--  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.