Fixed pistol and knife sprites for retail. Added firing mechanism.
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -120,14 +120,11 @@ class Player {
|
||||
}
|
||||
|
||||
void fire(int currentTime) {
|
||||
// Only spend ammo if the weapon isn't a knife
|
||||
bool shotFired = currentWeapon.fire(currentTime, currentAmmo: ammo);
|
||||
|
||||
// If it was a gun (not a knife) and it fired, consume ammo
|
||||
if (shotFired && currentWeapon is! Knife) {
|
||||
ammo--;
|
||||
}
|
||||
|
||||
// TODO: We'll add Raycast hit detection here next!
|
||||
}
|
||||
|
||||
void updateWeapon(int currentTime) {
|
||||
|
||||
Reference in New Issue
Block a user