diff options
Diffstat (limited to 'src/game/SelectAreaState.py')
-rw-r--r-- | src/game/SelectAreaState.py | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/src/game/SelectAreaState.py b/src/game/SelectAreaState.py index e8a95ee..b92efe7 100644 --- a/src/game/SelectAreaState.py +++ b/src/game/SelectAreaState.py @@ -13,32 +13,16 @@ from HallState import CHallState from assets.data import selectArea_data +AREA1_POLYGON = [(70, 233), (344, 208), (505, 246), (505, 400), (212, 536), (70, 440)] +AREA2_POLYGON = [(558, 379), (1113, 665), (342, 834), (124, 579)] +AREA3_POLYGON = [(838, 155), (1034, 143), (1150, 240), (1133, 397), (927, 436), (749, 372), (746, 222)] -class CSelectAreaState(CGameState): - mBackground = None - mInstructions = None - #mX = 10 - mButtonBack = None - - #mCurrentSelectedArea = 0 - - mArea1 = None - mArea2 = None - mArea3 = None - - mFrameImageArea1 = None - mFrameImageArea2 = None - mFrameImageArea3 = None - - AREA1_POLYGON = [(70, 233), (344, 208), (505, 246), (505, 400), (212, 536), (70, 440)] - AREA2_POLYGON = [(558, 379), (1113, 665), (342, 834), (124, 579)] - AREA3_POLYGON = [(838, 155), (1034, 143), (1150, 240), (1133, 397), (927, 436), (749, 372), (746, 222)] +class CSelectAreaState(CGameState): - def init(self): CGameState.init(self) - + self.mBackground = Image.loadImage('assets/images/selectArea/background.jpg', False) CGame().setBackground(self.mBackground) @@ -103,9 +87,8 @@ class CSelectAreaState(CGameState): self.mLabelA3.set_size((280, 80)) self.mLabelA3.set_text(self.mAreas_list[2]) - def update(self): - #print "menu update" + CGameState.update(self) if self.mButtonBack.mouseOver(): @@ -129,7 +112,7 @@ class CSelectAreaState(CGameState): x = CMouse().getX() y = CMouse().getY() - if (CMath.pointInsidePolygon(x,y,self.AREA1_POLYGON)): + if (CMath.pointInsidePolygon(x, y, AREA1_POLYGON)): if not(self.mArea1Is): CGame().addChild(self.mArea1) CGame().addChild(self.mLabelA1) @@ -145,7 +128,7 @@ class CSelectAreaState(CGameState): CGame().removeChild(self.mLabelA1) self.mArea1Is = False - if (CMath.pointInsidePolygon(x,y,self.AREA2_POLYGON)): + if (CMath.pointInsidePolygon(x, y, AREA2_POLYGON)): if not(self.mArea2Is): CGame().addChild(self.mArea2) CGame().addChild(self.mLabelA2) @@ -160,7 +143,7 @@ class CSelectAreaState(CGameState): CGame().removeChild(self.mLabelA2) self.mArea2Is = False - if (CMath.pointInsidePolygon(x,y,self.AREA3_POLYGON)): + if (CMath.pointInsidePolygon(x, y, AREA3_POLYGON)): if not(self.mArea3Is): CGame().addChild(self.mArea3) CGame().addChild(self.mLabelA3) |