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

Pelaajille laitettu animaatiot

Location:
2016/23/ohjaajat/Punasininen/Punasininen/Punasininen
Files:
4 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 
Note: See TracChangeset for help on using the changeset viewer.