Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2013-08-22 04:56:18 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2013-08-22 04:56:18 (GMT)
commit1bf47e4cf6bea3fcda927457540633af8216d3c6 (patch)
tree931128a07616b8052c664ad2822256122a949162 /src
parent716367f693eec2b3aaa1ac41e6bd312ca85fdec1 (diff)
remove unused imports
Diffstat (limited to 'src')
-rwxr-xr-xsrc/Main.py2
-rwxr-xr-xsrc/api/Anim.py3
-rwxr-xr-xsrc/api/Button.py4
-rwxr-xr-xsrc/api/Game.py9
-rw-r--r--src/api/Globe.py1
-rwxr-xr-xsrc/api/Math.py1
-rwxr-xr-xsrc/api/Sprite.py15
-rwxr-xr-xsrc/api/Sprite2.py4
-rwxr-xr-xsrc/api/Vector.py3
-rw-r--r--src/game/Area1Game1.py5
-rw-r--r--src/game/Area1Game6.py4
-rw-r--r--src/game/BoyHall.py20
-rw-r--r--src/game/CreditsState.py6
-rw-r--r--src/game/HallState.py22
-rw-r--r--src/game/MenuState.py51
-rw-r--r--src/game/PresentationState.py20
-rw-r--r--src/game/SelectAreaState.py17
-rw-r--r--src/game/SelectCharacterState.py4
-rw-r--r--src/game/SelectPartidaState.py5
19 files changed, 53 insertions, 143 deletions
diff --git a/src/Main.py b/src/Main.py
index 3603b51..4308f93 100755
--- a/src/Main.py
+++ b/src/Main.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
-from game.MenuState import CMenuState
from api.Game import CGame
+from game.MenuState import CMenuState
class EdSexualGame():
diff --git a/src/api/Anim.py b/src/api/Anim.py
index 0197452..2310f5e 100755
--- a/src/api/Anim.py
+++ b/src/api/Anim.py
@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+
+
class CAnim(object):
mNumFrames = 0
diff --git a/src/api/Button.py b/src/api/Button.py
index d3ab063..73e8d87 100755
--- a/src/api/Button.py
+++ b/src/api/Button.py
@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
-import pygame
from api.Label import CLabel
-
-from Mouse import *
+from Mouse import CMouse
class CButton(CLabel):
diff --git a/src/api/Game.py b/src/api/Game.py
index 37d0873..40b61f6 100755
--- a/src/api/Game.py
+++ b/src/api/Game.py
@@ -3,14 +3,9 @@
import gc
import gtk
import pygame
-#from pygame.locals import *
import pygame.font
import pygame.display
import pygame.sprite
-from pygame.locals import *
-
-import api.SuperSprite
-from SuperSprite import CSuperSprite
from api.Sprite2 import CSprite
from api.Mouse import CMouse
@@ -109,8 +104,8 @@ class CGame(object):
for event in pygame.event.get():
if event.type == pygame.QUIT:
self.mQuit = True
- elif event.type == KEYDOWN:
- if event.key == K_ESCAPE:
+ elif event.type == pygame.KEYDOWN:
+ if event.key == pygame.K_ESCAPE:
self.mQuit = True
#self.doEvents(event)
diff --git a/src/api/Globe.py b/src/api/Globe.py
index 6c84b80..7353bcb 100644
--- a/src/api/Globe.py
+++ b/src/api/Globe.py
@@ -2,7 +2,6 @@
import pygame
import Image
-from api.Sprite2 import CSprite
path = 'assets/images/dialog/'
diff --git a/src/api/Math.py b/src/api/Math.py
index 8b8eefc..1c02a11 100755
--- a/src/api/Math.py
+++ b/src/api/Math.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-#cp1252
import math
diff --git a/src/api/Sprite.py b/src/api/Sprite.py
index 3829225..39dbec8 100755
--- a/src/api/Sprite.py
+++ b/src/api/Sprite.py
@@ -6,10 +6,9 @@ import pygame
import math
import Image
import api.Math as CMath
-import api.Vector
from api.Vector import CVector
-from Mouse import *
+from Mouse import CMouse
# TODO: Cambiar las conversiones de grados a radianes y viceversa usando las funciones.
@@ -58,14 +57,14 @@ class CSpriteOLD(pygame.sprite.Sprite):
self.setBounds(0, 0, 1200, 900)
# Constants for the actions then the sprite reaches a border.
- CSprite.WRAP = 0 # Wrap around the edges.
- CSprite.BOUNCE = 1 # Bounce off the screen changing direction.
- CSprite.STOP = 2 # Stop at the edge of the screen.
- CSprite.HIDE = 3 # Move off-stage and stop.
- CSprite.CONTINUE = 4 # Move on forever.
+ #CSprite.WRAP = 0 # Wrap around the edges.
+ #CSprite.BOUNCE = 1 # Bounce off the screen changing direction.
+ #CSprite.STOP = 2 # Stop at the edge of the screen.
+ #CSprite.HIDE = 3 # Move off-stage and stop.
+ #CSprite.CONTINUE = 4 # Move on forever.
# Action for the sprite when it reaches a border.
- self.mBoundAction = CSprite.WRAP
+ #self.mBoundAction = CSprite.WRAP
diff --git a/src/api/Sprite2.py b/src/api/Sprite2.py
index edc02a3..59711f5 100755
--- a/src/api/Sprite2.py
+++ b/src/api/Sprite2.py
@@ -4,11 +4,9 @@
import pygame
import math
import Image
-import api.Math as CMath
-import api.Vector
from api.Vector import CVector
-from Mouse import *
+from Mouse import CMouse
class CSprite(pygame.sprite.Sprite):
""" An enhanced Sprite class
diff --git a/src/api/Vector.py b/src/api/Vector.py
index e474541..64a9703 100755
--- a/src/api/Vector.py
+++ b/src/api/Vector.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
import math
-from math import *
+from math import cos
+from math import sin
class CVector(object):
diff --git a/src/game/Area1Game1.py b/src/game/Area1Game1.py
index 8171d04..2e02490 100644
--- a/src/game/Area1Game1.py
+++ b/src/game/Area1Game1.py
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
+import pygame
from api.Sprite2 import CSprite
from api.Button import CButton
from api.Points import CPoints
from api.Label import CLabel
-
-from api.Mouse import *
-
+from api.Mouse import CMouse
import api.Math as Math
import api.Image as Image
from api.Vector import CVector
diff --git a/src/game/Area1Game6.py b/src/game/Area1Game6.py
index 5af4769..582442c 100644
--- a/src/game/Area1Game6.py
+++ b/src/game/Area1Game6.py
@@ -1,13 +1,11 @@
# -*- coding: utf-8 -*-
-import os
-import sys
import pygame
from api.Sprite2 import CSprite
from api.Button import CButton
from api.Points import CPoints
from api.MultiLabel import CMultiLabel
-from api.Mouse import *
+from api.Mouse import CMouse
import api.Math as CMath
import api.Image as Image
from api.Vector import CVector
diff --git a/src/game/BoyHall.py b/src/game/BoyHall.py
index 295a6bb..edf1628 100644
--- a/src/game/BoyHall.py
+++ b/src/game/BoyHall.py
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
+import pygame
from api.Sprite2 import CSprite
import api.Image as Image
from api.Anim import CAnim
-from api.Mouse import *
-from api.Vector import *
+from api.Mouse import CMouse
+from api.Vector import CVector
import api.Math as Math
class CBoyHall(CSprite):
@@ -48,6 +49,8 @@ class CBoyHall(CSprite):
mLastSense = 1
+ mTimeState = 0
+
def __init__(self):
CSprite.__init__(self)
@@ -79,7 +82,6 @@ class CBoyHall(CSprite):
self.mDestY = 500
self.setState(self.STATE_STALE)
-
def set_parent(self, aParent):
self.mParent = aParent
@@ -91,12 +93,20 @@ class CBoyHall(CSprite):
def set_destine(self, aDestine):
self.mDest = aDestine
+
+ def setTimeState(self, aTimeState):
+ self.mTimeState = aTimeState
+
+ def getTimeState(self):
+ return self.mTimeState
def update(self):
-
CSprite.update(self)
- self.mAnim.update()
+ self.mTimeState += 1
+
+ if self.mAnim:
+ self.mAnim.update()
if (self.mState == self.STATE_WALKING):
# Check if arrives to destination point.
diff --git a/src/game/CreditsState.py b/src/game/CreditsState.py
index 88874e9..0b2f38a 100644
--- a/src/game/CreditsState.py
+++ b/src/game/CreditsState.py
@@ -1,14 +1,8 @@
# -*- coding: utf-8 -*-
import MenuState
-from MenuState import *
-import api.GameState
from api.GameState import CGameState
-import api.MultiLabel
-from api.MultiLabel import CMultiLabel
-import api.Game
from api.Game import CGame
-import api.Button
from api.Button import CButton
import api.Image as CImage
from api.Globe import Globe
diff --git a/src/game/HallState.py b/src/game/HallState.py
index c7448f7..81c606f 100644
--- a/src/game/HallState.py
+++ b/src/game/HallState.py
@@ -1,31 +1,17 @@
# -*- coding: utf-8 -*-
+import pygame
import MenuState
-from MenuState import *
-import api.GameState
from api.GameState import CGameState
-import api.MultiLabel
-from api.MultiLabel import CMultiLabel
-import api.Game
from api.Game import CGame
-import api.Button
from api.Button import CButton
import api.Image as CImage
from api.Sprite2 import CSprite
-
import api.Image as Image
-
-from api.Mouse import *
-
+from api.Mouse import CMouse
import api.Math as CMath
-
-import Area1Game1
-from Area1Game1 import *
-
-import BoyHall
-from BoyHall import *
-
-import pygame
+from BoyHall import CBoyHall
+from Area1Game1 import CArea1Game1
class CHallState(CGameState):
diff --git a/src/game/MenuState.py b/src/game/MenuState.py
index c591f8b..05ca044 100644
--- a/src/game/MenuState.py
+++ b/src/game/MenuState.py
@@ -1,42 +1,21 @@
# -*- coding: utf-8 -*-
import pygame
-
-import api.GameState
from api.GameState import CGameState
-import api.MultiLabel
-from api.MultiLabel import CMultiLabel
-import api.Game
from api.Game import CGame
-import api.Button
from api.Button import CButton
-import game.CreditsState
-from CreditsState import *
-
-import game.SelectAreaState
-from SelectAreaState import *
-
+from CreditsState import CCreditsState
+from SelectAreaState import CSelectAreaState
import api.Image as Image
-
from game.PresentationState import CPresentationState
from game.SelectPartidaState import CSelectPartidaState
-
-import game.Area1Game1
from game.Area1Game1 import CArea1Game1
-
-import game.Area1Game3
from game.Area1Game3 import CArea1Game3
-
-import game.Area1Game4
from game.Area1Game4 import CArea1Game4
-
-import game.Area1Game6
from game.Area1Game6 import CArea1Game6
-
-import game.Area2Game2
from game.Area2Game2 import CArea2Game2
-from gettext import gettext as _
+#from gettext import gettext as _
class CMenuState(CGameState):
@@ -53,16 +32,9 @@ class CMenuState(CGameState):
mButtonHelp = None
mButtonExit = None
- #def __init__(self):
- # '''
- # Constructor
- # '''
def init(self):
CGameState.__init__(self)
- #self.mInstructions = CMultiLabel()
- #CGame().addChild(self.mInstructions)
- #print self.mX
self.mButtonPresentation = CButton()
self.mButtonPresentation.bgColor = (0x99, 0x99, 0x66)
@@ -166,8 +138,8 @@ class CMenuState(CGameState):
if self.mButtonCredits.clicked():
print "clicked credits"
#cs = CHelpState()
- credits = CCreditsState()
- CGame().setState(credits)
+ cs = CCreditsState()
+ CGame().setState(cs)
return
elif self.mButtonPlay.clicked():
@@ -191,8 +163,8 @@ class CMenuState(CGameState):
elif self.mButtonHelp.clicked():
print "clicked help"
#cs = CHelpState()
- help = CCreditsState()
- CGame().setState(help)
+ hp = CCreditsState()
+ CGame().setState(hp)
return
elif self.mButtonExit.clicked():
@@ -234,11 +206,7 @@ class CMenuState(CGameState):
a2g2 = CArea2Game2()
CGame().setState(a2g2)
return
-
- #def render(self):
- # CGameState.render(self)
- # print "CMenuState render"
-
+
def destroy(self):
CGameState.destroy(self)
#self.mInstructions.destroy()
@@ -266,6 +234,3 @@ class CMenuState(CGameState):
self.mButtonA2G2 = None
self.mBackground = None
print "CMenuState destroy"
-
- def doEvents(self, aEvent):
- print aEvent.type \ No newline at end of file
diff --git a/src/game/PresentationState.py b/src/game/PresentationState.py
index e7eeadd..9d4b3af 100644
--- a/src/game/PresentationState.py
+++ b/src/game/PresentationState.py
@@ -1,25 +1,11 @@
# -*- coding: utf-8 -*-
-import pygame
-
-import api.GameState
from api.GameState import CGameState
-import api.MultiLabel
-from api.MultiLabel import CMultiLabel
-import api.Game
from api.Game import CGame
-import api.Button
-from api.Button import CButton
-import game.CreditsState
-from CreditsState import *
+from game.CreditsState import CCreditsState
from api.Sprite2 import CSprite
-
-#import game.SelectAreaState
-#from SelectAreaState import *
-
import api.Image as Image
-from gettext import gettext as _
class CPresentationState(CGameState):
@@ -60,8 +46,8 @@ class CPresentationState(CGameState):
if self.mCount > 150:
print "clicked credits"
#cs = CHelpState()
- credits = CCreditsState()
- CGame().setState(credits)
+ cs = CCreditsState()
+ CGame().setState(cs)
return
def destroy(self):
diff --git a/src/game/SelectAreaState.py b/src/game/SelectAreaState.py
index faaece1..fd8eb5e 100644
--- a/src/game/SelectAreaState.py
+++ b/src/game/SelectAreaState.py
@@ -1,26 +1,15 @@
# -*- coding: utf-8 -*-
import MenuState
-from MenuState import *
-import api.GameState
from api.GameState import CGameState
-import api.MultiLabel
from api.MultiLabel import CMultiLabel
-import api.Game
from api.Game import CGame
-import api.Button
from api.Button import CButton
-import api.Image as CImage
from api.Sprite2 import CSprite
-
import api.Image as Image
-
-from api.Mouse import *
-
+from api.Mouse import CMouse
import api.Math as CMath
-
-import HallState
-from HallState import *
+from HallState import CHallState
from assets.data import selectArea_data
@@ -59,7 +48,7 @@ class CSelectAreaState(CGameState):
self.mButtonBack.set_text("Volver")
CGame().addChild(self.mButtonBack)
- self.mBackground = CImage.loadImage('assets/images/selectArea/background.png', False)
+ self.mBackground = Image.loadImage('assets/images/selectArea/background.png', False)
CGame().setBackground(self.mBackground)
self.mAreas_list = []
diff --git a/src/game/SelectCharacterState.py b/src/game/SelectCharacterState.py
index eec97c5..2696a9e 100644
--- a/src/game/SelectCharacterState.py
+++ b/src/game/SelectCharacterState.py
@@ -2,13 +2,9 @@
import pygame
import MenuState
-import api.GameState
from api.GameState import CGameState
-from api.MultiLabel import CMultiLabel
from api.Label import CLabel
-import api.Game
from api.Game import CGame
-from api.Button import CButton
from api.Sprite2 import CSprite
import api.Image as Image
diff --git a/src/game/SelectPartidaState.py b/src/game/SelectPartidaState.py
index 8164b7e..15f7e1a 100644
--- a/src/game/SelectPartidaState.py
+++ b/src/game/SelectPartidaState.py
@@ -1,14 +1,9 @@
# -*- coding: utf-8 -*-
import pygame
-import MenuState
-import api.GameState
from api.GameState import CGameState
-from api.MultiLabel import CMultiLabel
from api.Label import CLabel
-import api.Game
from api.Game import CGame
-from api.Button import CButton
from api.Sprite2 import CSprite
from SelectCharacterState import CSelectCharacterState