Changeset 7209 for 2016/23/ohjaajat


Ignore:
Timestamp:
2016-06-08 15:02:44 (3 years ago)
Author:
sieerinn
Message:

Pelaajille laitettu animaatiot

Location:
2016/23/ohjaajat
Files:
6 edited

Legend:

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

    r7205 r7209  
    99public class Player : PlatformCharacter2 
    1010{ 
    11  
    1211    public Weapon Secondary; 
    1312 
     
    2019 
    2120        Tag = "player"; 
    22         Acceleration = 5000; 
    23        
    24  
     21        Acceleration = 1500; 
    2522    } 
    2623} 
  • 2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Punasininen.cs

    r7208 r7209  
    1818    private Image[] orangeTileImages = LoadImages("orangetile\\orangetile", 12); 
    1919    private Image[] blueTileImages = LoadImages("bluetile\\bluetile", 12); 
     20    private Image[] orangeWalkImages = LoadImages("walkorange\\walk", 16); 
     21    private Image[] blueWalkImages = LoadImages("walkblue\\walk", 16); 
    2022    private Image orangeGlow = LoadImage("orangeglow"); 
    2123    private Image blueGlow = LoadImage("blueglow"); 
     
    2426    private Image redpic; 
    2527 
    26     private Image pistolpic; 
     28    private Image bluePistolpic = LoadImage("bluegun"); 
     29    private Image orangePistolpic = LoadImage("orangegun"); 
    2730 
    2831    DoubleMeter percentageTracker; 
     
    8487    void AddPlatform(Vector paikka, double leveys, double korkeus) 
    8588    { 
    86         Tile platform = new Tile(leveys, korkeus); 
     89        Tile platform = new Tile(leveys, korkeus, paikka); 
    8790        platform.MakeStatic(); 
    88         platform.Position = paikka; 
    8991        platform.Color = Color.Black; 
    9092        platform.Tag = "platform"; 
     
    9496    Player CreatePlayer(Vector paikka, double leveys, double korkeus, Image playerspic, Color playersColor) 
    9597    { 
    96         Player player = new Player(leveys, korkeus, playerspic, playersColor); 
     98        Player player = new Player(leveys * 1.1, korkeus * 1.5, playerspic, playersColor); 
     99        player.AnimWalk = new Animation(blueWalkImages) { FPS = 30 }; 
     100        player.AnimIdle = new Animation(new[] { blueWalkImages[0] }); 
    97101        player.Position = paikka; 
    98102        Add(player); 
    99103 
    100         player.Weapon = new AssaultRifle(leveys / 2, korkeus / 2) { FireRate = 1.5, AttackSound = null, MaxAmmoLifetime = TimeSpan.FromSeconds(8), ProjectileCollision = BulletHitsSomething}; 
     104        player.Weapon = new AssaultRifle(leveys * 1.5, korkeus * 1.5) 
     105        { 
     106            FireRate = 1.5, 
     107            AttackSound = null, 
     108            MaxAmmoLifetime = TimeSpan.FromSeconds(8), 
     109            ProjectileCollision = BulletHitsSomething, 
     110            Image = bluePistolpic, 
     111            Y = 5 
     112        }; 
    101113 
    102114        AddCollisionHandler(player, "platform", delegate(PhysicsObject a, PhysicsObject b) 
     
    214226    protected override void Draw(Microsoft.Xna.Framework.GameTime gameTime) 
    215227    { 
    216         //shader.Draw(gameTime, base.Draw); 
    217  
    218         shader.Draw(gameTime); 
    219         base.Draw(gameTime); 
    220         shader.DrawEnd(gameTime); 
     228        shader.Draw(gameTime, base.Draw); 
    221229    } 
    222230} 
  • 2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Shader.cs

    r7198 r7209  
    5050    } 
    5151 
    52     public void Draw(GameTime gameTime) 
     52    public void Draw(GameTime gameTime, Action<GameTime> baseDraw) 
    5353    { 
    5454 
     
    5656        device.SetRenderTarget(renderTarget); 
    5757 
    58     } 
    59  
    60     public void DrawEnd(GameTime gameTime) 
    61     { 
    62         //baseDraw(gameTime); //base.Draw(gameTime); 
     58        baseDraw(gameTime); 
    6359 
    6460        device.SetRenderTarget(null); 
  • 2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Tile.cs

    r7208 r7209  
    88{ 
    99    private GameObject glow; 
    10     //private GameObject overlay; 
    1110 
    12     public Tile(double width, double height) : base(width, height) 
     11    public Tile(double width, double height, Vector position) : base(width, height) 
    1312    { 
     13        this.Position = position; 
     14 
    1415        glow = new GameObject(width * 7, height * 7); 
    1516        glow.IsVisible = false; 
    16         Add(glow); 
    17  
    18         //overlay = new GameObject(width, height); 
    19         //overlay.IsVisible = false; 
    20         //Add(overlay); 
     17        glow.Position = position; 
     18        Game.Instance.Add(glow, 3); 
    2119    } 
    2220 
  • 2016/23/ohjaajat/Punasininen/Punasininen/PunasininenContent/PunasininenContent.contentproj

    r7204 r7209  
    197197    </Compile> 
    198198  </ItemGroup> 
     199  <ItemGroup> 
     200    <Compile Include="walkblue\walk0001.png"> 
     201      <Name>walk0001</Name> 
     202      <Importer>TextureImporter</Importer> 
     203      <Processor>TextureProcessor</Processor> 
     204    </Compile> 
     205    <Compile Include="walkblue\walk0002.png"> 
     206      <Name>walk0002</Name> 
     207      <Importer>TextureImporter</Importer> 
     208      <Processor>TextureProcessor</Processor> 
     209    </Compile> 
     210    <Compile Include="walkblue\walk0003.png"> 
     211      <Name>walk0003</Name> 
     212      <Importer>TextureImporter</Importer> 
     213      <Processor>TextureProcessor</Processor> 
     214    </Compile> 
     215    <Compile Include="walkblue\walk0004.png"> 
     216      <Name>walk0004</Name> 
     217      <Importer>TextureImporter</Importer> 
     218      <Processor>TextureProcessor</Processor> 
     219    </Compile> 
     220    <Compile Include="walkblue\walk0005.png"> 
     221      <Name>walk0005</Name> 
     222      <Importer>TextureImporter</Importer> 
     223      <Processor>TextureProcessor</Processor> 
     224    </Compile> 
     225    <Compile Include="walkblue\walk0006.png"> 
     226      <Name>walk0006</Name> 
     227      <Importer>TextureImporter</Importer> 
     228      <Processor>TextureProcessor</Processor> 
     229    </Compile> 
     230    <Compile Include="walkblue\walk0007.png"> 
     231      <Name>walk0007</Name> 
     232      <Importer>TextureImporter</Importer> 
     233      <Processor>TextureProcessor</Processor> 
     234    </Compile> 
     235    <Compile Include="walkblue\walk0008.png"> 
     236      <Name>walk0008</Name> 
     237      <Importer>TextureImporter</Importer> 
     238      <Processor>TextureProcessor</Processor> 
     239    </Compile> 
     240    <Compile Include="walkblue\walk0009.png"> 
     241      <Name>walk0009</Name> 
     242      <Importer>TextureImporter</Importer> 
     243      <Processor>TextureProcessor</Processor> 
     244    </Compile> 
     245    <Compile Include="walkblue\walk0010.png"> 
     246      <Name>walk0010</Name> 
     247      <Importer>TextureImporter</Importer> 
     248      <Processor>TextureProcessor</Processor> 
     249    </Compile> 
     250    <Compile Include="walkblue\walk0011.png"> 
     251      <Name>walk0011</Name> 
     252      <Importer>TextureImporter</Importer> 
     253      <Processor>TextureProcessor</Processor> 
     254    </Compile> 
     255    <Compile Include="walkblue\walk0012.png"> 
     256      <Name>walk0012</Name> 
     257      <Importer>TextureImporter</Importer> 
     258      <Processor>TextureProcessor</Processor> 
     259    </Compile> 
     260    <Compile Include="walkblue\walk0013.png"> 
     261      <Name>walk0013</Name> 
     262      <Importer>TextureImporter</Importer> 
     263      <Processor>TextureProcessor</Processor> 
     264    </Compile> 
     265    <Compile Include="walkblue\walk0014.png"> 
     266      <Name>walk0014</Name> 
     267      <Importer>TextureImporter</Importer> 
     268      <Processor>TextureProcessor</Processor> 
     269    </Compile> 
     270    <Compile Include="walkblue\walk0015.png"> 
     271      <Name>walk0015</Name> 
     272      <Importer>TextureImporter</Importer> 
     273      <Processor>TextureProcessor</Processor> 
     274    </Compile> 
     275    <Compile Include="walkblue\walk0016.png"> 
     276      <Name>walk0016</Name> 
     277      <Importer>TextureImporter</Importer> 
     278      <Processor>TextureProcessor</Processor> 
     279    </Compile> 
     280  </ItemGroup> 
     281  <ItemGroup> 
     282    <Compile Include="walkorange\walk0001.png"> 
     283      <Name>walk0001</Name> 
     284      <Importer>TextureImporter</Importer> 
     285      <Processor>TextureProcessor</Processor> 
     286    </Compile> 
     287    <Compile Include="walkorange\walk0002.png"> 
     288      <Name>walk0002</Name> 
     289      <Importer>TextureImporter</Importer> 
     290      <Processor>TextureProcessor</Processor> 
     291    </Compile> 
     292    <Compile Include="walkorange\walk0003.png"> 
     293      <Name>walk0003</Name> 
     294      <Importer>TextureImporter</Importer> 
     295      <Processor>TextureProcessor</Processor> 
     296    </Compile> 
     297    <Compile Include="walkorange\walk0004.png"> 
     298      <Name>walk0004</Name> 
     299      <Importer>TextureImporter</Importer> 
     300      <Processor>TextureProcessor</Processor> 
     301    </Compile> 
     302    <Compile Include="walkorange\walk0005.png"> 
     303      <Name>walk0005</Name> 
     304      <Importer>TextureImporter</Importer> 
     305      <Processor>TextureProcessor</Processor> 
     306    </Compile> 
     307    <Compile Include="walkorange\walk0006.png"> 
     308      <Name>walk0006</Name> 
     309      <Importer>TextureImporter</Importer> 
     310      <Processor>TextureProcessor</Processor> 
     311    </Compile> 
     312    <Compile Include="walkorange\walk0007.png"> 
     313      <Name>walk0007</Name> 
     314      <Importer>TextureImporter</Importer> 
     315      <Processor>TextureProcessor</Processor> 
     316    </Compile> 
     317    <Compile Include="walkorange\walk0008.png"> 
     318      <Name>walk0008</Name> 
     319      <Importer>TextureImporter</Importer> 
     320      <Processor>TextureProcessor</Processor> 
     321    </Compile> 
     322    <Compile Include="walkorange\walk0009.png"> 
     323      <Name>walk0009</Name> 
     324      <Importer>TextureImporter</Importer> 
     325      <Processor>TextureProcessor</Processor> 
     326    </Compile> 
     327    <Compile Include="walkorange\walk0010.png"> 
     328      <Name>walk0010</Name> 
     329      <Importer>TextureImporter</Importer> 
     330      <Processor>TextureProcessor</Processor> 
     331    </Compile> 
     332    <Compile Include="walkorange\walk0011.png"> 
     333      <Name>walk0011</Name> 
     334      <Importer>TextureImporter</Importer> 
     335      <Processor>TextureProcessor</Processor> 
     336    </Compile> 
     337    <Compile Include="walkorange\walk0012.png"> 
     338      <Name>walk0012</Name> 
     339      <Importer>TextureImporter</Importer> 
     340      <Processor>TextureProcessor</Processor> 
     341    </Compile> 
     342    <Compile Include="walkorange\walk0013.png"> 
     343      <Name>walk0013</Name> 
     344      <Importer>TextureImporter</Importer> 
     345      <Processor>TextureProcessor</Processor> 
     346    </Compile> 
     347    <Compile Include="walkorange\walk0014.png"> 
     348      <Name>walk0014</Name> 
     349      <Importer>TextureImporter</Importer> 
     350      <Processor>TextureProcessor</Processor> 
     351    </Compile> 
     352    <Compile Include="walkorange\walk0015.png"> 
     353      <Name>walk0015</Name> 
     354      <Importer>TextureImporter</Importer> 
     355      <Processor>TextureProcessor</Processor> 
     356    </Compile> 
     357    <Compile Include="walkorange\walk0016.png"> 
     358      <Name>walk0016</Name> 
     359      <Importer>TextureImporter</Importer> 
     360      <Processor>TextureProcessor</Processor> 
     361    </Compile> 
     362  </ItemGroup> 
     363  <ItemGroup> 
     364    <Compile Include="bluegun.png"> 
     365      <Name>bluegun</Name> 
     366      <Importer>TextureImporter</Importer> 
     367      <Processor>TextureProcessor</Processor> 
     368    </Compile> 
     369    <Compile Include="orangegun.png"> 
     370      <Name>orangegun</Name> 
     371      <Importer>TextureImporter</Importer> 
     372      <Processor>TextureProcessor</Processor> 
     373    </Compile> 
     374  </ItemGroup> 
    199375  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    200376  <!--  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.