hello
so i have this problem that i can't solve and i need ur help.
im making a program that makes the user move the fish and there is a shark at the end that he tries to avoid.
here is the code
kik="b.jpg"
kif="kf.jpg"
kis="sss.jpg"
#these are pictures
import pygame,sys
from pygame.locals import *
pygame.init()
screen=pygame.display.set_mode((600,480))
color=(255,222,124)
background=pygame.image.load(kik).convert()
fish=pygame.image.load(kif).convert()
shark=pygame.image.load(kis).convert()
x=0
movex=0
z=0
while True:
for event in pygame.event.get():
if event.type==QUIT:
pygame.quit()
sys.exit()
if event.type==KEYDOWN:
if event.key==K_ESCAPE:
pygame.quit()
sys.exit()
if event.key==K_RIGHT:
movex=+1
if event.key == K_LEFT:
movex=-1
if event.key == K_SPACE:
movex=0
x+=movex
z+=1
screen.blit(background, (0,0))
screen.blit(fish, (x,180))
screen.blit(shark, (400,z))
screen.blit(text, (300,200))
if z >480:
z=0
pygame.display.update()
k i have to questions.
1. how can i make the fish stop when it touches the shark
2. how can i print text on the pygame window for example (oh noo u got killed)
thanks in advance