Skip to content
Permalink
Browse files

added dead invincibility delay

  • Loading branch information...
adangert committed Jun 6, 2019
1 parent c637298 commit 1427502ebd9b7ba0b9ae784d792216642ee29ea1
Showing with 13 additions and 6 deletions.
  1. +2 −2 controller_process.py
  2. +9 −3 joust.py
  3. +2 −1 piparty.py
@@ -4,7 +4,7 @@
def main_track_move(menu, restart, move_serial, move_num, move_opts, force_color, battery, dead_count, game_mode, \
team, team_color_enum, controller_sensitivity, dead_move, music_speed, werewolf_reveal, show_team_colors, red_on_kill, zombie_opt,\
commander_intro, commander_move_opt, commander_powers, commander_overdrive,five_controller_opt, swapper_team_colors,\
invincibility, fight_club_color, num_teams,bomb_color,game_start,false_color, faked, rumble, kill_proc):
invincibility, fight_club_color, num_teams,bomb_color,game_start,false_color, faked, rumble, dead_invince, kill_proc):
print("starting Controller Process")

move = common.get_move(move_serial, move_num)
@@ -30,5 +30,5 @@ def main_track_move(menu, restart, move_serial, move_num, move_opts, force_color
speed_bomb.track_move(move, dead_move, force_color,bomb_color, five_controller_opt, game_start, false_color, faked, rumble, menu, restart)
else:
joust.track_move(move, game_mode.value, team.value, team_color_enum, dead_move, force_color, \
music_speed, werewolf_reveal, show_team_colors, red_on_kill, restart, menu, controller_sensitivity)
music_speed, werewolf_reveal, show_team_colors, red_on_kill, restart, menu, controller_sensitivity, dead_invince)

@@ -51,7 +51,7 @@


def track_move(move, game_mode, team, team_color_enum, dead_move, force_color, \
music_speed, werewolf_reveal, show_team_colors, red_on_kill, restart, menu, controller_sensitivity):
music_speed, werewolf_reveal, show_team_colors, red_on_kill, restart, menu, controller_sensitivity, dead_invince):

SLOW_MAX = controller_sensitivity[0]
SLOW_WARNING = controller_sensitivity[1]
@@ -63,6 +63,8 @@ def track_move(move, game_mode, team, team_color_enum, dead_move, force_color, \
WERE_FAST_MAX = controller_sensitivity[6]
WERE_FAST_WARNING = controller_sensitivity[7]

dead_invince.value = False

start = False
no_rumble = time.time() + 2
move_last_value = None
@@ -153,15 +155,19 @@ def track_move(move, game_mode, team, team_color_enum, dead_move, force_color, \
move.set_leds(*my_team_colors)
#move.set_rumble(0)


if change > threshold:
if change > threshold and not dead_invince.value:
if time.time() > no_rumble:
dead_invince.value = True
if red_on_kill:
move.set_leds(*colors.Colors.Red.value)
else:
move.set_leds(*colors.Colors.Black.value)
move.set_rumble(90)
dead_move.value = 0
move.update_leds()
time.sleep(0.75)
dead_invince.value = False

elif change > warning and not vibrate:
if time.time() > no_rumble:
@@ -300,6 +300,7 @@ def __init__(self):
self.rumble = {}
self.kill_controller_proc = {}
self.controller_sensitivity = Array('d', [0] *10)
self.dead_invince = Value('b', False)

self.i = 0
#load audio now so it converts before the game begins
@@ -401,7 +402,7 @@ def pair_move(self, move, move_num):
self.music_speed, self.werewolf_reveal, self.show_team_colors, self.red_on_kill,zombie_opt,\
self.commander_intro, commander_move_opt, self.commander_powers, self.commander_overdrive,\
five_controller_opt, self.swapper_team_colors, invincibility, fight_club_color, self.num_teams,\
self.bomb_color,self.game_start,false_color, faked, rumble, kill_proc))
self.bomb_color,self.game_start,false_color, faked, rumble, self.dead_invince, kill_proc))

proc.start()
self.move_opts[move_serial] = opts

0 comments on commit 1427502

Please sign in to comment.
You can’t perform that action at this time.