Ignore:
Timestamp:
2016-06-09 22:20:43 (4 years ago)
Author:
sieerinn
Message:

Raketinheitin tehty

File:
1 edited

Legend:

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

    r7218 r7219  
    4141    private Shader shader; 
    4242 
     43    public void NewWave(Vector pos) 
     44    { 
     45        shader.NewWave(pos); 
     46    } 
     47 
    4348    public override void Begin() 
    4449    { 
     
    6570 
    6671        ColorTileMap map = ColorTileMap.FromLevelAsset("dungeon1"); 
    67         map.SetTileMethod(Color.Black, delegate(Vector vektori, double leveys, double korkeus) { AddPlatform(vektori, leveys, korkeus); }); 
    68         map.SetTileMethod(Color.FromHexCode("#FF0026FF"), delegate(Vector paikka, double leveys, double korkeus) { blue = CreatePlayer(paikka, leveys, korkeus, blueColor, blueWalkImages, bluePistolpic); }); 
    69         map.SetTileMethod(Color.FromHexCode("FFD800"), delegate(Vector a, double b, double c) { cratePositions.Add(a, CreateWeaponCrate(a, b, c)); }); 
    70         map.SetTileMethod(Color.Red, delegate(Vector paikka, double leveys, double korkeus) { red = CreatePlayer(paikka, leveys, korkeus, redColor, orangeWalkImages, orangePistolpic); }); 
     72        map.SetTileMethod(Color.Black, delegate (Vector vektori, double leveys, double korkeus) { AddPlatform(vektori, leveys, korkeus); }); 
     73        map.SetTileMethod(Color.FromHexCode("#FF0026FF"), delegate (Vector paikka, double leveys, double korkeus) { blue = CreatePlayer(paikka, leveys, korkeus, blueColor, blueWalkImages, bluePistolpic); }); 
     74        map.SetTileMethod(Color.FromHexCode("FFD800"), delegate (Vector a, double b, double c) { cratePositions.Add(a, CreateWeaponCrate(a, b, c)); }); 
     75        map.SetTileMethod(Color.Red, delegate (Vector paikka, double leveys, double korkeus) { red = CreatePlayer(paikka, leveys, korkeus, redColor, orangeWalkImages, orangePistolpic); }); 
    7176        map.Execute(TILE_SIZE, TILE_SIZE); 
    7277 
     
    185190            AttackSound = null, 
    186191            MaxAmmoLifetime = TimeSpan.FromSeconds(8), 
    187             ProjectileCollision = delegate(PhysicsObject a, PhysicsObject b) { ColorTile(a, b); a.Destroy(); }, 
     192            ProjectileCollision = delegate (PhysicsObject a, PhysicsObject b) { ColorTile(a, b); a.Destroy(); }, 
    188193            // ProjectileCollision = BulletHitsSomething, 
    189194            Image = pistolPic, 
     
    191196        }; 
    192197 
    193         AddCollisionHandler(player, "platform", delegate(PhysicsObject a, PhysicsObject b) 
     198        AddCollisionHandler(player, "platform", delegate (PhysicsObject a, PhysicsObject b) 
    194199        { 
    195200            ColorTile(a, b); 
    196201        }); 
    197         AddCollisionHandler(player, "crate", delegate(PhysicsObject a, PhysicsObject b) 
     202        AddCollisionHandler(player, "crate", delegate (PhysicsObject a, PhysicsObject b) 
    198203        { 
    199204            GunLottery(player); 
    200205            b.Destroy(); 
    201206        }); 
    202         AddCollisionHandler(player, "death", delegate(PhysicsObject a, PhysicsObject b) 
     207        AddCollisionHandler(player, "death", delegate (PhysicsObject a, PhysicsObject b) 
    203208        { 
    204209            Restore((Player)a); 
     
    220225        { 
    221226            case 0: 
    222                 player.Weapon = new AssaultRifle(player.Weapon.Width, player.Weapon.Height) { Image = player.Weapon.Image,  ProjectileCollision = delegate(PhysicsObject a, PhysicsObject b) { ColorTile(a, b); a.Destroy(); }, AttackSound = null, MaxAmmoLifetime = TimeSpan.FromSeconds(4) }; 
     227                player.Weapon = new RocketLauncher(player.Weapon.Width, player.Weapon.Height, player.Weapon.Image, player); 
    223228                break; 
    224229            case 1: 
    225                 player.Weapon = new ColorGun(player.Weapon.Width, player.Weapon.Height, player.Weapon.Image, player); 
     230                player.Weapon = new GrenadeLauncher(player.Weapon.Width, player.Weapon.Height, player.Weapon.Image, player); 
    226231                break; 
    227232            case 2: 
    228                 player.Weapon = new LaserGun(player.Weapon.Width, player.Weapon.Height) { Image = player.Weapon.Image, ProjectileCollision = delegate(PhysicsObject a, PhysicsObject b) { ColorTile(a, b); a.Destroy(); }, AttackSound = null, MaxAmmoLifetime = TimeSpan.FromSeconds(4) }; 
     233                player.Weapon = new LaserGun(player.Weapon.Width, player.Weapon.Height) { Image = player.Weapon.Image, ProjectileCollision = delegate (PhysicsObject a, PhysicsObject b) { ColorTile(a, b); a.Destroy(); }, AttackSound = null, MaxAmmoLifetime = TimeSpan.FromSeconds(4) }; 
    229234                break; 
    230235            default: 
     
    233238 
    234239        Timer undo = new Timer() { Interval = 5 }; 
    235         undo.Timeout += delegate() 
     240        undo.Timeout += delegate () 
    236241        { 
    237242            undo.Stop(); 
    238243            player.Weapon = new AssaultRifle(player.Weapon.Width, player.Weapon.Height) 
    239         { 
    240             FireRate = 3, 
    241             AttackSound = null, 
    242             MaxAmmoLifetime = TimeSpan.FromSeconds(8), 
    243             Image = player.Weapon.Image, 
    244             ProjectileCollision = delegate(PhysicsObject a, PhysicsObject b) { ColorTile(a, b); a.Destroy(); }, 
    245             Y = 5, 
    246         }; 
     244            { 
     245                FireRate = 3, 
     246                AttackSound = null, 
     247                MaxAmmoLifetime = TimeSpan.FromSeconds(8), 
     248                Image = player.Weapon.Image, 
     249                ProjectileCollision = delegate (PhysicsObject a, PhysicsObject b) { ColorTile(a, b); a.Destroy(); }, 
     250                Y = 5, 
     251            }; 
    247252        }; 
    248253        undo.Start(); 
Note: See TracChangeset for help on using the changeset viewer.