Changeset 6994


Ignore:
Timestamp:
2015-07-23 15:01:38 (8 years ago)
Author:
samsimpo
Message:

bess gem in uranus

Location:
2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • 2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrolls/TheSideScrolls.cs

    r6937 r6994  
    1313    const int RUUDUN_KOKO = 40; 
    1414 
     15    DoubleMeter elamaLaskuri; 
     16    IntMeter ammustenmaara = new IntMeter(0, 0, 25); 
    1517    PlatformCharacter pelaaja1; 
    1618 
     
    2325    Image possuKuva = LoadImage("the-boar"); 
    2426    Image aseKuva = LoadImage("the-boar"); 
     27    Image ammoKuva = LoadImage("boar-ammo"); 
     28    Image backroundKuva = LoadImage("background"); 
     29    Image tileKuva = LoadImage("tile"); 
    2530    public override void Begin() 
    2631    { 
     
    2833        LuoKentta(); 
    2934        LisaaNappaimet(); 
     35        LuoElamaLaskuri(); 
    3036 
    3137        Camera.Follow(pelaaja1); 
    3238        Camera.ZoomFactor = 1.2; 
    3339        Camera.StayInLevel = true; 
     40 
     41    } 
     42    void LuoElamaLaskuri() 
     43    { 
     44        elamaLaskuri = new DoubleMeter(5); 
     45        elamaLaskuri.MaxValue = 5; 
     46        elamaLaskuri.LowerLimit += ElamaLoppui; 
     47 
     48        ProgressBar elamaPalkki = new ProgressBar(150, 20); 
     49        elamaPalkki.X = Screen.Left + 150; 
     50        elamaPalkki.Y = Screen.Top - 20; 
     51        elamaPalkki.BindTo(elamaLaskuri); 
     52        Add(elamaPalkki); 
     53        elamaPalkki.Angle = Angle.RightAngle; 
     54        elamaPalkki.Color = Color.Transparent; 
     55 
     56        elamaPalkki.BarColor = Color.Red; 
     57 
     58        elamaPalkki.BorderColor = Color.Black; 
     59    } 
     60    void ElamaLoppui() 
     61    { 
     62        MessageDisplay.Add("You Dieded"); 
     63        pelaaja1.Destroy(); 
     64        pelaaja1.Weapon.Destroy(); 
     65    } 
     66    void LuoPanosLaskuri() 
     67    { 
     68 
     69        Label panosNaytto = new Label(); 
     70        panosNaytto.X = Screen.Left + 200; 
     71        panosNaytto.Y = Screen.Top -120; 
     72        panosNaytto.TextColor = Color.Black; 
     73        panosNaytto.Color = Color.White; 
     74 
     75        panosNaytto.BindTo(ammustenmaara); 
     76        Add(panosNaytto); 
     77        panosNaytto.Title = "Boar count"; 
     78 
     79 
    3480    } 
    3581    void LuoKentta() 
     
    3884        kentta.SetTileMethod('S', LisaaKivi); 
    3985        kentta.SetTileMethod('D', LisaaTaso2); 
     86        kentta.SetTileMethod('d', LisaaFakeDirt); 
    4087        kentta.SetTileMethod('T', LisaaTaso); 
    4188        kentta.SetTileMethod('*', LisaaTahti); 
    4289        kentta.SetTileMethod('P', LisaaPahis); 
    4390        kentta.SetTileMethod('N', LisaaPelaaja); 
     91        kentta.SetTileMethod('A', LisaaAmmo); 
     92        kentta.SetTileMethod('t', LisaaTile); 
    4493        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4594        Level.CreateBorders(); 
    4695        Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
    47     } 
     96        Level.Background.Image = backroundKuva; 
     97        LuoPanosLaskuri(); 
     98    } 
     99    void LisaaTile(Vector paikka, double leveys, double korkeus) 
     100    { 
     101    PhysicsObject tile = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     102        tile.Position = paikka; 
     103        Add(tile); 
     104        tile.Image = tileKuva; 
     105    } 
     106     
    48107 
    49108    void LisaaTaso(Vector paikka, double leveys, double korkeus) 
     
    60119        Add(taso2); 
    61120        taso2.Image = downdirtKuva; 
     121    } 
     122    void LisaaFakeDirt(Vector paikka, double leveys, double korkeus) 
     123    { 
     124        PhysicsObject fdirt = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     125        fdirt.Position = paikka; 
     126        Add(fdirt); 
     127        fdirt.Image = downdirtKuva; 
     128        fdirt.IgnoresCollisionResponse = true; 
    62129    } 
    63130    void LisaaKivi(Vector paikka, double leveys, double korkeus) 
     
    80147    void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    81148    { 
    82         pelaaja1 = new PlatformCharacter(100, 100); 
     149        pelaaja1 = new PlatformCharacter(50, 50); 
    83150        pelaaja1.Position = paikka; 
    84151        pelaaja1.Mass = 4.0; 
     
    89156        pelaaja1.Weapon = new AssaultRifle(40, 25); 
    90157 
    91         pelaaja1.Weapon.Ammo.Value = 1000; 
     158        pelaaja1.Weapon.Ammo.Value = 0; 
     159 
     160        pelaaja1.Weapon.Ammo.MaxValue = 25; 
     161 
     162        pelaaja1.Weapon.CanHitOwner = true; 
     163 
     164        pelaaja1.Weapon.FireRate = 5.0; 
    92165 
    93166        pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 
    94167 
    95168        pelaaja1.Weapon.Image = aseKuva; 
    96     } 
     169 
     170        AddCollisionHandler(pelaaja1, "pahis", VihollisTormaus); 
     171 
     172        AddCollisionHandler(pelaaja1, "ammo", AmmoKeräys); 
     173    } 
     174 
    97175    void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
    98176    { 
     
    105183        if (ammus != null) 
    106184        { 
     185            ammustenmaara.Value--; 
     186            pelaaja1.Weapon.Ammo.Value = ammustenmaara; 
    107187            ammus.Image = possuKuva; 
    108188            ammus.Size *= 12; 
    109189            ammus.MaximumLifetime = TimeSpan.FromSeconds(10.0); 
     190            ammus.Tag = "ammus"; 
    110191        } 
     192    } 
     193    void LisaaAmmo(Vector paikka, double leveys, double korkeus) 
     194    { 
     195        PhysicsObject ammo = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     196        ammo.IgnoresCollisionResponse = true; 
     197        ammo.Position = paikka; 
     198        ammo.Image = ammoKuva; 
     199        ammo.Tag = "ammo"; 
     200        Add(ammo); 
    111201    } 
    112202    void LisaaNappaimet() 
     
    154244        pahis.Image = possuKuva; 
    155245        RandomMoverBrain satunnaisAivot = new RandomMoverBrain(200); 
    156  
     246        AddCollisionHandler(pahis, "ammus", AmmusTormaus); 
    157247        satunnaisAivot.ChangeMovementSeconds = 3; 
    158  
     248        pahis.Tag = "pahis"; 
    159249        pahis.Brain = satunnaisAivot; 
    160250 
    161251    } 
     252    void AmmusTormaus(PhysicsObject tormaaja, PhysicsObject kohde) 
     253    { 
     254        tormaaja.Destroy(); 
     255        MessageDisplay.Add("xp added"); 
     256        
     257    } 
     258    void VihollisTormaus(PhysicsObject tormaaja, PhysicsObject kohde) 
     259    { 
     260        elamaLaskuri.Value -= 1; 
     261    } 
     262    void AmmoKeräys(PhysicsObject tormaaja, PhysicsObject kohde) 
     263    { 
     264        pelaaja1.Weapon.Ammo.Value = +1; 
     265        ammustenmaara.Value++; 
     266        kohde.Destroy(); 
     267    } 
    162268} 
  • 2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrolls/TheSideScrolls.csproj.Debug.cachefile

    r6937 r6994  
    99Content\shoulder.xnb 
    1010Content\the-boar.xnb 
     11Content\puolipalkki.xnb 
     12Content\tyhjapalkki.xnb 
     13Content\taysipalkki.xnb 
     14Content\ProgressBar.xnb 
     15Content\boar-ammo.xnb 
     16Content\background.xnb 
     17Content\tile.xnb 
  • 2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrolls/obj/x86/Debug/TheSideScrolls.csproj.FileListAbsolute.txt

    r6937 r6994  
    1717C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\shoulder.xnb 
    1818C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\the-boar.xnb 
     19C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\puolipalkki.xnb 
     20C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\tyhjapalkki.xnb 
     21C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\taysipalkki.xnb 
     22C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\ProgressBar.xnb 
     23C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\boar-ammo.xnb 
     24C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\background.xnb 
     25C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\tile.xnb 
  • 2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrolls/obj/x86/Debug/cachefile-{2F9CC970-4606-409A-BE85-CDF1A2096940}-targetpath.txt

    r6937 r6994  
    99Content\shoulder.xnb 
    1010Content\the-boar.xnb 
     11Content\puolipalkki.xnb 
     12Content\tyhjapalkki.xnb 
     13Content\taysipalkki.xnb 
     14Content\ProgressBar.xnb 
     15Content\boar-ammo.xnb 
     16Content\background.xnb 
     17Content\tile.xnb 
  • 2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrollsContent/TheSideScrollsContent.contentproj

    r6937 r6994  
    107107    </Compile> 
    108108  </ItemGroup> 
     109  <ItemGroup> 
     110    <Compile Include="puolipalkki.png"> 
     111      <Name>puolipalkki</Name> 
     112      <Importer>TextureImporter</Importer> 
     113      <Processor>TextureProcessor</Processor> 
     114    </Compile> 
     115  </ItemGroup> 
     116  <ItemGroup> 
     117    <Compile Include="tyhjapalkki.png"> 
     118      <Name>tyhjapalkki</Name> 
     119      <Importer>TextureImporter</Importer> 
     120      <Processor>TextureProcessor</Processor> 
     121    </Compile> 
     122  </ItemGroup> 
     123  <ItemGroup> 
     124    <Compile Include="taysipalkki.png"> 
     125      <Name>taysipalkki</Name> 
     126      <Importer>TextureImporter</Importer> 
     127      <Processor>TextureProcessor</Processor> 
     128    </Compile> 
     129  </ItemGroup> 
     130  <ItemGroup> 
     131    <Compile Include="ProgressBar.png"> 
     132      <Name>ProgressBar</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135    </Compile> 
     136  </ItemGroup> 
     137  <ItemGroup> 
     138    <Compile Include="boar-ammo.png"> 
     139      <Name>boar-ammo</Name> 
     140      <Importer>TextureImporter</Importer> 
     141      <Processor>TextureProcessor</Processor> 
     142    </Compile> 
     143  </ItemGroup> 
     144  <ItemGroup> 
     145    <Compile Include="background.jpg"> 
     146      <Name>background</Name> 
     147      <Importer>TextureImporter</Importer> 
     148      <Processor>TextureProcessor</Processor> 
     149    </Compile> 
     150  </ItemGroup> 
     151  <ItemGroup> 
     152    <Compile Include="tile.png"> 
     153      <Name>tile</Name> 
     154      <Importer>TextureImporter</Importer> 
     155      <Processor>TextureProcessor</Processor> 
     156    </Compile> 
     157  </ItemGroup> 
    109158  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    110159  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrollsContent/kentta1.txt

    r6937 r6994  
    33 
    44 
    5  
    6  
    7  
    8  
    9  
    10                           
    11        N                   
    12 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT 
    13 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDTT 
    14 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSS  TTTTTTTTTTTTTTTTTTTTTTTTTTTT 
    15 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSSSS                         SDDDDDDDDDD 
    16 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSSSSSSSSSSSSSSSSSSSSSS   SDDDDDDDDDD 
    17 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSSSSSSSSSSSSSSSSSSSS  SDDDDDDDDDDD 
    18                                                          ssssssssssSSSSSSSSSS   SDDDDDDDDD 
     5.................................................................... 
     6.................................................................... 
     7PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 
     8......................................................................... 
     9....................................................................... 
     10.......................................................................t.t.t..................... 
     11.......N............AAA................................................ttttt.............................. 
     12TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT....................tt.tt.................................................... 
     13DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDTT...................tt.tt................................... 
     14DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSS....TTTTTTTTTTTTTTTTTTTTTTTTTT..................................... 
     15DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSS..........................SDDDDDDDDDD.................................................. 
     16DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDSSSSSSSSSSSSSSSSSSSSSS.....SDDDDDDDDDDD.............................. 
     17.........................................................SSSSSSSSSSSSSSS......SDDDDDDDDD........................... 
     18..........................................................SSSSSSSSSSSSSSS........SDDDD......................... 
     19.................................................................................................................. 
     20......................................................................................................................... 
     21............................................................................................................................... 
     22........................................................................................................................................... 
     23................................................................................................................................. 
     24.................................................................................................................................. 
  • 2015/30/SamuliP/TheSidescrollsArena/TheSideScrolls/TheSideScrolls/TheSideScrollsContent/obj/x86/Debug/ContentPipeline.xml

    r6937 r6994  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2015-07-22T14:51:58.3971963+03:00</Time> 
     38      <Time>2015-07-23T14:59:03.8181859+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    9191      <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\the-boar.xnb</Output> 
    9292      <Time>2015-07-22T14:26:33.2330691+03:00</Time> 
     93    </Item> 
     94    <Item> 
     95      <Source>puolipalkki.png</Source> 
     96      <Name>puolipalkki</Name> 
     97      <Importer>TextureImporter</Importer> 
     98      <Processor>TextureProcessor</Processor> 
     99      <Options>None</Options> 
     100      <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\puolipalkki.xnb</Output> 
     101      <Time>2015-07-23T10:33:57.5389951+03:00</Time> 
     102    </Item> 
     103    <Item> 
     104      <Source>tyhjapalkki.png</Source> 
     105      <Name>tyhjapalkki</Name> 
     106      <Importer>TextureImporter</Importer> 
     107      <Processor>TextureProcessor</Processor> 
     108      <Options>None</Options> 
     109      <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\tyhjapalkki.xnb</Output> 
     110      <Time>2015-07-23T10:34:01.6711951+03:00</Time> 
     111    </Item> 
     112    <Item> 
     113      <Source>taysipalkki.png</Source> 
     114      <Name>taysipalkki</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\taysipalkki.xnb</Output> 
     119      <Time>2015-07-23T10:34:08.0515951+03:00</Time> 
     120    </Item> 
     121    <Item> 
     122      <Source>ProgressBar.png</Source> 
     123      <Name>ProgressBar</Name> 
     124      <Importer>TextureImporter</Importer> 
     125      <Processor>TextureProcessor</Processor> 
     126      <Options>None</Options> 
     127      <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\ProgressBar.xnb</Output> 
     128      <Time>2015-07-23T10:34:27.6273951+03:00</Time> 
     129    </Item> 
     130    <Item> 
     131      <Source>boar-ammo.png</Source> 
     132      <Name>boar-ammo</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135      <Options>None</Options> 
     136      <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\boar-ammo.xnb</Output> 
     137      <Time>2015-07-23T12:46:41.7454859+03:00</Time> 
     138    </Item> 
     139    <Item> 
     140      <Source>background.jpg</Source> 
     141      <Name>background</Name> 
     142      <Importer>TextureImporter</Importer> 
     143      <Processor>TextureProcessor</Processor> 
     144      <Options>None</Options> 
     145      <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\background.xnb</Output> 
     146      <Time>2015-07-23T14:27:50.0307859+03:00</Time> 
     147    </Item> 
     148    <Item> 
     149      <Source>tile.png</Source> 
     150      <Name>tile</Name> 
     151      <Importer>TextureImporter</Importer> 
     152      <Processor>TextureProcessor</Processor> 
     153      <Options>None</Options> 
     154      <Output>C:\MyTemp\SamuliP\TheSidescrollsArena\TheSideScrolls\TheSideScrolls\TheSideScrolls\bin\x86\Debug\Content\tile.xnb</Output> 
     155      <Time>2015-07-23T14:53:50.0501859+03:00</Time> 
    93156    </Item> 
    94157    <BuildSuccessful>true</BuildSuccessful> 
Note: See TracChangeset for help on using the changeset viewer.