Changeset 6220 for 2015


Ignore:
Timestamp:
2015-06-24 08:28:11 (4 years ago)
Author:
sieerinn
Message:

Ryömijöitä paranneltu.

File:
1 edited

Legend:

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

    r6219 r6220  
    280280        bottomCamLimit = Level.Bottom + Window.Height / 2.0; 
    281281 
    282         //Camera.X = cameraTargetX = players[0].X; 
    283         //Camera.ZoomToLevel(); 
    284282        Camera.X = cameraTargetX = leftCamLimit; 
    285283 
     
    382380    void CreateCrawly(Vector position, double width, double height) 
    383381    { 
    384         PlatformCharacter crawly = new PlatformCharacter(width * 2, height); 
     382        PlatformCharacter crawly = new PlatformCharacter(width * 2, height * 0.6); 
    385383        crawly.Position = position; 
    386384        crawly.Color = Color.Gray; 
    387         crawly.Animation = crawl; 
    388         crawly.Animation.Start(); 
     385        crawly.Animation = new Animation(crawl); 
     386        crawly.Animation.FPS = RandomGen.NextInt(18, 24); 
     387        crawly.Animation.Step(RandomGen.NextInt(0, 16)); 
     388        crawly.Animation.Resume(); 
    389389        crawly.Tag = "burn"; 
    390390        crawly.CollisionIgnoreGroup = 3; 
    391         Add(crawly); 
     391        Add(crawly, 1); 
     392 
     393        GameObject flame = new GameObject(width * 1.4, height * 2); 
     394        flame.Animation = new Animation(blaze) { FPS = RandomGen.NextInt(20, 26) }; 
     395        flame.Animation.Step(RandomGen.NextInt(0, 12)); 
     396        flame.Animation.Resume(); 
     397        Add(flame); 
     398 
     399        // Pakko liikutella näin koska lapsioliona liekki näkyisi ryömijän päällä. 
     400        Timer flameMover = new Timer { Interval = 0.05 }; 
     401        flameMover.Timeout += delegate 
     402        { 
     403            double hieman = height * 0.75; 
     404            flame.Position = crawly.Position + new Vector(0, hieman); 
     405        }; 
     406        flameMover.Start(); 
    392407 
    393408        PlatformWandererBrain brain = new PlatformWandererBrain(); 
     
    396411 
    397412        crawly.Brain = brain; 
     413 
     414        // Sammuu törmätessään maitoon. 
     415        AddCollisionHandler(crawly, "milkparticle", delegate(PhysicsObject c, PhysicsObject particle) 
     416        { 
     417            particle.Destroy(); 
     418            crawly.Brain = null; 
     419            crawly.Tag = ""; 
     420            flame.Destroy(); 
     421        }); 
    398422    } 
    399423 
     
    443467    } 
    444468 
    445  
    446469    private void CreateDummy(Vector position, double width, double height, Color color) 
    447470    { 
Note: See TracChangeset for help on using the changeset viewer.