Changeset 7205 for 2016/23/ohjaajat


Ignore:
Timestamp:
2016-06-08 11:34:27 (3 years ago)
Author:
sieerinn
Message:

Nimiä vaihdettu englanninkielelle ja kenttää paranneltu

Location:
2016/23/ohjaajat/Punasininen/Punasininen
Files:
3 edited

Legend:

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

    r7203 r7205  
    1010{ 
    1111 
    12     Weapon Secondary; 
     12    public Weapon Secondary; 
    1313 
    1414    public Player(double leveys, double korkeus, Image pic, Color color) 
     
    2121        Tag = "player"; 
    2222        Acceleration = 5000; 
     23       
    2324 
    2425    } 
  • 2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Punasininen.cs

    r7204 r7205  
    5757 
    5858        ColorTileMap map = ColorTileMap.FromLevelAsset("dungeon1"); 
    59         map.SetTileMethod(Color.Black, LisaaTaso); 
     59        map.SetTileMethod(Color.Black, AddPlatform); 
    6060        map.SetTileMethod(Color.FromHexCode("#FF0026FF"), delegate(Vector paikka, double leveys, double korkeus) { blue = CreatePlayer(paikka, leveys, korkeus, bluepic, Color.Blue);}); 
    6161        map.SetTileMethod(Color.FromHexCode("FFD800"), CreateWeaponCrate); 
     
    8383    } 
    8484 
    85     void LisaaTaso(Vector paikka, double leveys, double korkeus) 
     85    void AddPlatform(Vector paikka, double leveys, double korkeus) 
    8686    { 
    8787        PhysicsObject platform = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     
    9898        Add(player); 
    9999 
     100        player.Weapon = new AssaultRifle(leveys / 2, korkeus / 2) { FireRate = 1.5, AttackSound = null, MaxAmmoLifetime = TimeSpan.FromSeconds(8), ProjectileCollision = BulletHitsSomething}; 
     101 
    100102        AddCollisionHandler(player, "platform", delegate(PhysicsObject a, PhysicsObject b) 
    101103        { 
     
    104106        AddCollisionHandler(player, "crate", delegate(PhysicsObject a, PhysicsObject b) 
    105107        { 
    106             //((Player)a).Weapon = ((WeaponCrate)b).GiveWeapon(); 
    107             ((Player)a).Weapon = GunLottery(); 
    108             ((Player)a).Weapon.ProjectileCollision = BulletHitsSomething; 
     108            //((Player)a).Weapon = ((WeaponCrate)b).GiveWeapon();  
     109            player.Weapon = GunLottery(); 
    109110            b.Destroy(); 
    110111        }); 
     
    113114    } 
    114115 
    115     void BulletHitsSomething (PhysicsObject bullet, PhysicsObject target) 
     116    void BulletHitsSomething(PhysicsObject bullet, PhysicsObject target) 
    116117    { 
    117118        if (target.Tag == "platform") 
     
    132133    Weapon GunLottery() 
    133134    { 
    134         return new AssaultRifle(50, 50); 
     135        return new AssaultRifle(TILE_SIZE / 2, TILE_SIZE / 2) { FireRate = 1.5, AttackSound = null, MaxAmmoLifetime = TimeSpan.FromSeconds(8), ProjectileCollision = BulletHitsSomething }; 
    135136    } 
    136137 
     
    148149        }; 
    149150        Add(announcement); 
    150  
    151151        
    152152    } 
     
    175175        ControllerOne.ListenAnalog(AnalogControl.RightStick, 0.1, Aim, "Tähtää", red); 
    176176        ControllerOne.ListenAnalog(AnalogControl.RightTrigger, 0.1, Shoot, "", red); 
     177        ControllerOne.ListenAnalog(AnalogControl.LeftTrigger, 0.1, Shoot, "", red); 
    177178 
    178179        ControllerTwo.ListenAnalog(AnalogControl.LeftStick, 0.1, Move, "Liikuta pelaajaa", blue); 
     
    180181        ControllerOne.ListenAnalog(AnalogControl.RightStick, 0.1, Aim, null, blue); 
    181182        ControllerTwo.ListenAnalog(AnalogControl.RightTrigger, 0.1, Shoot, "", blue); 
     183        ControllerTwo.ListenAnalog(AnalogControl.LeftTrigger, 0.1, Shoot, "", blue); 
    182184 
    183185        Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Ohjeet"); 
     
    210212    } 
    211213 
    212     void Aim(AnalogState tatinTila, Player player) 
     214    void Aim(AnalogState stickState, Player player) 
    213215    { 
    214216 
Note: See TracChangeset for help on using the changeset viewer.