本文整理匯總了Python中kivy.uix.modalview.ModalView.bind方法的典型用法代碼示例。如果您正苦於以下問題:Python ModalView.bind方法的具體用法?Python ModalView.bind怎麽用?Python ModalView.bind使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kivy.uix.modalview.ModalView
的用法示例。
在下文中一共展示了ModalView.bind方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: button_pressed
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def button_pressed(self, button):
player = {1: 'X', -1: 'O'}
colours = {1: (0, 1, 0, 1), -1: (1, 0, 0, 1)}
x, y, z, w = button.coords
already_played = self.board[x, y, z, w] != 0
if not already_played:
self.board[x, y, z, w] = self.current_player
button.text = player[self.current_player]
button.background_color = colours[self.current_player]
winner = None
if check_win(move = button.coords, player = self.current_player, \
moves = self.move_list[self.current_player], \
board = self.board):
winner = '{0} wins!'.format(player[self.current_player])
elif 0 not in self.board:
winner = 'Draw... nobody wins!'
if winner:
popup = ModalView(size_hint=(0.75, 0.5))
victory_label = Label(text=winner, font_size=50)
popup.add_widget(victory_label)
popup.bind(on_dismiss=self.reset)
popup.open()
else:
self.current_player *= -1
示例2: GameOverNote
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def GameOverNote(self,survivaltime):
popup = ModalView(size_hint=(0.75, 0.5))
victory_label = Label(text="Game Over\n" + "%0.2f"%survivaltime + " sec", font_size=50)
popup.add_widget(victory_label)
popup.bind(on_dismiss=game.reset)
popup.bind(on_press=popup.dismiss)
popup.open()
示例3: on_status
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def on_status(self, instance, new_value):
status = new_value
# Sum each row, column and diagonal.
# Could be shorter, but let's be extra
# clear what’s going on
sums = [sum(status[0:3]), # rows
sum(status[3:6]), sum(status[6:9]), sum(status[0::3]), # columns
sum(status[1::3]), sum(status[2::3]), sum(status[::4]), # diagonals
sum(status[2:-2:2])]
# Sums can only be +-3 if one player
# filled the whole line
winner = None
if -3 in sums:
winner = 'Крестик Выиграл!'
elif 3 in sums:
winner = 'Нолик Выиграл!'
elif 0 not in self.status:
winner = 'Ничья....!'
if winner:
popup = ModalView(size_hint=(0.75, 0.5))
victory_label = Label(text=winner, font_size=50)
popup.add_widget(victory_label)
popup.bind(on_dismiss=self.reset)
popup.open()
示例4: on_status
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def on_status(self, instance, new_value):
status = new_value
# Sum each row, col and diag
# Could be shorter, but let's be extra
# clear what's going on
sums = [#rows
sum(status[0:3]),
#columns
sum(status[3:6]),
sum(status[6:9]),
sum(status[0::3]),
#diagonals
sum(status[1::3]),
sum(status[2::3]),
sum(status[::4]),
sum(status[2:-2:2])]
# Sums can only be +-3 if one player
# filled the whole line
winner = ''
if 3 in sums:
winner = '{} win!'.format('O')
elif -3 in sums:
winner = '{} win!'.format('X')
elif 0 not in self.status: #Grid full
winner = 'Draw...Nobody wins!'
if winner:
popup = ModalView(size_hint = (0.75 , 0.5 ))
victory_label = Label(text = winner, font_size = 50)
popup.add_widget(victory_label)
popup.bind(on_dismiss = self.reset)
popup.open()
示例5: button_pressed
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def button_pressed(self, button):
colours = {-1: (1, 0, 0, 1), 1: (0, 1, 0, 1)} # (r, g, b, a)
row, column = button.coords
if button.pressed == 1:
button.text = {-1: Finish.surrounded(row, column), 1: 'X'}[self.status[row][column]]
button.background_color = colours[self.status[row][column]]
print ('{} button clicked!'.format(button.coords))
button.pressed = 0
if Finish.board[row][column] == 1:
self.treasuresfound = self.treasuresfound + 1
if self.treasuresfound == 9:
popup = ModalView(size_hint=(0.75, 0.5))
endlabel = Button(text="You won !", font_size=50)
endlabel.background_color = (0, 1, 0, 1)
popup.add_widget(endlabel)
popup.bind(on_dismiss=self.reset)
popup.open()
else:
self.attempts = self.attempts - 1
if self.attempts == 0:
popup = ModalView(size_hint=(0.75, 0.5))
endlabel = Button(text="Try again", font_size=50)
popup.add_widget(endlabel)
popup.bind(on_dismiss=self.reset)
popup.open()
示例6: on_preferences
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def on_preferences(self, *args):
settings_view = SettingsWithNoMenu()
base_dir = self._settings.base_dir
settings_view.add_json_panel('Dashboard Preferences', self._settings.userPrefs.config, os.path.join(base_dir, 'resource', 'settings', 'dashboard_settings.json'))
popup = ModalView(size_hint=DashboardView._POPUP_SIZE_HINT)
popup.add_widget(settings_view)
popup.bind(on_dismiss=self._popup_dismissed)
popup.open()
self._popup = popup
示例7: ButtonTreeItem
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
class ButtonTreeItem(Button):
def __init__(self, num, outward, **kwargs):
super(ButtonTreeItem, self).__init__(**kwargs)
self.size = (20, window_height/btnHeightRate) # 20 isn't change anything
self.size_hint_y = None
self.num = num
self.context = False
self.outward = outward
def on_touch_down(self, touch):
if self.collide_point(*touch.pos):
self.create_clock()
return super(ButtonTreeItem, self).on_touch_down(touch)
def on_touch_up(self, touch):
if self.collide_point(*touch.pos):
self.delete_clock()
if self.context :
self.context = False
return True
return super(ButtonTreeItem, self).on_touch_up(touch)
def create_clock(self, *args):
Clock.schedule_once(self.openContextMenu, timeOut_forContextMenu)
def delete_clock(self, *args):
Clock.unschedule(self.openContextMenu)
def openContextMenu(self, *args):
self.context = True
self.contextMenu = ModalView(size_hint=(0.5, 0.5))
self.contextMenu.bind(on_dismiss=self.outward.showTree())
contextLayout = BoxLayout(
padding = 10,
spacing = 10,
pos_hint = {'center_x': 0.5, 'center_y': 0.5},
size_hint = (0.7, 0.8),
orientation = 'vertical')
contextLayout.add_widget(Label(text=self.text))
btnDelete = Button(text='delete')
btnDelete.bind(on_press=self.delete)
contextLayout.add_widget(btnDelete)
close = Button(text='close')
close.bind(on_release=self.contextMenu.dismiss)
contextLayout.add_widget(close)
self.contextMenu.add_widget(contextLayout)
self.contextMenu.open()
def delete(self, *args):
tree.curItem().remove(self.num)
self.contextMenu.dismiss()
self.outward.showTree()
示例8: on_preferences
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def on_preferences(self, *args):
"""
Display the dashboard preferences view
"""
settings_view = DashboardPreferences(self._settings, self._dashboard_factory)
def popup_dismissed(*args):
self._notify_preference_listeners()
screens = settings_view.get_selected_screens()
screens = self._filter_dashboard_screens(screens)
self._settings.userPrefs.set_dashboard_screens(screens)
self._update_screens(screens)
popup = ModalView(size_hint=DashboardView._POPUP_SIZE_HINT)
popup.add_widget(settings_view)
popup.bind(on_dismiss=popup_dismissed)
popup.open()
示例9: on_heatmap_options
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def on_heatmap_options(self):
def popup_dismissed(response):
self._update_heatmap_preferences()
settings_view = SettingsWithNoMenu()
base_dir = self._settings.base_dir
settings_view.add_json_panel('Heatmap Settings',
self._settings.userPrefs.config,
os.path.join(base_dir,
'autosportlabs',
'racecapture',
'views',
'dashboard',
'heatmap_settings.json'))
popup = ModalView(size_hint=HeatmapView._POPUP_SIZE_HINT)
popup.add_widget(settings_view)
popup.bind(on_dismiss=popup_dismissed)
popup.open()
示例10: choose
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def choose(self, button):
from HoneyApp import HoneyApp
def get_date_diff_string():
timestamp_diff = (datetime.datetime.fromtimestamp(self.current_images[self.IMAGE_TYPE_LEFT]['timestamp']) -
datetime.datetime.fromtimestamp(self.current_images[self.IMAGE_TYPE_RIGHT]['timestamp']))
return str(abs(timestamp_diff.days)) + ' дней'
if button.type == self.IMAGE_TYPE_LEFT:
image_chosen_timestamp = self.current_images[self.IMAGE_TYPE_LEFT]['timestamp']
image_another_timestamp = self.current_images[self.IMAGE_TYPE_RIGHT]['timestamp']
else:
image_chosen_timestamp = self.current_images[self.IMAGE_TYPE_RIGHT]['timestamp']
image_another_timestamp = self.current_images[self.IMAGE_TYPE_LEFT]['timestamp']
if image_chosen_timestamp < image_another_timestamp:
status = True
else:
status = False
modal = ModalView(size_hint=(None, None), size=(400, 200))
if status:
modal.bind(on_dismiss=self.renew_images)
modal_data = random.choice(HoneyApp.success)
else:
modal_data = random.choice(HoneyApp.error)
layout = GridLayout(cols=1, rows=2, on_touch_down=modal.dismiss)
text = '[size=18][b]{text}[/b][/size]\n' \
'[size=11]Эта фотография была сделана: [b]{image_date_chosen}[/b]\n' \
'Дата второй фотографии: [b]{image_date_another}[/b]\n' \
'Разница - [b]{date_diff}[/b][/size]'.\
format(text=modal_data['text'],
image_date_chosen=datetime.datetime.fromtimestamp(image_chosen_timestamp).strftime('%d.%m.%Y %H:%M'),
image_date_another=datetime.datetime.fromtimestamp(image_another_timestamp).strftime('%d.%m.%Y %H:%M'),
date_diff=get_date_diff_string())
layout.add_widget(Label(text=text, markup=True))
layout.add_widget(Image(source=modal_data['filename']))
modal.add_widget(layout)
modal.open()
示例11: on_status
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def on_status(self, instance,status):
status=self.status
#sum each row, column and diagonal
sums=[sum(status[0:3]),sum(status[3:6]),sum(status[6:9]), #rows
sum(status[0::3]),sum(status[1::3]),sum(status[2::3]), #cols
sum(status[0::4]),sum(status[2:-2:2])] # diagonals
winner=None
if 3 in sums:
print(self.status)
winner='Player 1 (O) wins!\n Would you like to play again?'
elif -3 in sums:
print(self.status)
winner='Player 2 (X) wins!\n Would you like to play again?'
elif 0 not in self.status: #grid full
print(self.status)
winner='Draw! \n Would you like to play again?'
if winner:
# create a button
float=FloatLayout(size_hint=(0.5,0.5))
y_button=Button(text="Y",font_size=20,pos_hint={'x':0.4, 'center_y': 0.5},size_hint=(None,None))
n_button=Button(text="N",font_size=20,pos_hint={'x':0.6, 'center_y': 0.5},size_hint=(None,None))
float.add_widget(y_button)
float.add_widget(n_button)
popup=ModalView(size_hint=(0.5,0.5))
victory_label=Label(text=winner,pos_hint={'x': 0.3, 'center_y':0.7},size_hint=(None,None))
float.add_widget(victory_label)
popup.add_widget(float)
if y_button:
self.reset
popup.bind(on_dismiss=self.reset)
popup.open()
示例12: on_status
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def on_status(self, instance, new_value):
status = new_value
sums = [sum(status[0:3]), sum(status[3:6]), sum(status[6:9]),
sum(status[0::3]), sum(status[1::3]), sum(status[2::3]),
sum(status[::4]), sum(status[2:-2:2])]
winner = None
if 3 in sums:
winner = "Os win!"
elif -3 in sums:
winner = "Xs win!"
elif 0 not in self.status:
winner = "Draw!"
if winner:
popup = ModalView(size_hint=(0.75, 0.5))
victory_label = Label(text=winner, font_size = 50)
popup.add_widget(victory_label)
popup.bind(on_dismiss = self.reset)
popup.open()
示例13: verifierGagnant
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def verifierGagnant(self):
# si tous les pions rouges sont arrivés
if self.plateau_jeu[206] == 1 and self.plateau_jeu[207] == 1 and self.plateau_jeu[221] == 1 and self.plateau_jeu[222] == 1 and self.plateau_jeu[223] == 1 and self.plateau_jeu[236] == 1 and self.plateau_jeu[237] == 1 and self.plateau_jeu[238] == 1 and self.plateau_jeu[239] == 1 and self.plateau_jeu[252] == 1 and self.plateau_jeu[253] == 1 and self.plateau_jeu[254] == 1 and self.plateau_jeu[255] == 1:
popup = ModalView(size_hint=(0.6, 0.2))
victory_label = Label(text='Le joueur rouge a gagné !',font_size=30)
Window.clearcolor = (1, 1, 0, 1)
popup.add_widget(victory_label)
popup.bind(on_dismiss=self.reset) # lorsque le pop-up est fermée, on reset le plateau
popup.open() # on ouvre la pop-up de victoire
# si tous les pions verts sont arrivés
if self.plateau_jeu[192] == 2 and self.plateau_jeu[193] == 2 and self.plateau_jeu[208] == 2 and self.plateau_jeu[209] == 2 and self.plateau_jeu[210] == 2 and self.plateau_jeu[224] == 2 and self.plateau_jeu[225] == 2 and self.plateau_jeu[226] == 2 and self.plateau_jeu[227] == 2 and self.plateau_jeu[240] == 2 and self.plateau_jeu[241] == 2 and self.plateau_jeu[242] == 2 and self.plateau_jeu[243] == 2:
popup = ModalView(size_hint=(0.6, 0.2))
victory_label = Label(text='Le joueur vert a gagné !',font_size=30)
Window.clearcolor = (1, 1, 0, 1)
popup.add_widget(victory_label)
popup.bind(on_dismiss=self.reset) # lorsque le pop-up est fermée, on reset le plateau
popup.open() # on ouvre la pop-up de victoire
# si tous les pions jaunes sont arrivés
if self.plateau_jeu[0] == 3 and self.plateau_jeu[1] == 3 and self.plateau_jeu[2] == 3 and self.plateau_jeu[3] == 3 and self.plateau_jeu[16] == 3 and self.plateau_jeu[17] == 3 and self.plateau_jeu[18] == 3 and self.plateau_jeu[19] == 3 and self.plateau_jeu[32] == 3 and self.plateau_jeu[33] == 3 and self.plateau_jeu[34] == 3 and self.plateau_jeu[48] == 3 and self.plateau_jeu[49] == 3:
popup = ModalView(size_hint=(0.6, 0.2))
victory_label = Label(text='Le joueur jaune a gagné !',font_size=30)
Window.clearcolor = (1, 1, 0, 1)
popup.add_widget(victory_label)
popup.bind(on_dismiss=self.reset) # lorsque le pop-up est fermée, on reset le plateau
popup.open() # on ouvre la pop-up de victoire
# si tous les pions bleus sont arrivés
if self.plateau_jeu[62] == 4 and self.plateau_jeu[63] == 4 and self.plateau_jeu[45] == 4 and self.plateau_jeu[46] == 4 and self.plateau_jeu[47] == 4 and self.plateau_jeu[28] == 4 and self.plateau_jeu[29] == 4 and self.plateau_jeu[30] == 4 and self.plateau_jeu[31] == 4 and self.plateau_jeu[12] == 4 and self.plateau_jeu[13] == 4 and self.plateau_jeu[14] == 4 and self.plateau_jeu[15] == 4:
popup = ModalView(size_hint=(0.6, 0.2))
victory_label = Label(text='Le joueur bleu a gagné !',font_size=30)
Window.clearcolor = (1, 1, 0, 1)
popup.add_widget(victory_label)
popup.bind(on_dismiss=self.reset) # lorsque le pop-up est fermée, on reset le plateau
popup.open()
示例14: my_callback
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def my_callback(self, dt):
self.current += dt
if self.current > 2:
global CURRENT_PLAYER, LIST_OF_TARGETS1, LIST_OF_TARGETS, CURRENT, SOME_LIST, AMOUNT1, finish
grid = self.manager.get_screen('board1').ids.grid
rand = random.randint(0, len(LIST_OF_TARGETS) - 1)
TARGETS = LIST_OF_TARGETS
if len(LIST_OF_TARGETS1):
rand = random.randint(0, len(LIST_OF_TARGETS1) - 1)
TARGETS = LIST_OF_TARGETS1
for child in grid.children:
if child.coords == TARGETS[rand]:
if child.background_color == [1, 1, 1, 1]:
child.text = 'X'
child.background_color = [1, 0, 0, 1]
self.popup1.dismiss()
Clock.unschedule(self.my_callback)
CURRENT_PLAYER *= -1
self.sound.stop()
self.sound = SoundLoader.load('files/Not_ship.wav')
self.sound.play()
Clock.schedule_once(self.callback1, 0.7)
TARGETS.remove(child.coords)
else:
x, y = child.coords
CURRENT += 1
AMOUNT1 += 1
SOME_LIST.append((x, y))
if (x + 1, y + 1) in TARGETS:
TARGETS.remove((x + 1, y + 1))
if (x - 1, y - 1) in TARGETS:
TARGETS.remove((x - 1, y - 1))
if (x + 1, y - 1) in TARGETS:
TARGETS.remove((x + 1, y - 1))
if (x - 1, y + 1) in TARGETS:
TARGETS.remove((x - 1, y + 1))
if (x + 1, y + 1) in LIST_OF_TARGETS:
LIST_OF_TARGETS.remove((x + 1, y + 1))
if (x - 1, y - 1) in LIST_OF_TARGETS:
LIST_OF_TARGETS.remove((x - 1, y - 1))
if (x + 1, y - 1) in LIST_OF_TARGETS:
LIST_OF_TARGETS.remove((x + 1, y - 1))
if (x - 1, y + 1) in LIST_OF_TARGETS:
LIST_OF_TARGETS.remove((x - 1, y + 1))
if (x + 1, y) not in LIST_OF_TARGETS1 and (x + 1, y) in LIST_OF_TARGETS:
LIST_OF_TARGETS1.append((x + 1, y))
LIST_OF_TARGETS.remove((x + 1, y))
if (x - 1, y) not in LIST_OF_TARGETS1 and (x - 1, y) in LIST_OF_TARGETS:
LIST_OF_TARGETS1.append((x - 1, y))
LIST_OF_TARGETS.remove((x - 1, y))
if (x, y - 1) not in LIST_OF_TARGETS1 and (x, y - 1) in LIST_OF_TARGETS:
LIST_OF_TARGETS1.append((x, y - 1))
LIST_OF_TARGETS.remove((x, y - 1))
if (x, y + 1) not in LIST_OF_TARGETS1 and (x, y + 1) in LIST_OF_TARGETS:
LIST_OF_TARGETS1.append((x, y + 1))
LIST_OF_TARGETS.remove((x, y + 1))
child.background_color = [0, 1, 0, 1]
AMOUNT1 = 4 + 3 * 2 + 2 * 3 + 4
if AMOUNT1 == 4 + 3 * 2 + 2 * 3 + 4:
self.popup1.dismiss()
Clock.unschedule(self.my_callback)
finish = SoundLoader.load('files/proval.mp3')
finish.play()
winner = ModalView(size_hint=(0.75, 0.5))
winner.background = 'files/You_Lost.png'
# victory_label = Label(text='You Lost!!!!!', font_size=50)
# winner.add_widget(victory_label)
winner.bind(on_dismiss=self.somefunc)
winner.open()
return
TARGETS.remove((x, y))
if CURRENT == int(child.name):
LIST_OF_TARGETS1[:] = []
if self.sound != '':
self.sound.stop()
self.sound = SoundLoader.load('files/boom.mp3')
self.sound.play()
for ship in SOME_LIST:
x, y = ship
s = [1, 0, -1]
t = [1, 0, -1]
for xx in s:
for yy in t:
for child in grid.children:
if child.coords == (x + xx, y + yy) and (x + xx, y + yy) not in SOME_LIST:
child.text = 'X'
child.background_color = [1, 0, 0, 1]
SOME_LIST = []
CURRENT = 0
else:
if self.sound != '':
self.sound.stop()
self.sound = SoundLoader.load('files/bomb2.wav')
#.........這裏部分代碼省略.........
示例15: button_pressed
# 需要導入模塊: from kivy.uix.modalview import ModalView [as 別名]
# 或者: from kivy.uix.modalview.ModalView import bind [as 別名]
def button_pressed(self, button):
if button.text == 'YES':
self.manager.current = 'main'
self.popup.dismiss()
else:
global CURRENT_PLAYER, AMOUNT, CURRENT1, SOME_LIST1, finish
row, column = button.coords
status_index = row * 10 + column
already_played = self.status[status_index]
if not already_played and CURRENT_PLAYER == 1:
self.status[status_index] = CURRENT_PLAYER
for ship in SHIPS_OF_COMP:
if ship[0] == (row, column):
CURRENT1 += 1
SOME_LIST1.append((row, column))
button.background_color = ship[1]
# button.text = str(ship[2])
if CURRENT1 == ship[2]:
if self.sound != '':
self.sound.stop()
self.sound = SoundLoader.load('files/boom.mp3')
self.sound.play()
for ship in SOME_LIST1:
x, y = ship
s = [1, 0, -1]
t = [1, 0, -1]
for xx in s:
for yy in t:
for child in self.ids.grid.children:
if child.coords == (x + xx, y + yy) and (x + xx, y + yy) not in SOME_LIST1:
child.text = 'X'
child.background_color = [1, 0, 0, 1]
SOME_LIST1 = []
CURRENT1 = 0
else:
if self.sound != '':
self.sound.stop()
self.sound = SoundLoader.load('files/bomb2.wav')
self.sound.play()
AMOUNT += 1
AMOUNT = 4 + 3 * 2 + 2 * 3 + 4
if AMOUNT == 4 + 3 * 2 + 2 * 3 + 4:
finish = SoundLoader.load('files/winner.mp3')
finish.play()
winner = ModalView(size_hint=(0.75, 0.5))
winner.background = 'files/youWin.png'
# victory_label = Label(text='You WIN!!!!!', font_size=50)
# winner.add_widget(victory_label)
winner.bind(on_dismiss=self.somefunc)
winner.open()
break
if button.background_color == [1, 1, 1, 1]:
button.text = 'X'
if self.sound != '':
self.sound.stop()
self.sound = SoundLoader.load('files/Not_ship.wav')
self.sound.play()
button.background_color = [1, 0, 0, 1]
Clock.schedule_once(self.callback, 1)
CURRENT_PLAYER *= -1