Ignore:
Timestamp:
2018-07-31 12:01:24 (15 months ago)
Author:
lukrmoil
Message:
 
File:
1 edited

Legend:

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

    r9822 r9824  
    2828    { 
    2929        AlkuValikko(); 
    30         IsFullScreen = true; 
     30        //IsFullScreen = true; 
    3131         
    3232 
     
    4747        HanninAse = new PlasmaCannon(60, 20);         
    4848        HanninAse.ProjectileCollision = AmmusOsui; 
     49        HanninAse.Power.DefaultValue = 7500; 
     50        HanninAse.Power.Value = HanninAse.Power.DefaultValue; 
    4951        HanninAse.X += 50; 
    5052        HanninAse.CanHitOwner = false; 
     
    6870        HoonAse.Power.Value = HoonAse.Power.DefaultValue; 
    6971        AddCollisionHandler(Hanni, "AlaReuna", ResattaaHyppyLaskuri); 
     72        AddCollisionHandler(Hanni, "taso", ResattaaHyppyLaskuri); 
     73 
    7074        AddCollisionHandler(Hanni, "sivureuna", KimpoaReunasta); 
    7175        AddCollisionHandler(Hoo, "sivureuna", KimpoaReunasta); 
     
    143147        PeliUkko pu = (PeliUkko)Kohde; 
    144148         
    145         pu.Elamalaskuri.AddValue(-8); 
     149        pu.Elamalaskuri.AddValue(-5); 
    146150        if (Ammus.Tag.Equals("PelaajanAmmus")) 
    147151        { 
     
    156160        if (!Kohde2.Tag.Equals("pelaaja")) return; 
    157161        PeliUkko pu = (PeliUkko)Kohde2; 
    158         pu.Elamalaskuri.AddValue(-11); 
    159  
    160  
     162        pu.Elamalaskuri.AddValue(-8); 
    161163    } 
    162164 
    163165    void LuoNappaimet() 
    164166    { 
    165         //Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppy, null, Hanni, 1250.0); 
    166         //Keyboard.Listen(Key.D, ButtonState.Down, Kavely, null, Hanni, 650.0); 
    167         //Keyboard.Listen(Key.A, ButtonState.Down, Kavely, null, Hanni, -650.0); 
    168         //Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppy, null, Hoo, 1250.0); 
    169         //Keyboard.Listen(Key.Right, ButtonState.Down, Kavely, null, Hoo, 350.0); 
    170         //Keyboard.Listen(Key.Left, ButtonState.Down, Kavely, null, Hoo, -350.0); 
    171         //Keyboard.Listen(Key.S, ButtonState.Pressed, AmmuAseella, "Ammu", HanninAse); 
    172         //Keyboard.Listen(Key.Down, ButtonState.Pressed, AmmuAseella2, "Ammu2", HoonAse); 
     167        Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppy, null, Hanni, 1250.0); 
     168        Keyboard.Listen(Key.D, ButtonState.Down, Kavely, null, Hanni, 650.0); 
     169        Keyboard.Listen(Key.A, ButtonState.Down, Kavely, null, Hanni, -650.0); 
     170         
     171        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppy, null, Hoo, 2100.0); 
     172        Keyboard.Listen(Key.Right, ButtonState.Down, Kavely, null, Hoo, 350.0); 
     173        Keyboard.Listen(Key.Left, ButtonState.Down, Kavely, null, Hoo, -350.0); 
     174 
     175        Keyboard.Listen(Key.S, ButtonState.Pressed, AmmuAseella, "Ammu", HanninAse); 
     176        Keyboard.Listen(Key.Down, ButtonState.Pressed, AmmuAseella2, "Ammu2", HoonAse); 
    173177        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    174178     
     
    180184        ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Kavely, null, Hanni, -650.0); 
    181185 
    182         ControllerTwo.Listen(Button.A, ButtonState.Down, Hyppy, null, Hoo, 1150.0); 
    183         //ControllerTwo.Listen(Button.A, ButtonState.Up, Hyppy, null, Hoo, 1000.0); 
     186        ControllerTwo.Listen(Button.A, ButtonState.Pressed, Hyppy, null, Hoo, 2100.0);       
    184187        ControllerTwo.Listen(Button.DPadRight, ButtonState.Down, Kavely, null, Hoo, 300.0); 
    185188        ControllerTwo.Listen(Button.DPadLeft, ButtonState.Down, Kavely, null, Hoo, -300.0); 
    186189 
    187190    } 
     191    void LuoTaso(double x, double y) 
     192    { 
     193        Image Taso = LoadImage("platform"); 
     194        PhysicsObject taso = PhysicsObject.CreateStaticObject(275, 25); 
     195        taso.X = x; 
     196        taso.Y = y; 
     197        Add(taso); 
     198        taso.Oscillate(new Vector(0, 10), 50, 0.5); 
     199        taso.Image = Taso; 
     200        taso.Tag = "taso"; 
     201 
     202        taso.MakeOneWay(); 
     203 
     204    } 
    188205    void LuoKentta() 
    189206    { 
     207         
    190208        MediaPlayer.Stop(); 
    191209        MediaPlayer.Volume = 0.2; 
     
    195213        Level.Width = Screen.Width; 
    196214        Level.Height = Screen.Height; 
    197         Level.Background.Image = taustis; 
     215        Level.Background.Image = taustis2; 
    198216        Level.Background.ScaleToLevelByWidth(); 
    199217        Gravity = new Vector(0.0, -1750.0);         
     
    201219        AlaReuna.Y += 75; 
    202220        AlaReuna.Tag = "AlaReuna"; 
    203         AlaReuna.Color = Color.Brown; 
     221        AlaReuna.Color = Color.Black; 
    204222        PhysicsObject OikeaReuna = Level.CreateRightBorder(1.0, true); 
    205223        OikeaReuna.Tag = "OikeaReuna"; 
     
    210228        PhysicsObject YlaReuna = Level.CreateTopBorder(0.0, true); 
    211229        YlaReuna.Tag = "YlaReuna"; 
     230        LuoTaso(Level.Left + 400.0, 0); 
     231        LuoTaso(Level.Right - 400.0, 0); 
    212232    } 
    213233 
     
    248268    { 
    249269        if (lattia.Y > tyyppi.Y) 
     270         
    250271        { 
    251272            return; 
     
    283304    class PeliUkko : PlatformCharacter 
    284305    { 
    285         public IntMeter Elamalaskuri = new IntMeter(80, 0, 80); 
     306        public IntMeter Elamalaskuri = new IntMeter(100, 0, 100); 
    286307        public IntMeter HyppyLaskuri = new IntMeter(0, 0, 2); 
    287308        public Controller Ohjain;         
Note: See TracChangeset for help on using the changeset viewer.