views:

461

answers:

1

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?

+1  A: 

I don't see any mistake in the code at all. It works! It probably is related to how you're doing the clicking.

Are you clicking with the left mouse button?

kylebrooks
Yes, I am clicking it with the left mouse button.
Masi
It works now for me too. The problem was is in Komodo.
Masi