Changeset 7380


Ignore:
Timestamp:
2016-06-16 14:54:07 (7 years ago)
Author:
karkaite
Message:

I have nearly completed making the game. Just have to additional features and some modification, i think that's it.

Location:
2016/24/HaseebS
Files:
10 added
16 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/Dreamcast.cs

    r7348 r7380  
    99public class Dreamcast : PhysicsGame 
    1010{ 
    11     
     11 
     12    PlatformCharacter character; 
     13    PlatformCharacter character2; 
     14    Image player1Picture = LoadImage("Player1"); 
     15    Image player2picture= LoadImage("player2"); 
     16    AssaultRifle Player1Gun; 
     17    AssaultRifle Player2Gun; 
     18 
    1219    public override void Begin() 
     20 
     21   
    1322    { 
    1423        CreateLevel(); 
     24        Camera.ZoomToAllObjects(); 
     25        addControl(); 
     26        Gravity = new Vector(0.0, -300.0); 
     27      
     28         
     29         
    1530         
    1631         
    1732 
    18         // TODO: Kirjoita ohjelmakoodisi tähän 
     33    } 
    1934 
    20         PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    21         Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    22     } 
    2335    void CreateLevel() 
    2436    { 
     
    2739        boxes.SetTileMethod('W', Wall); 
    2840        boxes.SetTileMethod('#', Ground); 
    29         boxes.SetTileMethod('C', Characters); 
    30         boxes.Execute(20, 20); 
     41        boxes.SetTileMethod('C', Character); 
     42        boxes.SetTileMethod('D', Character2); 
     43        boxes.Execute(); 
    3144 
    3245    } 
     
    3750        obstacles.Shape = Shape.Rectangle; 
    3851        obstacles.Color = Color.GreenYellow; 
    39         obstacles.CollisionIgnoreGroup = 1; 
     52         
    4053        Add(obstacles); 
    4154    } 
     
    5669        ground.Color = Color.Gray; 
    5770        ground.Shape = Shape.Rectangle; 
    58         ground.CollisionIgnoreGroup = 1; 
     71        //ground.CollisionIgnoreGroup = 1; 
    5972        Add(ground); 
    6073    } 
    61     void Characters(Vector place, double height, double width) 
     74    void Character(Vector place, double height, double width) 
    6275    { 
    63         PhysicsObject characters = PhysicsObject.CreateStaticObject(width, height); 
    64         characters.Position = place; 
    65         characters.Color = Color.Red; 
    66         characters.Shape = Shape.Rectangle; 
    67         characters.CollisionIgnoreGroup = 1; 
    68         Add(characters); 
     76        character = new PlatformCharacter(30, 30); 
     77        character.Position = place; 
     78        character.X = -50.0; 
     79        character.Color = Color.Black; 
     80        character.Shape = Shape.Rectangle; 
     81        character.CollisionIgnoreGroup = 1; 
     82        character.Image = player1Picture; 
     83        Add(character); 
     84 
     85        createGun(); 
    6986    } 
    70       
    7187 
     88    void Character2(Vector place, double height, double width) 
     89    { 
     90        character2 = new PlatformCharacter(30, 30); 
     91        character2.Position = place; 
     92        character2.X = 70.0; 
     93        character2.Color = Color.Black; 
     94        character2.Shape = Shape.Rectangle; 
     95        character2.CollisionIgnoreGroup = 1; 
     96        character2.Image = Image.Mirror(player2picture); 
     97        Add(character2); 
    7298 
    73      
     99        createGun2(); 
     100    } 
     101 
     102    void createGun() 
     103    { 
     104        Player1Gun = new AssaultRifle(30, 10); 
     105        Player1Gun.Ammo.Value = 1000; 
     106        Player1Gun.MaxAmmoLifetime = TimeSpan.FromSeconds(3.0); 
     107        //Add(Player1Gun); 
     108        character.Weapon = Player1Gun; 
     109    } 
     110    void createGun2() 
     111    { 
     112        Player2Gun = new AssaultRifle(30, 10); 
     113        Player2Gun.Ammo.Value = 1000; 
     114        // player2 gun project tile collision = what happens after the bullet hit someone();   
     115        Player2Gun.MaxAmmoLifetime = TimeSpan.FromSeconds(3.0); 
     116        character2.Weapon = Player2Gun; 
     117    } 
     118    void ProjectileHit(PhysicsObject ammunition, PhysicsObject target) 
     119    { 
     120        ammunition.Destroy(); 
     121    } 
     122    void Shootthegun(AssaultRifle weapon) 
     123    { 
     124        PhysicsObject ammo = weapon.Shoot(); 
     125        if (ammo != null) 
     126        { 
     127            //ammo.Size *= 2; 
     128        } 
     129    } 
     130 
     131    void addControl() 
     132    { 
    74133         
     134        Keyboard.Listen(Key.W, ButtonState.Down,jump, "Player1 will jump", character,new Vector(0.0, 200.0)); 
     135        Keyboard.Listen(Key.A, ButtonState.Down, movement, "Player1 will turn left", character, new Vector(-100.0, 0.0)); 
     136        Keyboard.Listen(Key.D,ButtonState.Down, movement, "Player1 will turn right", character,new Vector(100.0, 0.0)); 
     137  
     138        Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, Shootthegun, "Shoot button", Player1Gun); 
    75139 
     140         
     141        Keyboard.Listen(Key.Up, ButtonState.Down, jump, "Player 2 will jump", character2, new Vector(0.0, 200.0)); 
     142        Keyboard.Listen(Key.Left, ButtonState.Down, movement, "Player 2 will turn left", character2, new Vector(-100.0, 0.0));    
     143        Keyboard.Listen(Key.Right, ButtonState.Down, movement, "Player 2 will move right", character2, new Vector(100.0, 0.0));  
     144        Keyboard.Listen(Key.Space, ButtonState.Pressed, Shootthegun, "Shoot button for Player2", Player2Gun ); 
     145         
     146        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    76147 
    77 } 
     148    } 
     149    void movement(PlatformCharacter player, Vector move) 
     150    { 
     151        player.Walk(move.X); 
     152    } 
     153    void jump (PlatformCharacter player, Vector jump) 
     154    { 
     155        player.Jump(jump.Y); 
     156    } 
     157 
     158 } 
  • 2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/Dreamcast.csproj.Debug.cachefile

    r7348 r7380  
    11Content\Hassebproject.xnb 
     2Content\Player2.xnb 
     3Content\Player1.xnb 
    24Content\Hassebproject.txt 
  • 2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/bin/x86/Debug/Content/Hassebproject.txt

    r7348 r7380  
    11 
    22 
    3                                                                                       
    4                                                                                       
    5                                                                                       
    6                                                                                       
    7                                                                                       
    8                                                                                       
    9 =====================================================================================W                
    10                                                                                      W 
    11                                                                                      W 
    12                                                                                      W 
    13                             iiiiiii          iiiiiiii                                W 
    14                                                                                      W 
    15                     iiiiiii          iiiiiii          iiiiiii                        W              
    16                                                                                      W                           
    17                                                                 ii            ii     W 
    18        ii              iiiiiii                      iiiiiii               ii         W 
    19             iiiiiii                     IIIIII                  iiiiiii              W 
    20                       iiiiiiiiii        IIIIII      iiiiiiiiii                       W 
    21                                       c IIIIII c                                     W   
    22 #####################################################################################W 
     3..................................................................................... 
     4..................................................................................... 
     5..................................................................................... 
     6..................................................................................... 
     7..................................................................................... 
     8..................................................................................... 
     9......################################################################################ 
     10......#..............................................................................# 
     11......#..............................................................................# 
     12......#..............................................................................# 
     13......#.........................iiiiiii.............iiiiiiii.........................# 
     14......#..............................................................................# 
     15......#...............iiiiiii.............iiiiiii.............iiiiiii................# 
     16......#..............................................................................#                           
     17......# ...........................iii....................iii........................# 
     18......#..............................................................................# 
     19......#...iii............iiiiiii......................iiiiiii...............iii......# 
     20......#..............................................................................# 
     21......#........iiiiiii............................................iiiiiii............# 
     22......#....................................iiiiii....................................# 
     23......#..................iiiiiiiiii........iiiiii......iiiiiiiiii....................# 
     24......#..................................D.iiiiii.C..................................# 
     25......################################################################################ 
  • 2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/obj/x86/Debug/ContentPipeline-{13E4EC85-E490-4DBC-A04D-2ED8958B34E1}.xml

    r7348 r7380  
    99      <Options>None</Options> 
    1010      <Output>C:\MyTemp\HaseebS\Dreamcast\Dreamcast\Dreamcast\bin\x86\Debug\Content\Hassebproject.xnb</Output> 
    11       <Time>2016-06-15T14:05:01.5436873+03:00</Time> 
     11      <Time>2016-06-16T10:40:08.873611+03:00</Time> 
     12    </Item> 
     13    <Item> 
     14      <Source>Player2.png</Source> 
     15      <Name>Player2</Name> 
     16      <Importer>TextureImporter</Importer> 
     17      <Processor>TextureProcessor</Processor> 
     18      <Options>None</Options> 
     19      <Output>C:\MyTemp\HaseebS\Dreamcast\Dreamcast\Dreamcast\bin\x86\Debug\Content\Player2.xnb</Output> 
     20      <Time>2016-06-16T13:39:15.7064354+03:00</Time> 
     21    </Item> 
     22    <Item> 
     23      <Source>Player1.png</Source> 
     24      <Name>Player1</Name> 
     25      <Importer>TextureImporter</Importer> 
     26      <Processor>TextureProcessor</Processor> 
     27      <Options>None</Options> 
     28      <Output>C:\MyTemp\HaseebS\Dreamcast\Dreamcast\Dreamcast\bin\x86\Debug\Content\Player1.xnb</Output> 
     29      <Time>2016-06-16T13:49:02.8431423+03:00</Time> 
    1230    </Item> 
    1331    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/obj/x86/Debug/Dreamcast.csproj.FileListAbsolute.txt

    r7348 r7380  
    99C:\MyTemp\HaseebS\Dreamcast\Dreamcast\Dreamcast\bin\x86\Debug\Content\Hassebproject.txt 
    1010C:\MyTemp\HaseebS\Dreamcast\Dreamcast\Dreamcast\obj\x86\Debug\Dreamcast.csprojResolveAssemblyReference.cache 
     11C:\MyTemp\HaseebS\Dreamcast\Dreamcast\Dreamcast\bin\x86\Debug\Content\Player2.xnb 
     12C:\MyTemp\HaseebS\Dreamcast\Dreamcast\Dreamcast\bin\x86\Debug\Content\Player1.xnb 
  • 2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/obj/x86/Debug/cachefile-{13E4EC85-E490-4DBC-A04D-2ED8958B34E1}-targetpath.txt

    r7348 r7380  
    11Content\Hassebproject.xnb 
     2Content\Player2.xnb 
     3Content\Player1.xnb 
    24Content\Hassebproject.txt 
  • 2016/24/HaseebS/Dreamcast/Dreamcast/DreamcastContent/DreamcastContent.contentproj

    r7348 r7380  
    5353    </Compile> 
    5454  </ItemGroup> 
     55  <ItemGroup> 
     56    <Compile Include="Player2.png"> 
     57      <Name>Player2</Name> 
     58      <Importer>TextureImporter</Importer> 
     59      <Processor>TextureProcessor</Processor> 
     60    </Compile> 
     61  </ItemGroup> 
     62  <ItemGroup> 
     63    <Compile Include="Player1.png"> 
     64      <Name>Player1</Name> 
     65      <Importer>TextureImporter</Importer> 
     66      <Processor>TextureProcessor</Processor> 
     67    </Compile> 
     68  </ItemGroup> 
    5569  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    5670  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/24/HaseebS/Dreamcast/Dreamcast/DreamcastContent/Hassebproject.txt

    r7348 r7380  
    11 
    22 
    3                                                                                       
    4                                                                                       
    5                                                                                       
    6                                                                                       
    7                                                                                       
    8                                                                                       
    9 #####################################################################################W                
    10 #                                                                                   #W 
    11 #                                                                                   #W 
    12 #                                                                                   #W 
    13 #                         iiiiiii          iiiiiiii                                 #W 
    14 #                                                                                   #W 
    15 #               iiiiiii          iiiiiii          iiiiiii                           #W              
    16 #                                                                                                                   #W                           
    17 #                                                    ii            ii                                       #W 
    18 # 
    19 #       ii              iiiiiii                      iiiiiii               ii       #W 
    20 #            iiiiiii                     IIIIII                  iiiiiii            #W 
    21 #                      iiiiiiiiii        IIIIII      iiiiiiiiii                     #W 
    22 #                                      c IIIIII c                                   #W   
    23 #####################################################################################W 
     3..................................................................................... 
     4..................................................................................... 
     5..................................................................................... 
     6..................................................................................... 
     7..................................................................................... 
     8..................................................................................... 
     9......################################################################################ 
     10......#..............................................................................# 
     11......#..............................................................................# 
     12......#..............................................................................# 
     13......#.........................iiiiiii.............iiiiiiii.........................# 
     14......#..............................................................................# 
     15......#...............iiiiiii.............iiiiiii.............iiiiiii................# 
     16......#..............................................................................#                           
     17......# ...........................iii....................iii........................# 
     18......#..............................................................................# 
     19......#...iii............iiiiiii......................iiiiiii...............iii......# 
     20......#..............................................................................# 
     21......#........iiiiiii............................................iiiiiii............# 
     22......#....................................iiiiii....................................# 
     23......#..................iiiiiiiiii........iiiiii......iiiiiiiiii....................# 
     24......#..................................D.iiiiii.C..................................# 
     25......################################################################################ 
  • 2016/24/HaseebS/Hassebproject.txt

    r7348 r7380  
    1515                    iiiiiii          iiiiiii          iiiiiii                        W              
    1616                                                                                     W                           
    17                                                                 ii            ii     W 
     17                                ii              ii                                   W 
    1818       ii              iiiiiii                      iiiiiii               ii         W 
    1919            iiiiiii                     IIIIII                  iiiiiii              W 
Note: See TracChangeset for help on using the changeset viewer.