Changeset 7983 for 2016/27


Ignore:
Timestamp:
2016-07-07 19:12:59 (3 years ago)
Author:
sieerinn
Message:

Aluksen osien keräys tehty

Location:
2016/27/ohjaajat/VenienteFragore/VenienteFragore
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • 2016/27/ohjaajat/VenienteFragore/VenienteFragore/VenienteFragore/LevelCreationMethods.cs

    r7981 r7983  
    186186            door.Position = position; 
    187187            door.Color = Color.Purple; 
     188            door.Image = LoadImage("portal"); 
    188189            door.OnInteractedWith += delegate (SimplePhysics.Object actor, InteractableObject actedDoor) 
    189190            { 
     
    197198            //Tämä tänne, jotta anim. tai jotain jos joskus halutaan, muuten suoraan voi vaihtaa kenttää delegattissa 
    198199            StartLevel(lvlName); 
     200        } 
     201 
     202        private void CreateShipPart(Vector position, double width, double height, Dictionary<string, string> properties) 
     203        { 
     204            string lvlName = properties["levelName"]; 
     205            var part = new InteractableObject(width, height); 
     206            part.Position = position; 
     207            collectedParts.Add(currentLevelName); 
     208            part.Image = LoadImage(collectedParts.Contains(currentLevelName)?"portal":"shippart"); 
     209            part.OnInteractedWith += delegate 
     210            { 
     211                if (!collectedParts.Contains(currentLevelName)) 
     212                    collectedParts.Add(currentLevelName); 
     213                StartLevel(lvlName); 
     214            }; 
     215            Add(part); 
    199216        } 
    200217 
  • 2016/27/ohjaajat/VenienteFragore/VenienteFragore/VenienteFragore/VenienteFragore.cs

    r7982 r7983  
    2121        private readonly Image[] advenbImages = LoadImages("advenbwalk\\advenb00", 1, 49, true); 
    2222 
    23         private Image advenaBlob = LoadImage("advenaBlob"); 
    24         private Image advenbBlob = LoadImage("advenbBlob"); 
    25  
     23        private readonly Image advenaBlob = LoadImage("advenaBlob"); 
     24        private readonly Image advenbBlob = LoadImage("advenbBlob"); 
     25         
    2626        private readonly Image advenaCrouch = LoadImage("advenacrouch"); 
    2727        private readonly Image advenbCrouch = LoadImage("advenbcrouch"); 
    2828 
     29        // Lista kenttien nimistä, joista aluksen osa on kerätty. 
     30        private string currentLevelName; 
     31        private readonly List<string> collectedParts = new List<string>(); 
     32 
    2933        private List<Player> advenae; 
    3034 
     
    5357        private void StartLevel(string lvlName) 
    5458        { 
     59            currentLevelName = lvlName; 
     60 
    5561            ClearAll(); 
    5662            advenae = new List<Player>(); 
     
    6369            objectMethods.Add("goomba2", CreateGoomba2); 
    6470            objectMethods.Add("drip", CreateWaterDrip); 
     71            objectMethods.Add("shippart", CreateShipPart); 
    6572 
    6673            string backgroundImageName = null; 
  • 2016/27/ohjaajat/VenienteFragore/VenienteFragore/VenienteFragoreContent/VenienteFragoreContent.contentproj

    r7981 r7983  
    648648    </Compile> 
    649649  </ItemGroup> 
     650  <ItemGroup> 
     651    <Compile Include="shippart.png"> 
     652      <Name>shippart</Name> 
     653      <Importer>TextureImporter</Importer> 
     654      <Processor>TextureProcessor</Processor> 
     655    </Compile> 
     656  </ItemGroup> 
     657  <ItemGroup> 
     658    <Compile Include="portal.png"> 
     659      <Name>portal</Name> 
     660      <Importer>TextureImporter</Importer> 
     661      <Processor>TextureProcessor</Processor> 
     662    </Compile> 
     663  </ItemGroup> 
    650664  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    651665  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/27/ohjaajat/VenienteFragore/VenienteFragore/VenienteFragoreContent/desolatecaves.tmx

    r7982 r7983  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <map version="1.0" orientation="orthogonal" renderorder="right-down" width="120" height="40" tilewidth="50" tileheight="50" nextobjectid="14"> 
     2<map version="1.0" orientation="orthogonal" renderorder="right-down" width="120" height="40" tilewidth="50" tileheight="50" nextobjectid="18"> 
    33 <properties> 
    44  <property name="background" value="cavebackground"/> 
     
    2929  <object id="11" name="goomba2" type="goomba2" gid="9" x="4950" y="1950" width="50" height="50"/> 
    3030  <object id="12" name="goomba" type="goomba" gid="9" x="3650" y="1500" width="50" height="50"/> 
    31   <object id="13" type="door" gid="2" x="200" y="1700" width="50" height="50"> 
     31  <object id="15" name="shippart" type="shippart" x="5700" y="1850" width="50" height="50"> 
     32   <properties> 
     33    <property name="levelName" value="thehub"/> 
     34   </properties> 
     35  </object> 
     36  <object id="17" name="door" type="door" gid="1" x="200" y="1700" width="50" height="50"> 
    3237   <properties> 
    3338    <property name="levelName" value="thehub"/> 
Note: See TracChangeset for help on using the changeset viewer.