Changeset 7381 for 2016/24/EemeliN


Ignore:
Timestamp:
2016-06-16 14:56:30 (7 years ago)
Author:
eeonilni
Message:
 
Location:
2016/24/EemeliN/Test
Files:
10 added
4 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/EemeliN/Test/Test/Test/Test.cs

    r7331 r7381  
    1212    PlatformCharacter Pelaaja2; 
    1313    int kenttaNro = 1; 
    14      
     14 
     15    SoundEffect jungle = LoadSoundEffect("Jungle"); 
    1516 
    1617    Image pahisKuva = LoadImage("t04_evilrat"); 
     
    1920    private Image[] Animaatio2 = LoadImages("Pelaaja2", "Pelaaja2a"); 
    2021 
     22    Image kuva = LoadImage("Deagle"); 
     23    Image kuva2 = LoadImage("Cannon"); 
     24 
     25 
    2126    public override void Begin() 
    2227    { 
    23         LuoKentta("Kenttä"); 
    2428        SeuraavaKentta(); 
    25  
    26         Gravity = new Vector(0, -500); 
    27  
    28         AsetaOhjaimet(); 
    29  
    30         Level.CreateBorders(); 
    31         SmoothTextures = true; 
    32  
    33         Pelaaja1.Restitution = 1.0; 
    34         Pelaaja1.Restitution = 1.0; 
    35  
    36         GameObject tausta = new GameObject(Level.Width, Level.Height); 
    37         tausta.Image = LoadImage("Tausta"); 
    38         Add(tausta, -3); 
    39  
    40         PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    41         Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    42  
    43         Camera.Follow(Pelaaja1, Pelaaja2); 
    44         Camera.StayInLevel = true; 
    45         Camera.FollowXMargin = 600; 
    46         Camera.FollowYMargin = 200; 
     29        TaustaMusiikki(); 
     30 
     31 
    4732    } 
    4833 
     
    5641        ruudut.SetTileMethod(Color.FromHexCode("FF6A00"), LuoMaali); 
    5742        ruudut.SetTileMethod(Color.FromHexCode("B682FF"), LuoKanuunaVasen); 
    58         ruudut.SetTileMethod(Color.FromHexCode("FF006E"), LuoKanuunaOikea); 
    59         ruudut.SetTileMethod(Color.Yellow, LuoTaso2); 
     43        ruudut.SetTileMethod(Color.FromHexCode("82FFD9"), LuoKanuunaOikea); 
     44        ruudut.SetTileMethod(Color.FromHexCode("EE00FF"), LuoAse); 
     45        //ruudut.SetTileMethod(Color.FromHexCode("FFB7B5"), SpawnPoint); 
    6046        ruudut.Execute(40, 40); 
     47 
    6148    } 
    6249 
     
    6956        else if (kenttaNro > 2) Exit(); 
    7057 
    71         //ColorTileMap ruudut = ColorTileMap.FromLevelAsset(KentanNimi2); 
    72         //ruudut.SetTileMethod(Color.Yellow, LuoTaso2); 
     58        Gravity = new Vector(0, -800); 
    7359 
    7460        AsetaOhjaimet(); 
    7561 
    76     } 
    77  
    78     
     62        Level.CreateBorders(); 
     63        SmoothTextures = false; 
     64 
     65        Pelaaja1.Restitution = 1.0; 
     66        Pelaaja1.Restitution = 1.0; 
     67 
     68        GameObject tausta = new GameObject(Level.Width, Level.Height); 
     69        tausta.Image = LoadImage("Tausta"); 
     70        Add(tausta, -3); 
     71 
     72        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
     73        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     74 
     75        Camera.Follow(Pelaaja1, Pelaaja2); 
     76        Camera.StayInLevel = true; 
     77        Camera.FollowXMargin = 600; 
     78        Camera.FollowYMargin = 200; 
     79 
     80 
     81        AsetaOhjaimet(); 
     82 
     83    } 
     84 
     85 
    7986 
    8087    void AsetaOhjaimet() 
     
    98105    void LuoPelaaja(Vector paikka, double leveys, double korkeus) 
    99106    { 
     107        Image olionKuva = LoadImage("Abina"); 
     108        Image pelaaja2Kuva = LoadImage("pelaaja2"); 
     109 
    100110        Pelaaja1 = new PlatformCharacter(leveys * 0.9, korkeus * 0.9); 
    101  
     111        Pelaaja1.Shape = Shape.Circle; 
    102112        Pelaaja1.Position = paikka; 
    103  
     113        Pelaaja1.Image = olionKuva; 
    104114        Add(Pelaaja1); 
    105         Pelaaja1.Shape = Shape.Circle; 
    106         Image olionKuva = LoadImage("Abina"); 
    107         Pelaaja1.Image = olionKuva; 
    108115 
    109116        Pelaaja2 = new PlatformCharacter(leveys * 0.9, korkeus * 0.9); 
     
    111118        Pelaaja2.Position = paikka; 
    112119        Pelaaja2.Shape = Shape.Circle; 
    113         Pelaaja2.Image = LoadImage("pelaaja2"); 
     120        Pelaaja2.Image = pelaaja2Kuva; 
     121 
    114122 
    115123        Pelaaja1.AnimWalk = new Animation(Animaatio); 
     
    124132        Pelaaja1.CollisionIgnoreGroup = 100; 
    125133        Pelaaja2.CollisionIgnoreGroup = 100; 
    126  
    127     } 
    128  
     134        AddCollisionHandler(Pelaaja1, "TormaaMaaliin", TormasiMaaliin); 
     135        AddCollisionHandler(Pelaaja2, "TormaaMaaliin", TormasiMaaliin); 
     136 
     137        AddCollisionHandler(Pelaaja1, "vihunammus", Kuolema); 
     138        AddCollisionHandler(Pelaaja2, "vihunammus", Kuolema); 
     139    } 
     140    void Kuolema(PhysicsObject Pelaaja, PhysicsObject ammus) 
     141    { 
     142        Pelaaja.Destroy(); 
     143 
     144        if (Pelaaja2.IsDestroying) 
     145        { 
     146            Camera.Follow(Pelaaja2); 
     147        } 
     148        if (Pelaaja1.IsDestroying) 
     149        { 
     150            Camera.Follow(Pelaaja1); 
     151        } 
     152    } 
    129153 
    130154 
     
    144168        taso.CollisionIgnoreGroup = 1; 
    145169        taso.Image = LoadImage("MeteoriteBrick"); 
    146         Add(taso); 
     170 
     171 
     172 
    147173 
    148174    } 
     
    150176    void LuoMaali(Vector paikka, double leveys, double korkeus) 
    151177    { 
    152         PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys*3, korkeus*3); 
     178        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys * 3, korkeus * 3); 
    153179        taso.Position = paikka; 
    154180        taso.CollisionIgnoreGroup = 1; 
    155181        taso.Image = LoadImage("Maali"); 
     182        taso.Tag = "TormaaMaaliin"; 
    156183        Add(taso); 
    157184 
     
    176203        Flame liekki = new Flame(LoadImage("Flame")); 
    177204        liekki.Position = paikka; 
    178         liekki.MaxLifetime = 3; 
     205        liekki.MaxLifetime = 2.5; 
    179206        liekki.MaxScale = 100; 
    180207        Add(liekki); 
    181208 
    182         //int pMaxMaara = 50; 
    183  
    184  
    185     } 
    186  
    187    
    188      
     209        int pMaxMaara = 500; 
     210 
     211 
     212    } 
     213 
     214 
     215 
    189216 
    190217    void LuoPahis(Vector paikka, double leveys, double korkeus) 
     
    201228    void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
    202229    { 
    203         //ammus.Destroy(); 
     230 
     231        //AddCollisionHandler(Pelaaja1, ammus, KohteetTormaavat); 
     232        ammus.Destroy(); 
     233        Pelaaja1.Destroy(); 
     234        Pelaaja2.Destroy(); 
    204235    } 
    205236 
     
    212243        Add(tykkiTorni); 
    213244 
    214         Image kuva = LoadImage("Deagle"); 
     245 
    215246        Vector koko = new Vector(kuva.Width, kuva.Height) * 0.2; 
    216247 
     
    239270                kuula.Image = LoadImage("t04_evilrat"); 
    240271                kuula.Size *= 3; 
     272                kuula.Tag = "vihunammus"; 
    241273                //boostaa ylös päälläseisottaessa jos kuulan koko = 130=D 
    242274                //.CollisionIgnoreGroup = 30; 
     
    261293    { 
    262294        ammus.Destroy(); 
    263         //ammus.CollisionIgnoreGroup = 30; 
    264     } 
     295        ammus.CollisionIgnoreGroup = 30; 
     296    } 
     297 
     298 
     299    void LuoAse(Vector paikka, double leveys, double korkeus) 
     300    { 
     301        PhysicsObject Ase = new PhysicsObject(leveys, korkeus); 
     302        Ase.Image = null; 
     303        Ase.Position = paikka; 
     304        Ase.MakeStatic(); 
     305        Cannon tykki = new Cannon(50, 10); 
     306        //tykki.ProjectileCollision = AmmusOsui; 
     307        tykki.Ammo.Value = 500; 
     308        tykki.InfiniteAmmo = true; 
     309        tykki.Power.Value = 2000; 
     310        tykki.Power.DefaultValue = 2000; 
     311        tykki.FireRate = 5.0; 
     312        //Ase.AmmoIgnoresGravity = true; 
     313        tykki.AmmoIgnoresGravity = false; 
     314        tykki.MaxAmmoLifetime = TimeSpan.FromSeconds(2); 
     315        tykki.AttackSound = null; 
     316        tykki.Image = kuva2; 
     317        Ase.X = 10.0; 
     318        Ase.Y = -5.0; 
     319        Add(Ase); 
     320    } 
     321 
     322    void TaustaMusiikki() 
     323    { 
     324 
     325 
     326        MediaPlayer.Play("jungle"); 
     327        MediaPlayer.Volume = 10.0; 
     328    } 
     329 
     330    void KohteetTormaavat(PhysicsObject tormaaja, PhysicsObject kohde) 
     331    { 
     332        MessageDisplay.Add("Bump!"); 
     333    } 
     334 
    265335} 
     336 
     337 
  • 2016/24/EemeliN/Test/Test/Test/Test.csproj.Debug.cachefile

    r7331 r7381  
    11Content\Abina.xnb 
    2 Content\KenttÀ.xnb 
    32Content\pelaaja2.xnb 
    43Content\Maa.xnb 
     
    87Content\Flame.xnb 
    98Content\t04_evilrat.xnb 
    10 Content\KenttÀ.2.xnb 
    119Content\MeteoriteBrick.xnb 
    1210Content\Maali.xnb 
    1311Content\Deagle.xnb 
     12Content\KenttÀ.xnb 
     13Content\KenttÀ2.xnb 
     14Content\Cannon.xnb 
     15Content\Jungle.xnb 
     16Content\Jungle.wma 
  • 2016/24/EemeliN/Test/Test/Test/obj/x86/Debug/ContentPipeline-{C4CAFCB8-EF75-4B1C-85B1-17BBB278D09E}.xml

    r7331 r7381  
    1010      <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Abina.xnb</Output> 
    1111      <Time>2016-06-13T11:41:39.3147992+03:00</Time> 
    12     </Item> 
    13     <Item> 
    14       <Source>Kenttä.png</Source> 
    15       <Name>Kenttä</Name> 
    16       <Importer>TextureImporter</Importer> 
    17       <Processor>TextureProcessor</Processor> 
    18       <Options>None</Options> 
    19       <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Kenttä.xnb</Output> 
    20       <Time>2016-06-15T13:55:04.5793618+03:00</Time> 
    2112    </Item> 
    2213    <Item> 
     
    7263      <Options>None</Options> 
    7364      <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Flame.xnb</Output> 
    74       <Time>2016-06-14T13:51:38.5495536+03:00</Time> 
     65      <Time>2016-06-16T10:06:59.171879+03:00</Time> 
    7566    </Item> 
    7667    <Item> 
     
    8273      <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\t04_evilrat.xnb</Output> 
    8374      <Time>2016-06-15T11:09:37.0554971+03:00</Time> 
    84     </Item> 
    85     <Item> 
    86       <Source>Kenttä.2.png</Source> 
    87       <Name>Kenttä.2</Name> 
    88       <Importer>TextureImporter</Importer> 
    89       <Processor>TextureProcessor</Processor> 
    90       <Options>None</Options> 
    91       <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Kenttä.2.xnb</Output> 
    92       <Time>2016-06-15T11:35:16.5509097+03:00</Time> 
    9375    </Item> 
    9476    <Item> 
     
    118100      <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Deagle.xnb</Output> 
    119101      <Time>2016-06-15T13:49:01.3544212+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>Kenttä.png</Source> 
     105      <Name>Kenttä</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108      <Options>None</Options> 
     109      <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Kenttä.xnb</Output> 
     110      <Time>2016-06-16T14:47:41.6687399+03:00</Time> 
     111    </Item> 
     112    <Item> 
     113      <Source>Kenttä2.png</Source> 
     114      <Name>Kenttä2</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Kenttä2.xnb</Output> 
     119      <Time>2016-06-16T11:26:37.4190939+03:00</Time> 
     120    </Item> 
     121    <Item> 
     122      <Source>Cannon.png</Source> 
     123      <Name>Cannon</Name> 
     124      <Importer>TextureImporter</Importer> 
     125      <Processor>TextureProcessor</Processor> 
     126      <Options>None</Options> 
     127      <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Cannon.xnb</Output> 
     128      <Time>2016-06-16T11:37:32.739415+03:00</Time> 
     129    </Item> 
     130    <Item> 
     131      <Source>Jungle.mp3</Source> 
     132      <Name>Jungle</Name> 
     133      <Importer>Mp3Importer</Importer> 
     134      <Processor>SongProcessor</Processor> 
     135      <Options>None</Options> 
     136      <Output>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Jungle.xnb</Output> 
     137      <Extra>C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Jungle.wma</Extra> 
     138      <Time>2016-06-15T10:36:43.044764+03:00</Time> 
    120139    </Item> 
    121140    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/24/EemeliN/Test/Test/Test/obj/x86/Debug/Test.csproj.FileListAbsolute.txt

    r7331 r7381  
    88C:\MyTemp\EemeliN\Test\Test\Test\obj\x86\Debug\Test.csprojResolveAssemblyReference.cache 
    99C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Abina.xnb 
    10 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\KenttÀ.xnb 
    1110C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\pelaaja2.xnb 
    1211C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Maa.xnb 
     
    1615C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Flame.xnb 
    1716C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\t04_evilrat.xnb 
    18 C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\KenttÀ.2.xnb 
    1917C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\MeteoriteBrick.xnb 
    2018C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Maali.xnb 
    2119C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Deagle.xnb 
     20C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\KenttÀ.xnb 
     21C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\KenttÀ2.xnb 
     22C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Cannon.xnb 
     23C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Jungle.xnb 
     24C:\MyTemp\EemeliN\Test\Test\Test\bin\x86\Debug\Content\Jungle.wma 
  • 2016/24/EemeliN/Test/Test/Test/obj/x86/Debug/cachefile-{C4CAFCB8-EF75-4B1C-85B1-17BBB278D09E}-targetpath.txt

    r7331 r7381  
    11Content\Abina.xnb 
    2 Content\KenttÀ.xnb 
    32Content\pelaaja2.xnb 
    43Content\Maa.xnb 
     
    87Content\Flame.xnb 
    98Content\t04_evilrat.xnb 
    10 Content\KenttÀ.2.xnb 
    119Content\MeteoriteBrick.xnb 
    1210Content\Maali.xnb 
    1311Content\Deagle.xnb 
     12Content\KenttÀ.xnb 
     13Content\KenttÀ2.xnb 
     14Content\Cannon.xnb 
     15Content\Jungle.xnb 
     16Content\Jungle.wma 
  • 2016/24/EemeliN/Test/Test/TestContent/TestContent.contentproj

    r7331 r7381  
    102102  </ItemGroup> 
    103103  <ItemGroup> 
    104     <Compile Include="Kenttä.2.png"> 
    105       <Name>Kenttä.2</Name> 
    106       <Importer>TextureImporter</Importer> 
    107       <Processor>TextureProcessor</Processor> 
    108     </Compile> 
    109   </ItemGroup> 
    110   <ItemGroup> 
    111104    <Compile Include="MeteoriteBrick.png"> 
    112105      <Name>MeteoriteBrick</Name> 
     
    122115    </Compile> 
    123116  </ItemGroup> 
    124   <ItemGroup /> 
     117  <ItemGroup> 
     118    <Folder Include="NewFolder1\" /> 
     119  </ItemGroup> 
    125120  <ItemGroup> 
    126121    <Compile Include="Deagle.png"> 
     
    131126  </ItemGroup> 
    132127  <ItemGroup> 
    133     <Compile Include="NewFolder1\Kenttä.png"> 
     128    <Compile Include="Kenttä.png"> 
    134129      <Name>Kenttä</Name> 
    135130      <Importer>TextureImporter</Importer> 
    136131      <Processor>TextureProcessor</Processor> 
     132    </Compile> 
     133  </ItemGroup> 
     134  <ItemGroup> 
     135    <Compile Include="Kenttä2.png"> 
     136      <Name>Kenttä2</Name> 
     137      <Importer>TextureImporter</Importer> 
     138      <Processor>TextureProcessor</Processor> 
     139    </Compile> 
     140  </ItemGroup> 
     141  <ItemGroup> 
     142    <Compile Include="Cannon.png"> 
     143      <Name>Cannon</Name> 
     144      <Importer>TextureImporter</Importer> 
     145      <Processor>TextureProcessor</Processor> 
     146    </Compile> 
     147  </ItemGroup> 
     148  <ItemGroup> 
     149    <Compile Include="Jungle.mp3"> 
     150      <Name>Jungle</Name> 
     151      <Importer>Mp3Importer</Importer> 
     152      <Processor>SongProcessor</Processor> 
    137153    </Compile> 
    138154  </ItemGroup> 
Note: See TracChangeset for help on using the changeset viewer.