Changeset 5977 for 2015/24


Ignore:
Timestamp:
2015-06-10 11:31:28 (8 years ago)
Author:
otoskinn
Message:
 
Location:
2015/24/OttoK/Grand Theft Norsu II
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • 2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II.csproj.Debug.cachefile

    r5951 r5977  
    66Content\auto1kuva.xnb 
    77Content\kursori1.xnb 
     8Content\panos.xnb 
    89Content\kentta1.txt 
  • 2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/Grand_Theft_Norsu_II.cs

    r5951 r5977  
    1515    const double hyppyNopeus = 1000; 
    1616    const int RUUDUN_KOKO = 42; 
     17    GameObject tahtain; 
    1718 
    1819    PlatformCharacter pelaaja1; 
     
    2223    Image auto1kuva = LoadImage("auto1kuva"); 
    2324    Image kursorinkuva = LoadImage("kursori1"); 
     25    Image panoksenkuba = LoadImage("panos"); 
    2426    double hyppykerroin = 1.0; 
     27    AssaultRifle pelaajan1Ase; 
     28    Grenade kranaatti; 
     29 
     30 
    2531 
    2632    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     
    3339        SetWindowSize(1024, 768, true);  
    3440        Gravity = new Vector(0, -1000); 
    35  
    36         Mouse.IsCursorVisible = true; 
     41         
     42 
     43 
     44        Mouse.IsCursorVisible = false; 
    3745        Vector paikkaRuudulla = Mouse.PositionOnScreen; 
    3846        Vector paikkaKentalla = Mouse.PositionOnWorld; 
    39          
     47        tahtain = new GameObject(50, 50); 
     48        tahtain.Image = kursorinkuva; 
     49        Add(tahtain); 
    4050 
    4151        LuoKentta(); 
     
    7282        taso.Position = paikka; 
    7383        taso.Color = Color.Green; 
     84        taso.IgnoresExplosions = true; 
    7485        Add(taso); 
    7586    } 
     
    92103        pelaaja1.Image = pelaajanKuva; 
    93104        AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 
     105        pelaajan1Ase = new AssaultRifle(30, 10); 
     106 
     107        //Ammusten määrä aluksi: 
     108        pelaajan1Ase.Ammo.Value = 1000; 
     109 
     110        //Mitä tapahtuu kun ammus osuu johonkin? 
     111        pelaajan1Ase.ProjectileCollision = AmmusOsui; 
     112 
     113        pelaaja1.Add(pelaajan1Ase); 
    94114        Add(pelaaja1); 
     115       
     116 
    95117 
    96118         
     
    121143        Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    122144        Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    123         Keyboard.Listen(Key.Space, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    124145        Keyboard.Listen(Key.F2, ButtonState.Down, AvaaKirjoitusIkkuna, "Avaa kirjoitusikkunan"); 
    125146        Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, AsetaHyppykerroin, "Korkeampi hyppy", 1.5); 
     
    127148        //Mouse.Listen(MouseButton.Left, ButtonState.Pressed, TarkistaHiirenPainallus, "Objektin kohdalla toiminto"); 
    128149        Keyboard.Listen(Key.F, ButtonState.Pressed, UlosAutosta, "Mene ulos autosta"); 
     150        Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaajan1Ase); 
     151        Keyboard.Listen(Key.E, ButtonState.Pressed, HeitaKranaatti, "Heita kranaatti", pelaaja1);  
     152 
     153    //ammus.Destroy(); 
     154 
    129155 
    130156        Mouse.ListenWheel(ZoomaaKenttaa, ""); 
     157        Mouse.ListenMovement(0.0, TahtaaAseella, ""); 
     158        Mouse.ListenMovement(0.0, KuunteleLiiketta, null); 
     159        //kranaatti.Explosion.AddShockwaveHandler("vihollinen", KranaattiOsui); 
    131160 
    132161        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
     
    141170        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    142171    } 
    143  
     172         
    144173    void Liikuta(PlatformCharacter hahmo, double nopeus) 
    145174    { 
     
    189218        string vastaus = ikkuna.InputBox.Text; 
    190219 
    191         if (vastaus == "gravity0") 
     220        if (vastaus == "/gravity0") 
    192221        { 
    193222            Gravity = new Vector(0, 0); 
    194223        } 
    195         else if (vastaus == "gravity1") 
     224        else if (vastaus == "/gravity1") 
    196225        { 
    197226            Gravity = new Vector(0, -1000); 
    198227        } 
    199         else if (vastaus == "createcar") 
     228        else if (vastaus == "/createcar") 
    200229        { 
    201230            LuoAuto(pelaaja1.Position, 0, 0); 
    202231        } 
    203         else if (vastaus == "canrotate") 
     232        else if (vastaus == "/canrotate") 
    204233        { 
    205234            pelaaja1.CanRotate = true; 
    206235 
    207236        } 
    208         else if (vastaus == "cantrotate") 
     237        else if (vastaus == "/cantrotate") 
    209238        { 
    210239            pelaaja1.CanRotate = false; 
    211240        } 
    212         else if (vastaus == "superspeed") 
     241        else if (vastaus == "/superspeed") 
    213242        { 
    214243            nopeus = 1500; 
     
    216245            LisaaNappaimet(); 
    217246        } 
    218         else if (vastaus == "normalspeed") 
     247        else if (vastaus == "/normalspeed") 
    219248        { 
    220249            nopeus = 750; 
     
    222251            LisaaNappaimet(); 
    223252        } 
    224         else if (vastaus == "showcodes") 
    225         { 
    226             MessageDisplay.Add("gravity0, gravity1, createcar, canrotate, cantrotate, superspeed, normalspeed."); 
    227         } 
    228  
     253        else if (vastaus == "/showcodes") 
     254        { 
     255            MessageDisplay.Add("/gravity0, /gravity1, /createcar, /canrotate, /cantrotate, /superspeed, /normalspeed."); 
     256        } 
     257 
     258        
    229259    } 
    230260 
     
    310340 
    311341    } 
     342    void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
     343    { 
     344        ammus.Destroy(); 
     345    
     346    } 
     347     
     348    void AmmuAseella(AssaultRifle ase) 
     349    { 
     350        PhysicsObject ammus = ase.Shoot(); 
     351 
     352 
     353        if(ammus != null) 
     354        { 
     355            AddCollisionHandler(ammus, "auto", TuhoaAuto); 
     356            //ammus.Size *= 3; 
     357            ammus.Image = panoksenkuba; 
     358            //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 
     359        } 
     360    } 
     361    void TahtaaAseella(AnalogState hiirenLiike) 
     362    { 
     363        Vector suunta = (Mouse.PositionOnWorld - pelaajan1Ase.AbsolutePosition).Normalize(); 
     364        pelaajan1Ase.Angle = suunta.Angle; 
     365    } 
     366    void KuunteleLiiketta(AnalogState hiirenTila) 
     367    { 
     368 
     369 
     370        Vector hiirenLiike = hiirenTila.MouseMovement; 
     371        //if (hiirenLiike.Magnitude > 0) 
     372        //{ 
     373 
     374            tahtain.X = Mouse.PositionOnWorld.X; 
     375            tahtain.Y = Mouse.PositionOnWorld.Y; 
     376        //} 
     377 
     378        //tahtain.Move(hiirenTila.StateVector * 30); 
     379     
     380    } 
     381    void HeitaKranaatti(PlatformCharacter pelaaja) 
     382    { 
     383        Grenade kranu = new Grenade(4.0); 
     384        pelaaja.Throw(kranu, Angle.FromDegrees(30), 10000); 
     385        kranu.Explosion.ShockwaveReachesObject += KranaattiOsui; 
     386    } 
     387     
     388    void KranaattiOsui(IPhysicsObject rajahdyksenKohde, Vector v) 
     389    { 
     390        rajahdyksenKohde.Destroy(); 
     391    } 
     392 
     393    void TuhoaAuto(PhysicsObject ammus, PhysicsObject auto) 
     394    { 
     395        ammus.Destroy(); 
     396        Flame liekki = new Flame(); 
     397        liekki.Position = new Vector(10, 10); 
     398        Add(liekki); 
     399 
     400    } 
    312401} 
  • 2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/bin/x86/Debug/Content/kentta1.txt

    r5951 r5977  
    33#..........................................................................................................................# 
    44#..........................................................................................................................# 
     5#.......########..................###.........................########.....................................................# 
    56#..........................................................................................................................# 
    67#..........................................................................................................................# 
    7 #..........................................................................................................................# 
    8 #.....................................##########...........................................................................# 
    9 #..........................................................................................................................# 
     8#.....................................##########...............................#######.....................................# 
     9#.................##########.........................................................................#######...............# 
    1010#.....................................................###......N...........................................................# 
    11 #.........................................................#######..........................................................# 
    12 #..........................................................................................................................# 
    13 #............................................................................########......................................# 
     11#.##############..........................................#######........................#########.........................# 
     12#.....................................###########..........................................................................# 
     13#...................#############............................................########......................................# 
     14#..................................................................#####...................................................# 
     15#..........................................................####...................................####..######.............# 
     16#.............................########.....................................................................................# 
     17#...........................................................##############......................#######....................# 
     18#................#######...................########...........................##########...................................# 
     19#.......###................................................................................................................# 
    1420#..........................................................................................................................# 
    1521#..........................................................................................................................# 
    16 #..........................................................................................................................# 
    17 #..........................................................................................................................# 
    18 #..........................................................................................................................# 
    19 #..........................................................................................................................# 
    20 #............................................................................###...........................................# 
    21 #........................................................................####..............................................# 
    22 ############################################################################################################################# 
     22############################################################################################################################ 
  • 2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/obj/x86/Debug/Grand Theft Norsu II.csproj.FileListAbsolute.txt

    r5951 r5977  
    2929C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\auto1kuva.xnb 
    3030C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\kursori1.xnb 
     31C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\panos.xnb 
  • 2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu II/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r5951 r5977  
    66Content\auto1kuva.xnb 
    77Content\kursori1.xnb 
     8Content\panos.xnb 
    89Content\kentta1.txt 
  • 2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu IIContent/Grand Theft Norsu IIContent.contentproj

    r5951 r5977  
    8989    </Compile> 
    9090  </ItemGroup> 
     91  <ItemGroup> 
     92    <Compile Include="panos.png"> 
     93      <Name>panos</Name> 
     94      <Importer>TextureImporter</Importer> 
     95      <Processor>TextureProcessor</Processor> 
     96    </Compile> 
     97  </ItemGroup> 
    9198  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    9299  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu IIContent/kentta1.txt

    r5951 r5977  
    33#..........................................................................................................................# 
    44#..........................................................................................................................# 
     5#.......########..................###.........................########.....................................................# 
    56#..........................................................................................................................# 
    67#..........................................................................................................................# 
    7 #..........................................................................................................................# 
    8 #.....................................##########...........................................................................# 
    9 #..........................................................................................................................# 
     8#.....................................##########...............................#######.....................................# 
     9#.................##########.........................................................................#######...............# 
    1010#.....................................................###......N...........................................................# 
    11 #.........................................................#######..........................................................# 
    12 #..........................................................................................................................# 
    13 #............................................................................########......................................# 
     11#.##############..........................................#######........................#########.........................# 
     12#.....................................###########..........................................................................# 
     13#...................#############............................................########......................................# 
     14#..................................................................#####...................................................# 
     15#..........................................................####...................................####..######.............# 
     16#.............................########.....................................................................................# 
     17#...........................................................##############......................#######....................# 
     18#................#######...................########...........................##########...................................# 
     19#.......###................................................................................................................# 
    1420#..........................................................................................................................# 
    1521#..........................................................................................................................# 
    16 #..........................................................................................................................# 
    17 #..........................................................................................................................# 
    18 #..........................................................................................................................# 
    19 #..........................................................................................................................# 
    20 #............................................................................###...........................................# 
    21 #........................................................................####..............................................# 
    22 ############################################################################################################################# 
     22############################################################################################################################ 
  • 2015/24/OttoK/Grand Theft Norsu II/Grand Theft Norsu II/Grand Theft Norsu IIContent/obj/x86/Debug/ContentPipeline-.xml

    r5951 r5977  
    99      <Options>None</Options> 
    1010      <Output>C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\kentta1.xnb</Output> 
    11       <Time>2015-06-09T14:56:36.8658082+03:00</Time> 
     11      <Time>2015-06-10T09:33:28.0736852+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    6565      <Time>2015-06-09T13:18:40.3480394+03:00</Time> 
    6666    </Item> 
     67    <Item> 
     68      <Source>panos.png</Source> 
     69      <Name>panos</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\otoskinn\Grand Theft Norsu II\Grand Theft Norsu II\Grand Theft Norsu II\bin\x86\Debug\Content\panos.xnb</Output> 
     74      <Time>2015-06-10T10:32:54.6480024+03:00</Time> 
     75    </Item> 
    6776    <BuildSuccessful>true</BuildSuccessful> 
    6877    <Settings> 
Note: See TracChangeset for help on using the changeset viewer.