- Timestamp:
- 2016-06-08 11:33:01 (7 years ago)
- Location:
- 2016/23/ohjaajat
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Punasininen.cs
r7203 r7204 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq; 3 4 using Jypeli; 4 5 using Jypeli.Assets; … … 14 15 15 16 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 17 23 private Image bluepic; 18 24 private Image redpic; … … 26 32 public override void Begin() 27 33 { 34 28 35 IsMouseVisible = true; // <- voi ottaa pois 29 36 shader = new Shader(GraphicsDevice, Content, Camera); … … 32 39 CreateLevel(); 33 40 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; 34 52 } 35 53 … … 136 154 void ColorTile(PhysicsObject player, PhysicsObject platform) 137 155 { 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; 138 163 platform.Color = player.Color; 139 164 -
2016/23/ohjaajat/Punasininen/Punasininen/PunasininenContent/PunasininenContent.contentproj
r7198 r7204 59 59 </Compile> 60 60 </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> 61 199 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 62 200 <!-- 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 33 33 float3 color = tex2D(TextureSampler, uv).rgb; 34 34 35 float radius = 4.0; 35 /* 36 float radius = 1.5; 36 37 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++) { 39 40 float w = 0.0; 40 41 if (!(x == 0 && y == 0)) … … 43 44 } 44 45 } 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 */ 47 49 48 50 return float4(color, 1);
Note: See TracChangeset
for help on using the changeset viewer.