Changeset 9119 for 2017/30


Ignore:
Timestamp:
2017-07-26 12:43:10 (2 years ago)
Author:
npo17_65
Message:
 
Location:
2017/30/HugoE/HanniAndHoo/HanniAndHoo
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • 2017/30/HugoE/HanniAndHoo/HanniAndHoo/HanniAndHoo/HanniAndHoo.cs

    r9118 r9119  
    1414    AssaultRifle HanninAse; 
    1515 
    16     AssaultRifle HoonAse; 
     16    Cannon HoonAse; 
    1717     
    1818 
     
    2828 
    2929        AmmuAseella(HanninAse); 
     30        AmmuAseella2(HoonAse); 
    3031 
    3132 
     
    4041 
    4142        Hanni = new PlatformCharacter(80.0, 80.0); 
    42         Hanni.X = Level.Left + 20.0; 
     43        Hanni.X = Level.Left + 100.0; 
    4344        Hanni.Y = 0.0; 
    4445        Hanni.Shape = Shape.Circle; 
     
    5455                 
    5556        Hoo = new PlatformCharacter (100.0, 100.0); 
    56         Hoo.X = Level.Right - 20.0; 
     57        Hoo.X = Level.Right - 100.0; 
    5758        Hoo.Y = 0.0; 
    5859        Hoo.Shape = Shape.Circle; 
     
    6162        Hoo.CanRotate = false; 
    6263        Add(Hoo); 
    63         HoonAse = new AssaultRifle(90, 30); 
     64        HoonAse = new Cannon (90, 30); 
    6465        HoonAse.ProjectileCollision = AmmusOsui; 
    65         HoonAse.X += 50; 
    66         HoonAse.Y -= 10; 
     66        HoonAse.X += 80; 
    6767        Hoo.Add(HoonAse); 
     68        HoonAse.Power.DefaultValue = 20000; 
    6869    } 
    6970 
    7071    void AmmusOsui(PhysicsObject Ammus, PhysicsObject Kohde) 
    7172    { 
    72         //Ammus.Destroy, Kohde; 
     73        Ammus.Destroy(); 
    7374 
    7475    } 
     
    9596    void LuoKentta() 
    9697    { 
    97         Gravity = new Vector(0.0, -800.0); 
    98  
    99          
     98        Gravity = new Vector(0.0, -800.0);         
    10099        PhysicsObject AlaReuna = Level.CreateBottomBorder(0.0, false); 
    101100        PhysicsObject OikeaReuna = Level.CreateRightBorder(0.0, false); 
    102101        PhysicsObject VasenReuna = Level.CreateLeftBorder(0.0, false); 
     102        PhysicsObject YläReuna = Level.CreateTopBorder(0.0, false); 
    103103 
    104          
    105          
    106104 
    107          
    108105    } 
    109106 
     
    124121    { 
    125122        PhysicsObject Ammus = HanninAse.Shoot(); 
    126         Keyboard.Listen(Key.Space, ButtonState.Pressed, AmmuAseella, "Ammu", HanninAse); 
     123        Keyboard.Listen(Key.S, ButtonState.Pressed, AmmuAseella, "Ammu", HanninAse); 
     124        HanninAse.FireRate = 0.25; 
    127125 
    128126        if (Ammus != null) 
     
    133131        } 
    134132 
     133    } 
     134 
     135    void AmmuAseella2(Cannon HoonAse) 
     136    { 
     137        PhysicsObject Ammus = HoonAse.Shoot(); 
     138        Keyboard.Listen(Key.Down, ButtonState.Pressed, AmmuAseella2, "Ammu2", HoonAse); 
     139        HoonAse.FireRate = 0.25; 
     140         
     141 
     142        if (Ammus != null) 
     143        { 
     144            Ammus.Size *= 4; 
     145            Ammus.MaximumLifetime = TimeSpan.FromSeconds(4.0); 
     146 
     147        } 
     148 
     149 
    135150 
    136151    } 
     
    138153 
    139154 
    140  
    141  
    142  
    143  
    144  
    145  
    146  
    147  
    148  
    149155} 
Note: See TracChangeset for help on using the changeset viewer.