Changeset 7380
- Timestamp:
- 2016-06-16 14:54:07 (7 years ago)
- Location:
- 2016/24/HaseebS
- Files:
-
- 10 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/Dreamcast.cs
r7348 r7380 9 9 public class Dreamcast : PhysicsGame 10 10 { 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 12 19 public override void Begin() 20 21 13 22 { 14 23 CreateLevel(); 24 Camera.ZoomToAllObjects(); 25 addControl(); 26 Gravity = new Vector(0.0, -300.0); 27 28 29 15 30 16 31 17 32 18 // TODO: Kirjoita ohjelmakoodisi tähän33 } 19 34 20 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");21 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");22 }23 35 void CreateLevel() 24 36 { … … 27 39 boxes.SetTileMethod('W', Wall); 28 40 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(); 31 44 32 45 } … … 37 50 obstacles.Shape = Shape.Rectangle; 38 51 obstacles.Color = Color.GreenYellow; 39 obstacles.CollisionIgnoreGroup = 1;52 40 53 Add(obstacles); 41 54 } … … 56 69 ground.Color = Color.Gray; 57 70 ground.Shape = Shape.Rectangle; 58 ground.CollisionIgnoreGroup = 1;71 //ground.CollisionIgnoreGroup = 1; 59 72 Add(ground); 60 73 } 61 void Character s(Vector place, double height, double width)74 void Character(Vector place, double height, double width) 62 75 { 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(); 69 86 } 70 71 87 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); 72 98 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 { 74 133 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); 75 139 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"); 76 147 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 1 1 Content\Hassebproject.xnb 2 Content\Player2.xnb 3 Content\Player1.xnb 2 4 Content\Hassebproject.txt -
2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/bin/x86/Debug/Content/Hassebproject.txt
r7348 r7380 1 1 2 2 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 9 9 <Options>None</Options> 10 10 <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> 12 30 </Item> 13 31 <BuildSuccessful>true</BuildSuccessful> -
2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/obj/x86/Debug/Dreamcast.csproj.FileListAbsolute.txt
r7348 r7380 9 9 C:\MyTemp\HaseebS\Dreamcast\Dreamcast\Dreamcast\bin\x86\Debug\Content\Hassebproject.txt 10 10 C:\MyTemp\HaseebS\Dreamcast\Dreamcast\Dreamcast\obj\x86\Debug\Dreamcast.csprojResolveAssemblyReference.cache 11 C:\MyTemp\HaseebS\Dreamcast\Dreamcast\Dreamcast\bin\x86\Debug\Content\Player2.xnb 12 C:\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 1 1 Content\Hassebproject.xnb 2 Content\Player2.xnb 3 Content\Player1.xnb 2 4 Content\Hassebproject.txt -
2016/24/HaseebS/Dreamcast/Dreamcast/DreamcastContent/DreamcastContent.contentproj
r7348 r7380 53 53 </Compile> 54 54 </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> 55 69 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 56 70 <!-- 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 1 1 2 2 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 15 15 iiiiiii iiiiiii iiiiiii W 16 16 W 17 ii iiW17 ii ii W 18 18 ii iiiiiii iiiiiii ii W 19 19 iiiiiii IIIIII iiiiiii W
Note: See TracChangeset
for help on using the changeset viewer.