Changeset 5815 for 2014


Ignore:
Timestamp:
2015-03-14 13:50:18 (5 years ago)
Author:
sieerinn
Message:
 
Location:
2014/koodauskerho/38/EetuR/Work_in_progress_wip
Files:
5 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2014/koodauskerho/38/EetuR/Work_in_progress_wip/Work_in_progress_wip/Work_in_progress_wip/Work_in_progress_wip.cs

    r5814 r5815  
    1717    Image pelaajanKuva = LoadImage("Pelaaja_hahmo_tykki_kasi"); 
    1818    Image tahtiKuva = LoadImage("tahti"); 
     19    Image vihukuva = LoadImage("Vihu1"); 
     20    SoundEffect maaliAani = LoadSoundEffect("maali"); 
    1921 
    20     SoundEffect maaliAani = LoadSoundEffect("maali"); 
     22    AssaultRifle pelaajan1Ase; 
     23    Image energyshot = LoadImage("energyshot"); 
    2124 
    2225    public override void Begin() 
    2326    { 
    2427        Gravity = new Vector(0, -1000); 
     28 
     29         
    2530 
    2631        LuoKentta(); 
     
    3843        kentta.SetTileMethod('*', LisaaTahti); 
    3944        kentta.SetTileMethod('P', LisaaPelaaja); 
     45        kentta.SetTileMethod('1', LisaaVihu1); 
    4046        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4147        Level.CreateBorders(); 
     
    5965        tahti.Tag = "tahti"; 
    6066        Add(tahti); 
    61   
     67    } 
    6268 
    63  
     69    void LisaaVihu1(Vector paikka, double leveys, double korkeus) 
     70    { 
     71        PlatformCharacter vihu1 = new PlatformCharacter(leveys, korkeus + 10); 
     72        vihu1.Position = paikka; 
     73        vihu1.Image = vihukuva; 
     74        vihu1.Tag = "vihollinen"; 
     75        Add(vihu1); 
     76    } 
    6477 
    6578 
     
    6780    void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    6881    { 
    69         pelaaja1 = new PlatformCharacter(leveys, korkeus); 
     82        pelaaja1 = new PlatformCharacter(leveys, korkeus + 10); 
    7083        pelaaja1.Position = paikka; 
    7184        pelaaja1.Mass = 4.0; 
     
    7386        AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 
    7487        Add(pelaaja1); 
    75     }   }public class Work_in_progress_wip :  
    76 { 
    77     AssaultRifle pelaajan1Ase; 
    7888 
    79     public override void Begin() 
    80     { 
    81         //... 
    82     }pelaajan1Ase = new AssaultRifle(30, 10); 
     89        pelaajan1Ase = new AssaultRifle(30, 10); 
     90 
     91         
     92     
    8393 
    8494//Ammusten määrä aluksi: 
    85 pelaajan1Ase.Ammo.Value = 1000; 
     95//pelaajan1Ase.Ammo.Value = 1000; 
     96        pelaajan1Ase.InfiniteAmmo = true; 
    8697 
    8798//Mitä tapahtuu kun ammus osuu johonkin? 
    8899pelaajan1Ase.ProjectileCollision = AmmusOsui; 
    89100 
     101pelaajan1Ase.IsVisible = false; 
    90102pelaaja1.Add(pelaajan1Ase); 
     103pelaaja1.Weapon = pelaajan1Ase; 
     104    } 
    91105 
    92         void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
     106 
     107  void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
    93108{ 
    94     //ammus.Destroy(); 
     109    if (kohde.Tag != "tahti") { ammus.Destroy(); } 
     110     
    95111} 
    96 { 
    97     PhysicsObject ammus = ase.Shoot(); 
    98112 
    99     if(ammus != null) 
    100     { 
    101         //ammus.Size *= 3; 
    102         //ammus.Image = ... 
    103         //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 
    104     }//pelaaja1 on PlatformCharacter-tyyppinen 
    105 pelaaja1.Weapon = new AssaultRifle(30, 10); 
     113   
     114 
     115    
     116 
     117 
     118 
    106119void AmmuAseella(PlatformCharacter pelaaja) 
    107120{ 
     
    111124    { 
    112125        //ammus.Size *= 3; 
    113         //ammus.Image = ... 
    114         //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 
     126        ammus.Image = energyshot; 
     127        //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.5); 
    115128    } 
    116 }pyssy.Angle += Angle.FromDegrees(1); 
     129    //pyssy.Angle += Angle.FromDegrees(1); 
    117130 
    118131 
    119  
    120 }AssaultRifle pyssy = new AssaultRifle(20, 5); 
     132//AssaultRifle pyssy = new AssaultRifle(20, 5); 
    121133//pyssy.ProjectileCollision = AmmusOsui; 
    122134} 
     
    138150 
    139151        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    140         Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaajan1Ase); 
    141     }void AmmuAseella(AssaultRifle ase) 
     152        Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 
     153    } 
     154    
    142155 
    143156    void Liikuta(PlatformCharacter hahmo, double nopeus) 
  • 2014/koodauskerho/38/EetuR/Work_in_progress_wip/Work_in_progress_wip/Work_in_progress_wip/Work_in_progress_wip.csproj.Debug.cachefile

    r5814 r5815  
    55Content\Pelaaja_hahmo_tykki_kasi.xnb 
    66Content\Pelaaja_hahmo_tykki_kasi_move.xnb 
     7Content\energyshot.xnb 
     8Content\Vihu1.xnb 
  • 2014/koodauskerho/38/EetuR/Work_in_progress_wip/Work_in_progress_wip/Work_in_progress_wip/obj/x86/Debug/ContentPipeline-{D80F600A-7311-4ED4-989C-E68287FC5CE5}.xml

    r5814 r5815  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\EetuR\Work_in_progress_wip\Work_in_progress_wip\Work_in_progress_wip\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2015-02-14T12:28:18.095512+02:00</Time> 
     38      <Time>2015-03-14T13:38:14.7137287+02:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    5555      <Output>C:\MyTemp\EetuR\Work_in_progress_wip\Work_in_progress_wip\Work_in_progress_wip\bin\x86\Debug\Content\Pelaaja_hahmo_tykki_kasi_move.xnb</Output> 
    5656      <Time>2015-02-14T11:20:40+02:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>energyshot.png</Source> 
     60      <Name>energyshot</Name> 
     61      <Importer>TextureImporter</Importer> 
     62      <Processor>TextureProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\EetuR\Work_in_progress_wip\Work_in_progress_wip\Work_in_progress_wip\bin\x86\Debug\Content\energyshot.xnb</Output> 
     65      <Time>2015-03-14T10:40:58.6206193+02:00</Time> 
     66    </Item> 
     67    <Item> 
     68      <Source>Vihu1.png</Source> 
     69      <Name>Vihu1</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\EetuR\Work_in_progress_wip\Work_in_progress_wip\Work_in_progress_wip\bin\x86\Debug\Content\Vihu1.xnb</Output> 
     74      <Time>2015-03-14T13:30:00.3765362+02:00</Time> 
    5775    </Item> 
    5876    <BuildSuccessful>true</BuildSuccessful> 
  • 2014/koodauskerho/38/EetuR/Work_in_progress_wip/Work_in_progress_wip/Work_in_progress_wip/obj/x86/Debug/Work_in_progress_wip.csproj.FileListAbsolute.txt

    r5814 r5815  
    1313C:\MyTemp\EetuR\Work_in_progress_wip\Work_in_progress_wip\Work_in_progress_wip\bin\x86\Debug\Content\Pelaaja_hahmo_tykki_kasi.xnb 
    1414C:\MyTemp\EetuR\Work_in_progress_wip\Work_in_progress_wip\Work_in_progress_wip\bin\x86\Debug\Content\Pelaaja_hahmo_tykki_kasi_move.xnb 
     15C:\MyTemp\EetuR\Work_in_progress_wip\Work_in_progress_wip\Work_in_progress_wip\bin\x86\Debug\Content\energyshot.xnb 
     16C:\MyTemp\EetuR\Work_in_progress_wip\Work_in_progress_wip\Work_in_progress_wip\bin\x86\Debug\Content\Vihu1.xnb 
  • 2014/koodauskerho/38/EetuR/Work_in_progress_wip/Work_in_progress_wip/Work_in_progress_wip/obj/x86/Debug/cachefile-{D80F600A-7311-4ED4-989C-E68287FC5CE5}-targetpath.txt

    r5814 r5815  
    55Content\Pelaaja_hahmo_tykki_kasi.xnb 
    66Content\Pelaaja_hahmo_tykki_kasi_move.xnb 
     7Content\energyshot.xnb 
     8Content\Vihu1.xnb 
  • 2014/koodauskerho/38/EetuR/Work_in_progress_wip/Work_in_progress_wip/Work_in_progress_wipContent/Work_in_progress_wipContent.contentproj

    r5814 r5815  
    8181    </Compile> 
    8282  </ItemGroup> 
     83  <ItemGroup> 
     84    <Compile Include="energyshot.png"> 
     85      <Name>energyshot</Name> 
     86      <Importer>TextureImporter</Importer> 
     87      <Processor>TextureProcessor</Processor> 
     88    </Compile> 
     89  </ItemGroup> 
     90  <ItemGroup> 
     91    <Compile Include="Vihu1.png"> 
     92      <Name>Vihu1</Name> 
     93      <Importer>TextureImporter</Importer> 
     94      <Processor>TextureProcessor</Processor> 
     95    </Compile> 
     96  </ItemGroup> 
    8397  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    8498  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2014/koodauskerho/38/EetuR/Work_in_progress_wip/Work_in_progress_wip/Work_in_progress_wipContent/kentta1.txt

    r5814 r5815  
    88......................................................................... 
    99......................................................................... 
    10 ................#........................................................ 
    11 ..........................**............................................. 
    12 ................*....#..............*.................................... 
    13 ................*............*.............*............................. 
    14 ................#...............*...#...*................................ 
    15 .............................*..#########..*............................. 
    16 ..................###.......##......*......##............................ 
    17 ......................#####....................#####..................... 
    18 ......................*...*.........P..........*...*..................... 
     10......................................................................... 
     11...............*......................................................... 
     12......................................................................... 
     13......................................................................... 
     14......................................................................... 
     15.....................##..1......*.......*......1...1..................... 
     16...............#.......###...#####..*..#####...#####...#.......1#........ 
     17..............###...............*.......*..............##......##........ 
     18..........#..#####..#...............P..................###....###........ 
    1919######################################################################### 
Note: See TracChangeset for help on using the changeset viewer.