Changeset 8720 for 2017/24


Ignore:
Timestamp:
2017-06-15 13:53:55 (6 years ago)
Author:
npo17_23
Message:
 
Location:
2017/24/LeeviE
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • 2017/24/LeeviE/Peli/Jump/Jump/Jump/Jump.cs

    r8716 r8720  
    6666 
    6767 
    68         PhysicsObject vihollinen = new PhysicsObject(124.0, 84.0); 
     68        PhysicsObject vihollinen = new PhysicsObject(84.0, 124.0); 
    6969        vihollinen.Image = vihu1; 
     70        vihollinen.CanRotate = false; 
    7071        SmoothTextures = false; 
    7172        Add(vihollinen); 
    72  
    73         
     73        vihollinen.Tag = "vihollinen"; 
     74 
     75       RandomGen for (int i = 0; i < 20; i++) 
     76        { 
     77 
     78        } 
     79 
     80 
    7481    } 
    7582 
     
    8491        pelaaja.Position = paikka; 
    8592        AddCollisionHandler(pelaaja, "tahti", TormaaTahteen); 
    86         pelaaja.Weapon = new AssaultRifle(30, 10); 
    87         pelaaja.Weapon.Ammo.Value = 10000; 
    88         pelaaja.Weapon.ProjectileCollision = AmmusOsui; 
    89         pelaaja.Add(pelaaja.Weapon); 
     93        AddCollisionHandler(pelaaja, "vihollinen", TormaaViholliseen); 
     94        //pelaaja.Weapon = new AssaultRifle(30, 10); 
     95        //pelaaja.Weapon.Ammo.Value = 10000; 
     96        //pelaaja.Weapon.ProjectileCollision = AmmusOsui; 
     97        //pelaaja.Add(pelaaja.Weapon); 
    9098 
    9199         
     
    95103 
    96104    } 
    97     void ammu() 
    98     { 
    99         Keyboard.Listen(Key.W, ButtonState.Down, AmmuAseella, "Ammu", pelaaja); 
    100     } 
    101     void AmmusOsui(PhysicsObject ammus, PhysicsObject vihollinen) 
    102     { 
    103         
    104         //ammus.Destroy 
    105     } 
    106     void AmmuAseella(PlatformCharacter pelaaja) 
    107     { 
    108         PhysicsObject ammus = pelaaja.Weapon.Shoot(); 
    109          
    110  
    111         if(ammus != null) 
    112         { 
    113             //ammus.Size *= 3; 
    114            // ammus.Image = ... 
    115            //ammus.MaximunLifetime = TimeSpan.FromSeconds(2.0); 
    116  
    117  
    118         } 
    119          
    120     } 
     105   
    121106    void TormaaTahteen(PhysicsObject pelaaja, PhysicsObject tahti) 
    122107    { 
    123108        tahti.Destroy(); 
    124109        MessageDisplay.Add("Keräsit tähden!"); 
     110    } 
     111 
     112    void TormaaViholliseen(PhysicsObject pelaaja, PhysicsObject vihollinen) 
     113    { 
     114        pelaaja.Destroy(); 
     115        MessageDisplay.Add("Kuolit"); 
    125116    } 
    126117 
     
    157148    } 
    158149 
    159  
     150   
    160151 
    161152    void LuoPalikka(Vector paikka, double leveys, double korkeus) 
Note: See TracChangeset for help on using the changeset viewer.