I have the following code:
import math
import pygame
from pygame.locals import *
# Initialize PyGame
pygame.init()
pygame.display.set_mode((800,600))
quit = False
roundtime = 20 # ms
nextupdate = pygame.time.get_ticks() + roundtime
framenum = 0
# Watering radius
r = 25
# Time step
dt = 1 # min
field = [0.0]*80*60
while not quit:
# Handle events
while True:
event = pygame.event.poll()
if event.type == pygame.QUIT:
quit = True
break
else:
break
while pygame.time.get_ticks() >= nextupdate:
nextupdate += roundtime
# Physics
# Mouse position
mpos = pygame.mouse.get_pos()
# Keyboard
keys = pygame.key.get_pressed()
# Mouse buttons
mbut = pygame.mouse.get_pressed()
The rest of the code is here: http://dpaste.com/114517/
A click should should drop water to the field. At the moment, it does not.
Do you see any mistake in the code?