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

Pelaajille laitettu animaatiot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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} 
Note: See TracChangeset for help on using the changeset viewer.