Changeset 5540 for 2014/30


Ignore:
Timestamp:
2014-07-22 15:00:38 (9 years ago)
Author:
athebla
Message:

Peli päivitetty ja tekstuurit lisätty

Location:
2014/30/AtteB
Files:
15 added
20 edited

Legend:

Unmodified
Added
Removed
  • 2014/30/AtteB/Peli/Peli/Peli/Peli.cs

    r5531 r5540  
    77using Jypeli.Widgets; 
    88 
     9class Vihollinen : PhysicsObject 
     10{ 
     11    private IntMeter elamaLaskuri = new IntMeter(3, 0, 3); 
     12    public IntMeter ElamaLaskuri { get { return elamaLaskuri; } } 
     13 
     14    public Vihollinen(double leveys, double korkeus) 
     15        : base(leveys, korkeus) 
     16    { 
     17        elamaLaskuri.LowerLimit += delegate { this.Destroy(); }; 
     18    } 
     19} 
     20 
    921public class Peli : PhysicsGame 
    1022{ 
     23    int pelaajanTerveys = 100; 
     24 
     25    DoubleMeter P1Elämät; 
     26 
    1127    const double nopeus = 200; 
    1228    const double hyppyNopeus = 750; 
     
    1430 
    1531    PlatformCharacter pelaaja1; 
    16     PlatformCharacter Vihollinen_1; 
    17  
    18     Image pelaajanKuva = LoadImage("norsu"); 
     32    PlatformCharacter vihollinen1; 
     33 
    1934    Image tahtiKuva = LoadImage("tahti"); 
    20     Image StoneKuva = LoadImage("Stone_brick_tile"); 
    21     Image StoneTaso = LoadImage("Stone"); 
     35    Image StoneKuva = LoadImage("StoneWall"); 
     36    Image StoneTaso = LoadImage("Stone_katto"); 
     37    Image StoneKuva_katto = LoadImage("Stone_katto"); 
     38    Image Pelaaja_Seisoo = LoadImage("Pelaaja_Seisoo"); 
     39    Image Pelaaja_Juoksee = LoadImage("Pelaaja_Juoksee"); 
     40    Image StoneBrickTaso = LoadImage("Stone_brick_tile"); 
     41    Image Slime = LoadImage("Slime"); 
    2242 
    2343    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     
    2646    { 
    2747        Gravity = new Vector(0, -1000); 
     48 
     49        IsMouseVisible = true; 
     50        SetWindowSize(1000, 800); 
    2851 
    2952        LuoKentta(); 
     
    3356        Camera.ZoomFactor = 1.2; 
    3457        Camera.StayInLevel = true; 
     58 
     59        SmoothTextures = false; 
     60 
     61        P1Elämät= new DoubleMeter(100); 
     62        P1Elämät.MaxValue = 100; 
     63 
     64        BarGauge P1Elämä = new BarGauge(20, Screen.Width / 3); 
     65        P1Elämä.X = Screen.Left + Screen.Width / 2; 
     66        P1Elämä.Y = Screen.Top - 200; 
     67        P1Elämä.Angle = Angle.FromDegrees(90); 
     68        P1Elämä.BindTo(P1Elämät); 
     69        P1Elämä.Color = Color.BloodRed; 
     70        P1Elämä.BarColor = Color.Cyan; 
     71        Add(P1Elämä); 
     72 
    3573    } 
    3674 
     
    4280        kentta.SetTileMethod('N', LisaaPelaaja); 
    4381        kentta.SetTileMethod('P', LisaaStoneLattia); 
     82        kentta.SetTileMethod('+', LisaaStoneKatto); 
     83        kentta.SetTileMethod('?', LisaaStoneBrickLattia); 
     84        kentta.SetTileMethod('S', LuoSlime); 
    4485        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4586        Level.CreateBorders(); 
     
    66107    } 
    67108 
     109    void LisaaStoneBrickLattia(Vector paikka, double leveys, double korkeus) 
     110    { 
     111        PhysicsObject stoneBrick = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     112        stoneBrick.IgnoresCollisionResponse = false; 
     113        stoneBrick.Position = paikka; 
     114        stoneBrick.Image = StoneBrickTaso; 
     115        Add(stoneBrick); 
     116 
     117    } 
     118 
     119 
     120    void LisaaStoneKatto(Vector paikka, double leveys, double korkeus) 
     121    { 
     122        PhysicsObject Stone = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     123        Stone.IgnoresCollisionResponse = true; 
     124        Stone.Position = paikka; 
     125        Stone.Image = StoneKuva_katto; 
     126        Add(Stone); 
     127 
     128    } 
     129 
     130 
    68131    void LisaaTahti(Vector paikka, double leveys, double korkeus) 
    69132    { 
     
    81144        pelaaja1.Position = paikka; 
    82145        pelaaja1.Mass = 10.0; 
    83         pelaaja1.Image = pelaajanKuva; 
     146        pelaaja1.Image = Pelaaja_Seisoo; 
    84147        AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 
    85148        Add(pelaaja1); 
     
    120183        tahti.Destroy(); 
    121184    } 
     185 
     186    void LuoVihollinen(Vector paikka, double leveys, double korkeus) 
     187    { 
     188        PhysicsObject vihollinen = new PhysicsObject(leveys, korkeus); 
     189        vihollinen.Position = paikka; 
     190        vihollinen.Tag = "pahis"; 
     191        Add(vihollinen); 
     192    } 
     193 
     194    void LuoHealthPotion(Vector paikka, double leveys, double korkeus) 
     195    { 
     196        PhysicsObject potion = new PhysicsObject(leveys, korkeus); 
     197        potion.Position = paikka; 
     198        potion.Tag = "health"; 
     199        Add(potion); 
     200    } 
     201 
     202    void TörmäysKäsittelijät() 
     203    { 
     204        AddCollisionHandler(pelaaja1, "pahis", PelaajaOsuu); 
     205        AddCollisionHandler(pelaaja1, "health", PelaajaParantuu); 
     206    } 
     207 
     208    void PelaajaOsuu(PhysicsObject pelaaja1, PhysicsObject kohde) 
     209    { 
     210        pelaajanTerveys--; 
     211 
     212        if (pelaajanTerveys <= 0) 
     213            pelaaja1.Destroy(); 
     214    } 
     215 
     216    void PelaajaParantuu(PhysicsObject pelaaja1, PhysicsObject kohde) 
     217    { 
     218        pelaajanTerveys++; 
     219    } 
     220 
     221    void LuoSlime(Vector paikka, double leveys, double korkeus) 
     222    { 
     223        Vihollinen Slime1 = new Vihollinen(40, 40); 
     224        Slime1.X = 20; 
     225        Slime1.Y = 20; 
     226        Slime1.Image = Slime; 
     227 
     228    } 
    122229} 
  • 2014/30/AtteB/Peli/Peli/Peli/Peli.csproj.Debug.cachefile

    r5531 r5540  
    77Content\Stone_brick_tile.xnb 
    88Content\Stone.xnb 
     9Content\Stone_katto.xnb 
     10Content\Pelaaja_seisoo_vasen.xnb 
     11Content\Pelaaja_Seisoo.xnb 
     12Content\Stonewall.xnb 
     13Content\Slime.xnb 
  • 2014/30/AtteB/Peli/Peli/Peli/Properties/AssemblyInfo.cs

    r5531 r5540  
    99[assembly: AssemblyProduct("Peli")] 
    1010[assembly: AssemblyDescription("")] 
    11 [assembly: AssemblyCompany("University of Jyvaskyla")] 
    12 [assembly: AssemblyCopyright("Copyright © University of Jyvaskyla 2014")] 
     11[assembly: AssemblyCompany("AtteB")] 
     12[assembly: AssemblyCopyright("Copyright © AtteB")] 
    1313[assembly: AssemblyTrademark("")] 
    1414[assembly: AssemblyCulture("")] 
  • 2014/30/AtteB/Peli/Peli/Peli/obj/x86/Debug/ContentPipeline-{2D86B228-748C-44C7-93B1-DCBD6910317C}.xml

    r5531 r5540  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2014-07-22T10:58:11.3529758+03:00</Time> 
     38      <Time>2014-07-22T14:35:50.3392059+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    7373      <Output>C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Stone.xnb</Output> 
    7474      <Time>2014-07-22T10:46:11.0413632+03:00</Time> 
     75    </Item> 
     76    <Item> 
     77      <Source>Stone_katto.png</Source> 
     78      <Name>Stone_katto</Name> 
     79      <Importer>TextureImporter</Importer> 
     80      <Processor>TextureProcessor</Processor> 
     81      <Options>None</Options> 
     82      <Output>C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Stone_katto.xnb</Output> 
     83      <Time>2014-07-22T13:37:03.1545227+03:00</Time> 
     84    </Item> 
     85    <Item> 
     86      <Source>Pelaaja_seisoo_vasen.png</Source> 
     87      <Name>Pelaaja_seisoo_vasen</Name> 
     88      <Importer>TextureImporter</Importer> 
     89      <Processor>TextureProcessor</Processor> 
     90      <Options>None</Options> 
     91      <Output>C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Pelaaja_seisoo_vasen.xnb</Output> 
     92      <Time>2014-07-22T13:08:49.0188633+03:00</Time> 
     93    </Item> 
     94    <Item> 
     95      <Source>Pelaaja_Seisoo.png</Source> 
     96      <Name>Pelaaja_Seisoo</Name> 
     97      <Importer>TextureImporter</Importer> 
     98      <Processor>TextureProcessor</Processor> 
     99      <Options>None</Options> 
     100      <Output>C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Pelaaja_Seisoo.xnb</Output> 
     101      <Time>2014-07-22T13:19:15.0207857+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>Stonewall.png</Source> 
     105      <Name>Stonewall</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108      <Options>None</Options> 
     109      <Output>C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Stonewall.xnb</Output> 
     110      <Time>2014-07-22T13:35:39.5061587+03:00</Time> 
     111    </Item> 
     112    <Item> 
     113      <Source>Slime.png</Source> 
     114      <Name>Slime</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Slime.xnb</Output> 
     119      <Time>2014-07-22T14:06:10.9162814+03:00</Time> 
    75120    </Item> 
    76121    <BuildSuccessful>true</BuildSuccessful> 
  • 2014/30/AtteB/Peli/Peli/Peli/obj/x86/Debug/Peli.csproj.FileListAbsolute.txt

    r5531 r5540  
    1515C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Stone_brick_tile.xnb 
    1616C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Stone.xnb 
     17C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Stone_katto.xnb 
     18C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Pelaaja_seisoo_vasen.xnb 
     19C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Pelaaja_Seisoo.xnb 
     20C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Stonewall.xnb 
     21C:\MyTemp\AtteB\Peli\Peli\Peli\bin\x86\Debug\Content\Slime.xnb 
  • 2014/30/AtteB/Peli/Peli/Peli/obj/x86/Debug/cachefile-{2D86B228-748C-44C7-93B1-DCBD6910317C}-targetpath.txt

    r5531 r5540  
    77Content\Stone_brick_tile.xnb 
    88Content\Stone.xnb 
     9Content\Stone_katto.xnb 
     10Content\Pelaaja_seisoo_vasen.xnb 
     11Content\Pelaaja_Seisoo.xnb 
     12Content\Stonewall.xnb 
     13Content\Slime.xnb 
  • 2014/30/AtteB/Peli/Peli/PeliContent/PeliContent.contentproj

    r5531 r5540  
    9595    </Compile> 
    9696  </ItemGroup> 
     97  <ItemGroup> 
     98    <Compile Include="Stone_katto.png"> 
     99      <Name>Stone_katto</Name> 
     100      <Importer>TextureImporter</Importer> 
     101      <Processor>TextureProcessor</Processor> 
     102    </Compile> 
     103  </ItemGroup> 
     104  <ItemGroup> 
     105    <Compile Include="Pelaaja_seisoo_vasen.png"> 
     106      <Name>Pelaaja_seisoo_vasen</Name> 
     107      <Importer>TextureImporter</Importer> 
     108      <Processor>TextureProcessor</Processor> 
     109    </Compile> 
     110  </ItemGroup> 
     111  <ItemGroup> 
     112    <Compile Include="Pelaaja_Seisoo.png"> 
     113      <Name>Pelaaja_Seisoo</Name> 
     114      <Importer>TextureImporter</Importer> 
     115      <Processor>TextureProcessor</Processor> 
     116    </Compile> 
     117  </ItemGroup> 
     118  <ItemGroup> 
     119    <Compile Include="Stonewall.png"> 
     120      <Name>Stonewall</Name> 
     121      <Importer>TextureImporter</Importer> 
     122      <Processor>TextureProcessor</Processor> 
     123    </Compile> 
     124  </ItemGroup> 
     125  <ItemGroup> 
     126    <Compile Include="Slime.png"> 
     127      <Name>Slime</Name> 
     128      <Importer>TextureImporter</Importer> 
     129      <Processor>TextureProcessor</Processor> 
     130    </Compile> 
     131  </ItemGroup> 
    97132  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    98133  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2014/30/AtteB/Peli/Peli/PeliContent/kentta1.txt

    r5531 r5540  
    1 ########################################################### 
     1+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
    22 
    33 
    4  
    5  
    6  
    7  
    8  
    9        N                               V 
     4  
     5 N 
     6????? 
     7?????? 
     8???????..............?.....?. 
     9????????.............?..S..?.                                   
    1010########################################################### 
  • 2014/30/AtteB/Pong/Pong/Pong/Pong.cs

    r5498 r5540  
    113113    { 
    114114        // Liikuttaa palloa 
    115         Vector impulssi = new Vector(500.0, 0.0); 
     115        double palloLiike = RandomGen.NextDouble(500, -500); 
     116        Vector impulssi = new Vector(palloLiike, 0); 
    116117        pallo.Hit(impulssi); 
    117118    } 
Note: See TracChangeset for help on using the changeset viewer.