Changeset 7204 for 2016


Ignore:
Timestamp:
2016-06-08 11:33:01 (7 years ago)
Author:
sieerinn
Message:

Hohtoefekti tehty ilman varjostinohjelmia

Location:
2016/23/ohjaajat
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • 2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Punasininen.cs

    r7203 r7204  
    11using System; 
    22using System.Collections.Generic; 
     3using System.Linq; 
    34using Jypeli; 
    45using Jypeli.Assets; 
     
    1415 
    1516    private Player blue; 
    16     private Player red;  
     17    private Player red; 
     18    private Image[] orangeTileImages = LoadImages("bluetile\\bluetile", 12); 
     19    private Image[] blueTileImages; 
     20    private Image orangeGlow = LoadImage("orangeglow"); 
     21    private Image blueGlow = LoadImage("blueglow"); 
     22 
    1723    private Image bluepic; 
    1824    private Image redpic; 
     
    2632    public override void Begin() 
    2733    { 
     34 
    2835        IsMouseVisible = true; // <- voi ottaa pois 
    2936        shader = new Shader(GraphicsDevice, Content, Camera); 
     
    3239        CreateLevel(); 
    3340        AddControls(); 
     41    } 
     42 
     43    private static Image[] LoadImages(string prefix, int numberOfImages) 
     44    { 
     45        var images = new Image[numberOfImages]; 
     46        for (int i = 1; i <= numberOfImages; i++) 
     47        { 
     48            //images[i-1] = LoadImage(string.Format("{0}{1:0000}", prefix, numberOfImages)); 
     49            images[i-1] = LoadImage($"{prefix}{numberOfImages.ToString().PadLeft(4, '0')}"); 
     50        } 
     51        return images; 
    3452    } 
    3553 
     
    136154    void ColorTile(PhysicsObject player, PhysicsObject platform) 
    137155    { 
     156        GameObject glow = platform.Objects.FirstOrDefault(); 
     157        if (glow == null) 
     158        { 
     159            glow = new GameObject(TILE_SIZE * 7, TILE_SIZE * 7); 
     160            platform.Add(glow); 
     161        } 
     162        glow.Image = player.Color == Color.Blue? blueGlow : orangeGlow; 
    138163        platform.Color = player.Color; 
    139164 
  • 2016/23/ohjaajat/Punasininen/Punasininen/PunasininenContent/PunasininenContent.contentproj

    r7198 r7204  
    5959    </Compile> 
    6060  </ItemGroup> 
     61  <ItemGroup> 
     62    <Compile Include="blueglow.png"> 
     63      <Name>blueglow</Name> 
     64      <Importer>TextureImporter</Importer> 
     65      <Processor>TextureProcessor</Processor> 
     66    </Compile> 
     67  </ItemGroup> 
     68  <ItemGroup> 
     69    <Compile Include="bluetile\bluetile0001.png"> 
     70      <Name>bluetile0001</Name> 
     71      <Importer>TextureImporter</Importer> 
     72      <Processor>TextureProcessor</Processor> 
     73    </Compile> 
     74    <Compile Include="bluetile\bluetile0002.png"> 
     75      <Name>bluetile0002</Name> 
     76      <Importer>TextureImporter</Importer> 
     77      <Processor>TextureProcessor</Processor> 
     78    </Compile> 
     79    <Compile Include="bluetile\bluetile0003.png"> 
     80      <Name>bluetile0003</Name> 
     81      <Importer>TextureImporter</Importer> 
     82      <Processor>TextureProcessor</Processor> 
     83    </Compile> 
     84    <Compile Include="bluetile\bluetile0004.png"> 
     85      <Name>bluetile0004</Name> 
     86      <Importer>TextureImporter</Importer> 
     87      <Processor>TextureProcessor</Processor> 
     88    </Compile> 
     89    <Compile Include="bluetile\bluetile0005.png"> 
     90      <Name>bluetile0005</Name> 
     91      <Importer>TextureImporter</Importer> 
     92      <Processor>TextureProcessor</Processor> 
     93    </Compile> 
     94    <Compile Include="bluetile\bluetile0006.png"> 
     95      <Name>bluetile0006</Name> 
     96      <Importer>TextureImporter</Importer> 
     97      <Processor>TextureProcessor</Processor> 
     98    </Compile> 
     99    <Compile Include="bluetile\bluetile0007.png"> 
     100      <Name>bluetile0007</Name> 
     101      <Importer>TextureImporter</Importer> 
     102      <Processor>TextureProcessor</Processor> 
     103    </Compile> 
     104    <Compile Include="bluetile\bluetile0008.png"> 
     105      <Name>bluetile0008</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108    </Compile> 
     109    <Compile Include="bluetile\bluetile0009.png"> 
     110      <Name>bluetile0009</Name> 
     111      <Importer>TextureImporter</Importer> 
     112      <Processor>TextureProcessor</Processor> 
     113    </Compile> 
     114    <Compile Include="bluetile\bluetile0010.png"> 
     115      <Name>bluetile0010</Name> 
     116      <Importer>TextureImporter</Importer> 
     117      <Processor>TextureProcessor</Processor> 
     118    </Compile> 
     119    <Compile Include="bluetile\bluetile0011.png"> 
     120      <Name>bluetile0011</Name> 
     121      <Importer>TextureImporter</Importer> 
     122      <Processor>TextureProcessor</Processor> 
     123    </Compile> 
     124    <Compile Include="bluetile\bluetile0012.png"> 
     125      <Name>bluetile0012</Name> 
     126      <Importer>TextureImporter</Importer> 
     127      <Processor>TextureProcessor</Processor> 
     128    </Compile> 
     129  </ItemGroup> 
     130  <ItemGroup> 
     131    <Compile Include="orangetile\orangetile0001.png"> 
     132      <Name>orangetile0001</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135    </Compile> 
     136    <Compile Include="orangetile\orangetile0002.png"> 
     137      <Name>orangetile0002</Name> 
     138      <Importer>TextureImporter</Importer> 
     139      <Processor>TextureProcessor</Processor> 
     140    </Compile> 
     141    <Compile Include="orangetile\orangetile0003.png"> 
     142      <Name>orangetile0003</Name> 
     143      <Importer>TextureImporter</Importer> 
     144      <Processor>TextureProcessor</Processor> 
     145    </Compile> 
     146    <Compile Include="orangetile\orangetile0004.png"> 
     147      <Name>orangetile0004</Name> 
     148      <Importer>TextureImporter</Importer> 
     149      <Processor>TextureProcessor</Processor> 
     150    </Compile> 
     151    <Compile Include="orangetile\orangetile0005.png"> 
     152      <Name>orangetile0005</Name> 
     153      <Importer>TextureImporter</Importer> 
     154      <Processor>TextureProcessor</Processor> 
     155    </Compile> 
     156    <Compile Include="orangetile\orangetile0006.png"> 
     157      <Name>orangetile0006</Name> 
     158      <Importer>TextureImporter</Importer> 
     159      <Processor>TextureProcessor</Processor> 
     160    </Compile> 
     161    <Compile Include="orangetile\orangetile0007.png"> 
     162      <Name>orangetile0007</Name> 
     163      <Importer>TextureImporter</Importer> 
     164      <Processor>TextureProcessor</Processor> 
     165    </Compile> 
     166    <Compile Include="orangetile\orangetile0008.png"> 
     167      <Name>orangetile0008</Name> 
     168      <Importer>TextureImporter</Importer> 
     169      <Processor>TextureProcessor</Processor> 
     170    </Compile> 
     171    <Compile Include="orangetile\orangetile0009.png"> 
     172      <Name>orangetile0009</Name> 
     173      <Importer>TextureImporter</Importer> 
     174      <Processor>TextureProcessor</Processor> 
     175    </Compile> 
     176    <Compile Include="orangetile\orangetile0010.png"> 
     177      <Name>orangetile0010</Name> 
     178      <Importer>TextureImporter</Importer> 
     179      <Processor>TextureProcessor</Processor> 
     180    </Compile> 
     181    <Compile Include="orangetile\orangetile0011.png"> 
     182      <Name>orangetile0011</Name> 
     183      <Importer>TextureImporter</Importer> 
     184      <Processor>TextureProcessor</Processor> 
     185    </Compile> 
     186    <Compile Include="orangetile\orangetile0012.png"> 
     187      <Name>orangetile0012</Name> 
     188      <Importer>TextureImporter</Importer> 
     189      <Processor>TextureProcessor</Processor> 
     190    </Compile> 
     191  </ItemGroup> 
     192  <ItemGroup> 
     193    <Compile Include="orangeglow.png"> 
     194      <Name>orangeglow</Name> 
     195      <Importer>TextureImporter</Importer> 
     196      <Processor>TextureProcessor</Processor> 
     197    </Compile> 
     198  </ItemGroup> 
    61199  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    62200  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/23/ohjaajat/Punasininen/Punasininen/PunasininenContent/Shockwave.fx

    r7200 r7204  
    3333        float3 color = tex2D(TextureSampler, uv).rgb; 
    3434         
    35         float radius = 4.0; 
     35        /* 
     36        float radius = 1.5; 
    3637        float3 glow = float3(0, 0, 0); 
    37         for (int x = -3; x<3; x++) { 
    38                 for (int y = -3; y<3; y++) { 
     38        for (int x = -5; x<5; x++) { 
     39                for (int y = -5; y<5; y++) { 
    3940                        float w = 0.0; 
    4041                        if (!(x == 0 && y == 0)) 
     
    4344                } 
    4445        } 
    45         glow *= 1.0 / 6.0 * 6.0; 
    46         color += 0.6 * glow; 
     46        glow *= 1.0 / 10.0 * 10.0; 
     47        color += 0.2 * glow; 
     48        */ 
    4749 
    4850        return float4(color, 1); 
Note: See TracChangeset for help on using the changeset viewer.