la otra parte del juego que es el movimiento de la pelota atravez del laberinto y la creacion de un afecto camara, eso lo saque de un ejemplo de esta pagina http://brunoprog64.blogsome.com/2008/01/24/efecto-de-camera-con-pygame/ el de esta pagina tiene unos cuantos errores que arregle a duras penas, quemando pestaña toda una semana, por que la verdad no encontre nada mas en ningun sitio, y no se mucho de programar, por eseo me fue tan dificil, pero ya esta. bueno, aqui esta el codigo
- Código: Seleccionar todo
- # #### efecto camara laberinto #### #
 # -*- coding: iso-8859-1 -*-
 import wx
 provider = wx.SimpleHelpProvider()
 wx.HelpProvider_Set(provider)
 import MyFrame
 class App(wx.App):
 def OnInit(self):
 wx.InitAllImageHandlers()
 self.main = MyFrame.MyFrame(None,-1,'')
 self.main.Show()
 self.SetTopWindow(self.main)
 return 1
 def main():
 application = App(0)
 application.MainLoop()
 if __name__ == '__main__':
 main()
 class VwXtaskBar(wx.TaskBarIcon):
 def __init__(self,win):
 self.win=win
 wx.TaskBarIcon.__init__(self)
 self.Bind(wx.EVT_TASKBAR_MOVE,self.VwXAllEvents)
 self.Bind(wx.EVT_TASKBAR_LEFT_DOWN,self.VwXAllEvents)
 self.Bind(wx.EVT_TASKBAR_LEFT_UP,self.VwXAllEvents)
 self.Bind(wx.EVT_TASKBAR_RIGHT_DOWN,self.VwXAllEvents)
 self.Bind(wx.EVT_TASKBAR_RIGHT_UP,self.VwXAllEvents)
 self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK,self.VwXAllEvents)
 self.Bind(wx.EVT_TASKBAR_RIGHT_DCLICK,self.VwXAllEvents)
 self.Bind(wx.EVT_MENU,self.OnMenu,id=-1)
 
 def VwXAllEvents(self,event):
 self.win.GetEventHandler().ProcessEvent(event)
 if(event.GetEventType()==wx.wxEVT_TASKBAR_RIGHT_DOWN):
 event.Skip(True)
 def CreatePopupMenu(self):
 return self.win.VwXGetTaskBarMenu()
 def OnMenu(self,event):
 self.win.GetEventHandler().ProcessEvent(event)
 import pygame
 from pygame.locals import *
 pygame.init()
 campo = pygame.image.load('imag/campo.jpg')
 bola = pygame.image.load('imag/icono3.png')
 fondo = pygame.image.load("imag/laberinto.png")
 bol = bola.get_rect()
 bol.left = 35
 bol.top = 45
 bola_tl = bol.left
 bola_tt = bol.top
 ayu = 5
 clock = pygame.time.Clock()
 screen = pygame.display.set_mode((320,240))
 n = 0
 campo_x = 0
 campo_y = 0
 while n <> 1:
 screen.blit(campo, (campo_x,campo_y))
 screen.blit(bola, (bola_tl, bola_tt))
 screen.blit(fondo, (campo_x, campo_y))
 pygame.display.flip()
 
 clock.tick(50)
 
 pygame.event.pump()
 tecla_pres = pygame.key.get_pressed()
 
 
 
 if tecla_pres[K_LEFT]:
 bol.left = bol.left - 5
 bola_tl = bola_tl - 5
 
 if bola_tl <10> 10:
 
 bola_tl = 10
 campo_x = campo_x + ayu
 else:
 bola_tl = 10
 bol.left = 10
 
 if tecla_pres[K_RIGHT]:
 bol.left = bol.left + 5
 bola_tl = bola_tl + 5
 
 
 if bola_tl > 290:
 if bol.left <4970> 20:
 
 bola_tl = 290
 campo_x = campo_x - ayu
 else:
 bola_tl = 290
 bol.left = 4970
 
 
 
 
 if tecla_pres[K_UP]:
 bol.top = bol.top - 5
 bola_tt = bola_tt - 5
 
 if bola_tt <10> 10:
 
 bola_tt = 10
 campo_y = campo_y + ayu
 else:
 bola_tt = 10
 bol.top = 10
 
 
 if tecla_pres[K_DOWN]:
 bol.top = bol.top + 5
 bola_tt = bola_tt + 5
 
 
 if bola_tt > 210:
 if bol.top <4970> 210:
 
 bola_tt = 210
 campo_y = campo_y - ayu
 else:
 bola_tt = 210
 bol.top = 4970
 
 
 
 
 
 for event in pygame.event.get():
 if event.type == QUIT:
 n = 1
 if event.type == KEYDOWN:
 if event.key == K_ESCAPE:
 n = 1
 if event.key == K_p:
 print "Valor Campo_x: ", campo_x
 print "Valores de bola - Camara:"
 print "Left: ", bol.left
 print "Top: ", bol.top
 print "Valores de bola - Pantalla:"
 print "Left: ", bola_tl
 print "Top: ", bola_tt
y pues aca esta un rar de el proyecto, por si quieren verlo funcionando y veran que es lo que quiero hacer, es un poquito pesado, pero por lo que las imagenes de el laberinto son tan grandes.
por algo es un laberinto casi imposible de solucionar.
http://rapidshare.com/files/247044695/laberinto_paso_1.rar.html


