Changeset 5404


Ignore:
Timestamp:
2014-07-04 10:24:56 (5 years ago)
Author:
mijoilmo
Message:
 
Location:
2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor
Files:
7 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor.cs

    r5399 r5404  
    4545        images["planet1_background"] = LoadImage("graphics/backgrounds/planet1"); 
    4646        images["planet2_background"] = LoadImage("graphics/backgrounds/planet2"); 
     47        images["planet2_valetta"] = LoadImage("graphics/backgrounds/planet2_valetta"); 
    4748        images["player"] = LoadImage("graphics/ships/player"); 
    48         images["tile0"] = LoadImage("graphics/tiles/tile0"); 
    4949        images["galaxy_map"] = LoadImage("graphics/HUD/galaxy_map"); 
     50 
     51        //kaikki tilet 
     52        images["grass1"] = LoadImage("graphics/tiles/tilenurmi"); 
     53        images["soil1"] = LoadImage("graphics/tiles/tilemulta"); 
    5054 
    5155        imageLists["player_thruster"] = LoadImages("graphics/effects/thrusters/thruster0.1", "graphics/effects/thrusters/thruster0.2"); 
     
    7983            galaxy.CurrentPlanet = galaxy.Planets[level.Id];//aseta galaksiin tiedot nykyisestä planeetasta 
    8084            player.Y = Level.Top - Screen.Height; 
    81             MediaPlayer.Play(galaxy.Planets[level.Id].Music); 
     85            //MediaPlayer.Play(galaxy.Planets[level.Id].Music); 
    8286            //player.x on jotain 
    8387        } 
     
    115119        } 
    116120        GameObject bg = new GameObject(w, h); 
     121        GameObject bg2 = new GameObject(Level.Width, Level.Height); 
    117122        bg.Image = images[id]; 
    118123        if (currentLevel.IsPlanet) 
     
    125130        } 
    126131        bg.X += Level.Width * offset; 
     132        bg2.X += Level.Width * offset; 
    127133        Add(bg, -3); 
     134        
     135        bg2.Image = images["planet2_valetta"]; 
     136        Add(bg2, -2); 
    128137    } 
    129138    void LevelFromImage(ProtoLevel level) 
    130139    { 
    131140        Dictionary<String, String> convert = new Dictionary<String, String>(); 
    132         convert.Add("000000", "tile0"); 
     141        convert.Add("000000", "grass1"); 
    133142        ColorTileMap tileMap = ColorTileMap.FromLevelAsset(level.TileMapSrc); 
    134         tileMap.SetTileMethod(Color.FromHexCode("000000"), createTile, convert["000000"]); 
     143        tileMap.SetTileMethod(Color.FromHexCode("000000"), createTile, convert["000000"], false); 
     144        //tileMap.SetTileMethod(Color.FromHexCode("0000ff"), createTile, convert["0000ff"], true); 
    135145        tileMap.SetTileMethod(Color.FromHexCode("ff0000"), spawnPlayer); 
    136146        tileMap.SetTileMethod(Color.FromHexCode("00ff00"), spawnEnemy); 
     
    160170            for (int y = 0; y < tileMap.RowCount; y++) 
    161171            { 
    162                 String hexColor = tileMap.GetTile(y, x).ToString().Substring(2, 6); 
     172                String hexColor = tileMap.GetTile(y, x).ToString().Substring(2, 6).ToLower(); 
    163173                if (convert.ContainsKey(hexColor)) 
    164                     createTile(new Vector(x * w + w / 2 - Level.Width / 2 + Level.Width, (tileMap.RowCount - y - 1) * h + h / 2 - Level.Height / 2), w, h, convert[hexColor]); 
     174                    createTile(new Vector(x * w + w / 2 - Level.Width / 2 + Level.Width, (tileMap.RowCount - y - 1) * h + h / 2 - Level.Height / 2), w, h, convert[hexColor], false); 
    165175            } 
    166176        } 
     
    170180            for (int y = 0; y < tileMap.RowCount; y++) 
    171181            { 
    172                 String hexColor = tileMap.GetTile(y, x).ToString().Substring(2, 6); 
     182                String hexColor = tileMap.GetTile(y, x).ToString().Substring(2, 6).ToLower(); 
    173183                if (convert.ContainsKey(hexColor)) 
    174                     createTile(new Vector(x * w + w / 2 - Level.Width / 2 - Level.Width, (tileMap.RowCount - y - 1) * h + h / 2 - Level.Height / 2), w, h, convert[hexColor]); 
     184                    createTile(new Vector(x * w + w / 2 - Level.Width / 2 - Level.Width, (tileMap.RowCount - y - 1) * h + h / 2 - Level.Height / 2), w, h, convert[hexColor], false); 
    175185            } 
    176186        } 
     
    196206        hud = new Hud(this); 
    197207    } 
    198     void createTile(Vector position, double w, double h, string id) 
     208    void createTile(Vector position, double w, double h, string id, bool cheap = false) 
    199209    { 
    200210        if (id == "") { return; } 
    201         PhysicsObject tile = new PhysicsObject(w, h); 
    202         tile.MakeStatic(); 
    203         tile.AbsolutePosition = position; 
    204         tile.Image = images[id]; 
    205         Add(tile); 
     211        if (!cheap) 
     212        { 
     213            MikonPhysicsObject tile = new MikonPhysicsObject(this, w, h); 
     214            tile.MakeStatic(); 
     215            tile.AbsolutePosition = position; 
     216            tile.Image = images[id]; 
     217            Add(tile); 
     218        } 
     219        else 
     220        { 
     221            GameObject tile = new GameObject(w, h); 
     222            tile.AbsolutePosition = position; 
     223            tile.Image = images[id]; 
     224            Add(tile); 
     225        } 
    206226    } 
    207227    void createPlanet(Vector position, double w, double h, string id) 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor.csproj.Debug.cachefile

    r5396 r5404  
    2121Content\graphics\backgrounds\Space_esim.xnb 
    2222Content\graphics\HUD\galaxy_map.xnb 
     23Content\graphics\tiles\tilegraniitti.xnb 
     24Content\graphics\tiles\tilemulta.xnb 
     25Content\graphics\tiles\tilenurmi.xnb 
     26Content\graphics\tiles\tilepuu.xnb 
     27Content\graphics\backgrounds\planet2_valetta.xnb 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/obj/x86/Debug/ContentPipeline-{5156C658-EF8C-4216-BA6D-9928D133FE72}.xml

    r5398 r5404  
    199199      <Output>C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\HUD\galaxy_map.xnb</Output> 
    200200      <Time>2014-07-04T09:10:12.4832685+03:00</Time> 
     201    </Item> 
     202    <Item> 
     203      <Source>graphics\tiles\tilegraniitti.png</Source> 
     204      <Name>graphics\tiles\tilegraniitti</Name> 
     205      <Importer>TextureImporter</Importer> 
     206      <Processor>TextureProcessor</Processor> 
     207      <Options>None</Options> 
     208      <Output>C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\tiles\tilegraniitti.xnb</Output> 
     209      <Time>2014-07-03T13:40:04.9005559+03:00</Time> 
     210    </Item> 
     211    <Item> 
     212      <Source>graphics\tiles\tilemulta.png</Source> 
     213      <Name>graphics\tiles\tilemulta</Name> 
     214      <Importer>TextureImporter</Importer> 
     215      <Processor>TextureProcessor</Processor> 
     216      <Options>None</Options> 
     217      <Output>C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\tiles\tilemulta.xnb</Output> 
     218      <Time>2014-07-03T14:30:42.4484319+03:00</Time> 
     219    </Item> 
     220    <Item> 
     221      <Source>graphics\tiles\tilenurmi.png</Source> 
     222      <Name>graphics\tiles\tilenurmi</Name> 
     223      <Importer>TextureImporter</Importer> 
     224      <Processor>TextureProcessor</Processor> 
     225      <Options>None</Options> 
     226      <Output>C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\tiles\tilenurmi.xnb</Output> 
     227      <Time>2014-07-04T10:23:52.613333+03:00</Time> 
     228    </Item> 
     229    <Item> 
     230      <Source>graphics\tiles\tilepuu.png</Source> 
     231      <Name>graphics\tiles\tilepuu</Name> 
     232      <Importer>TextureImporter</Importer> 
     233      <Processor>TextureProcessor</Processor> 
     234      <Options>None</Options> 
     235      <Output>C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\tiles\tilepuu.xnb</Output> 
     236      <Time>2014-07-03T13:40:04.9005559+03:00</Time> 
     237    </Item> 
     238    <Item> 
     239      <Source>graphics\backgrounds\planet2_valetta.png</Source> 
     240      <Name>graphics\backgrounds\planet2_valetta</Name> 
     241      <Importer>TextureImporter</Importer> 
     242      <Processor>TextureProcessor</Processor> 
     243      <Options>None</Options> 
     244      <Output>C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\backgrounds\planet2_valetta.xnb</Output> 
     245      <Time>2014-07-04T10:15:37.8215279+03:00</Time> 
    201246    </Item> 
    202247    <BuildSuccessful>true</BuildSuccessful> 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/obj/x86/Debug/Protokolla236TrueSurvivor.csproj.FileListAbsolute.txt

    r5398 r5404  
    7373C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\backgrounds\Space_esim.xnb 
    7474C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\HUD\galaxy_map.xnb 
     75C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\tiles\tilegraniitti.xnb 
     76C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\tiles\tilemulta.xnb 
     77C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\tiles\tilenurmi.xnb 
     78C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\tiles\tilepuu.xnb 
     79C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\backgrounds\planet2_valetta.xnb 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/obj/x86/Debug/cachefile-{5156C658-EF8C-4216-BA6D-9928D133FE72}-targetpath.txt

    r5396 r5404  
    2121Content\graphics\backgrounds\Space_esim.xnb 
    2222Content\graphics\HUD\galaxy_map.xnb 
     23Content\graphics\tiles\tilegraniitti.xnb 
     24Content\graphics\tiles\tilemulta.xnb 
     25Content\graphics\tiles\tilenurmi.xnb 
     26Content\graphics\tiles\tilepuu.xnb 
     27Content\graphics\backgrounds\planet2_valetta.xnb 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivorContent/Protokolla236TrueSurvivorContent.contentproj

    r5398 r5404  
    189189    </Compile> 
    190190  </ItemGroup> 
     191  <ItemGroup> 
     192    <Compile Include="graphics\tiles\tilegraniitti.png"> 
     193      <Name>tilegraniitti</Name> 
     194      <Importer>TextureImporter</Importer> 
     195      <Processor>TextureProcessor</Processor> 
     196    </Compile> 
     197    <Compile Include="graphics\tiles\tilemulta.png"> 
     198      <Name>tilemulta</Name> 
     199      <Importer>TextureImporter</Importer> 
     200      <Processor>TextureProcessor</Processor> 
     201    </Compile> 
     202    <Compile Include="graphics\tiles\tilenurmi.png"> 
     203      <Name>tilenurmi</Name> 
     204      <Importer>TextureImporter</Importer> 
     205      <Processor>TextureProcessor</Processor> 
     206    </Compile> 
     207    <Compile Include="graphics\tiles\tilepuu.png"> 
     208      <Name>tilepuu</Name> 
     209      <Importer>TextureImporter</Importer> 
     210      <Processor>TextureProcessor</Processor> 
     211    </Compile> 
     212  </ItemGroup> 
     213  <ItemGroup> 
     214    <Compile Include="graphics\backgrounds\planet2_valetta.png"> 
     215      <Name>planet2_valetta</Name> 
     216      <Importer>TextureImporter</Importer> 
     217      <Processor>TextureProcessor</Processor> 
     218    </Compile> 
     219  </ItemGroup> 
    191220  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    192221  <!--  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.