Skip to content

Commit

Permalink
0612 우분투에서 안돌아거던 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
yaena1223 committed Jun 11, 2022
1 parent 2ff231d commit 586b36c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion button.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pygame
import os
from pygame.locals import *
from data.Defs import *

Expand Down Expand Up @@ -34,6 +35,6 @@ def isOver(self, pos): # pos[0]: 마우스의 x 좌표 / pos[1]: 마우스의
def draw_image(window, img_path, x, y, width, height):
x = x - (width / 2)
y = y - (height / 2)
image = pygame.image.load(img_path)
image = pygame.image.load(os.path.abspath(img_path))
image = pygame.transform.smoothscale(image, (width, height))
window.blit(image, (x, y))
20 changes: 10 additions & 10 deletions menu/gameselectMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ def __init__(self,screen):
self.map2 = button(self.board_width, self.board_height, 0.5, 0.4, 0.25, 0.35, "Image/catthema/map2.png")
self.map3 = button(self.board_width, self.board_height, 0.8, 0.4, 0.25, 0.35, "Image/catthema/map3.png")

self.level_map1 = button(self.board_width, self.board_height, 0.2, 0.65, 0.2, 0.05, "Image/catthema/LEVEL1.png")
self.level_map2 = button(self.board_width, self.board_height, 0.5, 0.65, 0.2, 0.05, "Image/catthema/LEVEL1.png")
self.level_map3 = button(self.board_width, self.board_height, 0.8, 0.65, 0.2, 0.05, "Image/catthema/LEVEL1.png")
self.level_map1 = button(self.board_width, self.board_height, 0.2, 0.65, 0.2, 0.05, "Image/catthema/level1.png")
self.level_map2 = button(self.board_width, self.board_height, 0.5, 0.65, 0.2, 0.05, "Image/catthema/level1.png")
self.level_map3 = button(self.board_width, self.board_height, 0.8, 0.65, 0.2, 0.05, "Image/catthema/level1.png")

self.mode_map1 = button(self.board_width, self.board_height, 0.2, 0.65, 0.2, 0.05, "Image/catthema/EASY.png")
self.mode_map2 = button(self.board_width, self.board_height, 0.5, 0.65, 0.2, 0.05, "Image/catthema/EASY.png")
self.mode_map3 = button(self.board_width, self.board_height, 0.8, 0.65, 0.2, 0.05, "Image/catthema/EASY.png")

self.rankpage = button(self.board_height,self.board_height,0.766,0.05,0.1,0.05,"Image/catthema/rank.png")
self.mypage = button(self.board_height,self.board_height,0.5,0.05,0.1,0.05,"Image/catthema/mypage.png")
self.gamemode = button(self.board_height,self.board_height,0.366,0.05,0.1,0.05,"Image/catthema/stage.png")
self.store = button(self.board_height,self.board_height,0.233,0.05,0.1,0.05,"Image/catthema/store.png")
self.rankpage = button(self.board_height,self.board_height,0.766,0.05,0.1,0.05,"Image/catthema/RANK.png")
self.mypage = button(self.board_height,self.board_height,0.5,0.05,0.1,0.05,"Image/catthema/MYPAGE.png")
self.gamemode = button(self.board_height,self.board_height,0.366,0.05,0.1,0.05,"Image/catthema/STAGE.png")
self.store = button(self.board_height,self.board_height,0.233,0.05,0.1,0.05,"Image/catthema/STORE.png")
self.logout= button(self.board_height,self.board_height,0.9,0.05,0.1,0.05,"Image/catthema/logout.png")
self.help = button(self.board_height,self.board_height,0.633,0.05,0.1,0.05,"Image/catthema/help.png")

Expand Down Expand Up @@ -154,7 +154,7 @@ def show(self,screen):

if self.gamemode.isOver(pos):
self.gamemode.image="Image/catthema/inf.png"
else : self.gamemode.image="Image/catthema/stage.png"
else : self.gamemode.image="Image/catthema/STAGE.png"
pygame.display.update()

if event.type == pygame.MOUSEBUTTONUP: # 마우스 클릭
Expand Down Expand Up @@ -308,7 +308,7 @@ def show(self,screen):
pygame.display.update()

if self.gamemode.isOver(pos):
self.gamemode.image="Image/catthema/stage.png"
self.gamemode.image="Image/catthema/STAGE.png"
else : self.gamemode.image="Image/catthema/inf.png"
pygame.display.update()

Expand Down Expand Up @@ -371,7 +371,7 @@ def show(self,screen):
pygame.display.update()

if self.gamemode.isOver(pos):
self.gamemode.image="Image/catthema/stage.png"
self.gamemode.image="Image/catthema/STAGE.png"
self.modestate="stage"
pygame.display.update()

Expand Down

0 comments on commit 586b36c

Please sign in to comment.