- Timestamp:
- 2016-06-17 12:05:32 (7 years ago)
- Location:
- 2016/24/HaseebS/Dreamcast
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/Dreamcast.cs
r7428 r7440 86 86 character.Tag = "character"; 87 87 characterHealth = 5; 88 88 89 AddCollisionHandler(character, "character2", PlayerIsHit); 89 90 Add(character); … … 102 103 character2.Image = Image.Mirror(player2picture); 103 104 character2.Tag = "character2"; 105 104 106 AddCollisionHandler(character2, "character", PlayerIsHit); 107 105 108 character2Health = 5; 106 109 Add(character2); … … 115 118 Player1Gun.MaxAmmoLifetime = TimeSpan.FromSeconds(0.9); 116 119 Player1Gun.ProjectileCollision = ProjectileHit; 117 //Add(Player1Gun); 120 121 118 122 character.Weapon = Player1Gun; 119 123 } … … 124 128 Player2Gun.ProjectileCollision = ProjectileHit; 125 129 Player2Gun.MaxAmmoLifetime = TimeSpan.FromSeconds(0.9); 130 131 126 132 character2.Weapon = Player2Gun; 127 133 } … … 130 136 ammunition.Destroy(); 131 137 } 132 void Shootthegun(AssaultRifle weapon )138 void Shootthegun(AssaultRifle weapon, String tag) 133 139 { 134 140 PhysicsObject ammo = weapon.Shoot(); 135 141 if (ammo != null) 136 142 { 143 ammo.Tag = "ammo"; 137 144 ammo.Size *= 0.8; 138 145 } … … 146 153 Keyboard.Listen(Key.D,ButtonState.Down, movement, "Player1 will turn right", character,new Vector(100.0, 0.0)); 147 154 148 Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, Shootthegun, "Shoot button", Player1Gun );155 Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, Shootthegun, "Shoot button", Player1Gun, "character"); 149 156 150 157 … … 152 159 Keyboard.Listen(Key.Left, ButtonState.Down, movement, "Player 2 will turn left", character2, new Vector(-100.0, 0.0)); 153 160 Keyboard.Listen(Key.Right, ButtonState.Down, movement, "Player 2 will move right", character2, new Vector(100.0, 0.0)); 154 Keyboard.Listen(Key.Space, ButtonState.Pressed, Shootthegun, "Shoot button for Player2", Player2Gun );161 Keyboard.Listen(Key.Space, ButtonState.Pressed, Shootthegun, "Shoot button for Player2", Player2Gun, "character2" ); 155 162 156 163 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); … … 193 200 Gravity = new Vector(0.0, -420.0); 194 201 Level.Background.Image = wallpaper; 195 IsFullScreen = true;202 //IsFullScreen = true; 196 203 197 204 -
2016/24/HaseebS/Dreamcast/Dreamcast/Dreamcast/Dreamcast.csproj.Debug.cachefile
r7428 r7440 3 3 Content\Player1.xnb 4 4 Content\cool.xnb 5 Content\gunsound.xnb 5 6 Content\Hassebproject.txt
Note: See TracChangeset
for help on using the changeset viewer.