I am a fairly new user of pygame and i decided to start out with a simple but 'funny' game. I have successfully implemented jumping mechanics, movement mechanics and a one directional shooting mechanic, however when trying to put this shooting mechanic to work both ways i couldnt figure out why it didnt work, i have tried a few things to fix it but i do not know what is wrong with it. It will only shoot towards the left side. Also, I did create all the code myself without tutorials and external input so perhaps there is a better system for my shooting mechanic. Here is the code:
#Importation & initialisation
import pygame as py
import sys
import random
py.init()
CLOCK = py.time.Clock()
#loop variable
running = True
#Colours
White = (255, 255, 255)
Black = (0, 0, 0)
Blue = (0, 70, 200)
#variables
#Fruit merchant
FRUITmerchant_HEALTH = 10
XfruitM = 500
YfruitM = 500
SpeedFruitM = 5
RIGHTDASH = False
LEFTDASH = False
JumpingF = False
#weapns for fruit
WeaponFruit_right = False
WeaponFruit_left = False
APPLE = False
YfruitApple = 530
XfruitApple = 495
Apple_reach = 20
Apple_VELOCITYX = Apple_reach
#Veg merchant
XvegM = 100
YvegM = 500
SpeedVegM = 5
JumpingV = False
#Forces
YGRAVITY = 0.7
JUMPHEIGHT = 21
Y_VELOCITY = JUMPHEIGHT
Y_VELOCITYV = JUMPHEIGHT # FOR VEG
Air_Resistance = 1
#Setup
Screen = py.display.set_mode((600, 600))
#Fruit Merchant functions for movement
def move_leftFruitM():
# a function is like a mini program in your main program so therefore you mjst declare a variable global
global SpeedFruitM, WeaponFruit_right, WeaponFruit_left
global XfruitM
if py.key.get_pressed()[py.K_LEFT]: #