Changeset 6934


Ignore:
Timestamp:
2015-07-22 14:56:56 (8 years ago)
Author:
tomikkon
Message:
 
Location:
2015/30/TomiM/Tasohyppelypeli
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli.cs

    r6906 r6934  
    2424 
    2525 
    26     PhysicsObject vasenReuna; 
    27     PhysicsObject oikeaReuna; 
     26 
    2827 
    2928 
     
    3635 
    3736        LuoPistelaskuri(); 
    38          
     37 
     38        RandomMoverBrain satunnaisAivot = new RandomMoverBrain(100); 
     39        satunnaisAivot.ChangeMovementSeconds = 1; 
     40        vihollinen.Brain = satunnaisAivot; 
     41        satunnaisAivot.WanderRadius = 20; 
     42 
     43 
    3944 
    4045        Camera.Follow(pelaaja1); 
     
    4247        Camera.StayInLevel = true; 
    4348 
    44         
     49 
    4550    } 
    4651 
     
    4853    { 
    4954 
    50         PhysicsObject pelaaja1 = new PhysicsObject(40, 40, Shape.Rectangle); 
    51         Add(pelaaja1); 
    52  
    53         vasenReuna = Level.CreateLeftBorder(); 
    54         oikeaReuna = Level.CreateRightBorder(); 
     55        Level.AmbientLight = 0.3; 
     56 
     57        Light valo = new Light(); 
     58        valo.Intensity = 0.8; 
     59        valo.Distance = 1200; 
     60        valo.Position = valo.Position; 
     61        Add(valo); 
     62 
     63        Smoke savu = new Smoke(); 
     64        savu.Position = valo.Position; 
     65        Add(savu); 
     66        Wind = new Vector( 0, 0); 
     67 
    5568        Level.CreateBottomBorder(); 
    5669        Level.CreateTopBorder(); 
     
    6477        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    6578        Level.CreateBorders(); 
    66         Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
     79        Level.Background.CreateGradient(Color.Blue, Color.SkyBlue); 
    6780    } 
    6881    void PelaajaTormasi(PhysicsObject vihollinen, PhysicsObject pelaaja1) 
    6982    { 
    70         if ((pelaaja1 == vasenReuna) || (pelaaja1 == oikeaReuna)) 
     83 
    7184        { 
    72             AloitaAlusta(); 
     85 
    7386        } 
    7487 
     
    104117        AddCollisionHandler(pelaaja1, "pahis", PelaajaOsuu); 
    105118        Add(pelaaja1); 
    106  
     119        pelaaja1.CanRotate = false; 
     120 
     121        pelaaja1.Weapon = new PlasmaCannon(20, 5); 
     122        pelaaja1.Weapon.Ammo.Value = 1000; 
     123         
     124         
     125        
     126         
    107127 
    108128    } 
     
    124144 
    125145 
     146 
     147 
    126148    } 
    127149 
     
    135157        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    136158 
    137  
     159        Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 
    138160 
    139161 
    140162        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    141163 
    142  
     164        Keyboard.Listen(Key.P, ButtonState.Pressed, Pause, "Pysäyttää pelin"); 
    143165 
    144166        ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 
     
    167189    void PelaajaOsuu(PhysicsObject hahmo, PhysicsObject vihollinen) 
    168190    { 
     191 
    169192        pelaaja1.Destroy(); 
     193        ClearAll(); 
     194        LuoKentta(); 
     195        LisaaNappaimet(); 
     196        LuoPistelaskuri(); 
     197 
     198        Camera.Follow(pelaaja1); 
     199 
     200 
     201        Gravity = new Vector(0, -1000); 
     202 
     203 
     204 
    170205 
    171206 
     
    192227        pisteNaytto.Color = Color.White; 
    193228 
     229        IntMeter keratytEsineet = new IntMeter(0); 
     230         
     231         
     232 
    194233        pisteNaytto.BindTo(pisteLaskuri); 
    195234        Add(pisteNaytto); 
    196235 
    197236        pisteNaytto.IntFormatString = "Kolikoita: {0:D1}"; 
    198          
    199     } 
    200     
    201     } 
    202  
    203  
    204  
    205      
     237 
     238    } 
     239    void AmmuAseella(PlatformCharacter pelaaja1) 
     240    { 
     241        PhysicsObject ammus = pelaaja1.Weapon.Shoot(); 
     242 
     243    } 
     244} 
     245 
     246 
     247 
    206248 
    207249       
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/kentta1.txt

    r6906 r6934  
    1   
    2   
    3  
    4  
    5  
    6  
    7  
    8  
    9  
    10  
    11       V     N      # 
    12       ##   ###    #    #    # 
    13       # *  # *  V # * ## V * #        
    14 ############################## 
     1             
     2            
     3               
     4            
     5                                              
     6          
     7                            V   *                        
     8                        * ##########  V 
     9*                     V#################### 
     10#                  #####             ***** 
     11##   V     N      ##                  #V 
     12 ##  ##   ###    #    #    #        ########****     # 
     13*     # *  # *  V # * ## * #   *################# V  #    V   * 
     14################################################################# 
  • 2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/obj/x86/Debug/ContentPipeline.xml

    r6906 r6934  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2015-07-22T11:30:17.6085364+03:00</Time> 
     38      <Time>2015-07-22T14:38:39.4380144+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    5454      <Options>None</Options> 
    5555      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi3.xnb</Output> 
    56       <Time>2015-07-22T09:54:57.5382364+03:00</Time> 
     56      <Time>2015-07-22T12:33:22.6179364+03:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6363      <Options>None</Options> 
    6464      <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\vihollinen.xnb</Output> 
    65       <Time>2015-07-22T10:02:33.1974364+03:00</Time> 
     65      <Time>2015-07-22T12:28:58.4467364+03:00</Time> 
    6666    </Item> 
    6767    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.