[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] pygame.error: video system not initialized
- To: pygame-users <pygame-users@xxxxxxxx>
- Subject: [pygame] pygame.error: video system not initialized
- From: Alex Hall <mehgcap@xxxxxxxxx>
- Date: Fri, 21 May 2010 10:45:05 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 21 May 2010 10:45:40 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=oqM+h7TjAI4nSgtFU1vC2BKB4hY1KSNeYAjC5Uar2EU=; b=cm5s+CueX5bSL1OdSI/hHYmCYm9S/WmtE7mHjtOkpkFdJm8L1hfaT1M1BxGu4/0WuQ FpNQEsE+qAfVtor3VKLpeD5gClV5hQLlMf5mq3+o0G0TE7F6d2UV/n7A26SK9xfOFZcv AbUkz9m/2dXLajmaU848CqtfQazZJ6n3rfkPQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=m7lc+6RDnLdG0nZd1HCUBOYIZJuecpB74OtF8nSOos+eyiaHA3PvxHY6CDyN/CYv8K nbLRJuCfZPYZe/NK+7aKsJZMGqGs92NQ46VXMzQaStXpYAs926z2H/Ld13WGwm/faKHw SBb7lNO7y44A+mHaab+p7gONvG/VZAqgsrI88=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi all,
I have added a lot of classes and such to my battleship game, and I am
now trying to test it before I continue. I have several hotkeys set
up, including ctrl-arrow keys. However, I am getting odd behavior with
my hotkeys; my ctrl-down, for example, switches me out of the pygame
window completely. When I hit escape to close the window, I see an
error:
pygame.error: video system not initialized.
Apparently this is an indicator that I am not initializing something,
since the error happens on the start of the for loop that watches for
events:
for e in pygame.event.get():
However, near the top of the file holding that loop, I do:
import pygame.
from pygame.locals import *
pygame.init()
win=pygame.display.set_mode((boardRows*squareSize, boardCols*squareSize))
pygame.display.set_caption("Battleship")
board.drawBoard(win, boardRows, boardCols, squareSize) #draw a pretty
grid on the #screen
I included the last line since I am wondering if passing win to
another function could be causing problems? All the other function
does is try to draw a couple rectangles (which does not work) then
returns True. All it needs win for is to get the size so it can get a
surface to draw on.
I have also tried including the line
pygame.display.init()
but that did not change anything. TIA for any suggestions.
--
Have a great day,
Alex (msg sent from GMail website)
mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap