Changeset 6286 for 2015/26/ohjaajat


Ignore:
Timestamp:
2015-06-24 19:22:19 (4 years ago)
Author:
sieerinn
Message:

Noitaa.

Location:
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs

    r6283 r6286  
    150150    private Animation playerJump; 
    151151    private Animation playerFall; 
     152    private Animation firemageAnimation; 
     153    private Animation firemageCastAnimation; 
    152154    #endregion 
    153155 
     
    302304        playerJump = LoadAnimation("jump"); 
    303305        playerFall = LoadAnimation("fall"); 
     306        firemageAnimation = LoadAnimation("firemage"); 
     307        firemageCastAnimation = LoadAnimation("firemagecast"); 
    304308 
    305309        cameraOffset = Window.Width / 4; 
     
    335339    void CreateLevel() 
    336340    { 
    337  
    338341        Gravity = new Vector(0, -1000); 
    339342 
     
    351354        level.SetTileMethod(Color.DarkGray, CreateMilk); 
    352355        level.SetTileMethod(Color.Gray, CreateCrawly); 
    353         level.SetTileMethod(Color.Red, CreateDummy, Color.Red);    //TODO: CreateWitch 
     356        level.SetTileMethod(Color.Red, CreateFireMage); 
    354357        level.SetTileMethod(Color.Rose, CreateFlame); 
    355358        //level.SetTileMethod(Color.Azure, CreateDummy, Color.Azure);   //TODO: CreateSmoke 
     
    473476            RemoveCollisionHandlers(crawly); 
    474477        }); 
     478    } 
     479 
     480    void CreateFireMage(Vector position, double width, double height) 
     481    { 
     482        PlatformCharacter mage = new PlatformCharacter(width * 3, height * 4); 
     483        mage.Position = position; 
     484        mage.Y += mage.Height / 2.0; 
     485        mage.Animation = new Animation(firemageAnimation); 
     486        mage.Animation.Start(); 
     487        mage.Tag = "burn"; 
     488        mage.CollisionIgnoreGroup = 3; 
     489        Add(mage, 1); 
     490 
     491        GameObject flame = new GameObject(width * 1.4, height * 2); 
     492        flame.Y += mage.Height * 0.65; 
     493        flame.Animation = new Animation(blaze); 
     494        flame.Animation.Start(); 
     495        mage.Add(flame); 
    475496    } 
    476497 
Note: See TracChangeset for help on using the changeset viewer.