from schoginitoys import *
display_reset()
# Initialize your bullet position
bullet_x = 0
bullet_y = random.randint(0, 7) # Assume bullet starts at row 3 (adjust as needed)
display.pixel(bullet_x, bullet_y, 1)
display.show()
# random.randint(1, 6)
# Main loop
while True:
if Config.button_pressed: # Check the flag
# Reset the bullet position to the starting point
bullet_x = 0
display.pixel(bullet_x, bullet_y, 1)
display.show()
# Move the bullet across the display
while bullet_x < 32: # 32 columns across 4 8x8 segments
display.pixel(bullet_x, bullet_y, 0) # Clear previous position
bullet_x += 1
display.pixel(bullet_x, bullet_y, 1) # Light up new position
display.show()
time.sleep(0.05) # Adjust speed as needed
# Clear the bullet from the display
display.pixel(bullet_x, bullet_y, 0)
display.show()
# Reset the button flag
Config.button_pressed = False
bullet_x = 0
bullet_y = random.randint(0, 7) # Assume bullet starts at row 3 (adjust as needed)
display.pixel(bullet_x, bullet_y, 1)
display.show()