diff --git a/plugins/minigames/hot_bomb.py b/plugins/minigames/hot_bomb.py index ece91f9..ba68c09 100644 --- a/plugins/minigames/hot_bomb.py +++ b/plugins/minigames/hot_bomb.py @@ -28,35 +28,38 @@ import _babase if TYPE_CHECKING: from typing import Any, Sequence, Dict, Type, List, Optional, Union + class BallDiedMessage: """Inform something that a ball has died.""" def __init__(self, ball: Ball): self.ball = ball + class ExplodeHitMessage: """Tell an object it was hit by an explosion.""" + class Ball(bs.Actor): """A lovely bomb mortal""" - def __init__(self, position: Sequence[float] = (0.0, 1.0, 0.0),timer: int = 5,d_time=0.2,color=(1,1,1)): + def __init__(self, position: Sequence[float] = (0.0, 1.0, 0.0), timer: int = 5, d_time=0.2, color=(1, 1, 1)): super().__init__() shared = SharedObjects.get() activity = self.getactivity() - + self.explosion_material = bs.Material() self.explosion_material.add_actions( conditions=( 'they_have_material', shared.object_material - ), + ), actions=( ('modify_part_collision', 'collide', True), ('modify_part_collision', 'physical', False), ('message', 'our_node', 'at_connect', ExplodeHitMessage()), ), ) - + bs.getsound('scamper01').play(volume=0.4) # Spawn just above the provided point. self._spawn_pos = (position[0], position[1] + 1.0, position[2]) @@ -72,36 +75,36 @@ class Ball(bs.Actor): 'color_texture': activity.ball_tex, 'body': activity.ball_body, 'body_scale': 1.0 if activity.ball_body == 'sphere' else 0.8, - 'density':1.0 if activity.ball_body == 'sphere' else 1.2, + 'density': 1.0 if activity.ball_body == 'sphere' else 1.2, 'reflection': 'soft', 'reflection_scale': [0.2], 'shadow_size': 0.5, 'is_area_of_interest': True, 'position': self._spawn_pos, 'materials': pmats - } - ) - self._animate = None + } + ) + self._animate = None self.scale = 1.0 if activity.ball_body == 'sphere' else 0.8 - - self.color_l = (1,1,1) + + self.color_l = (1, 1, 1) self.light = bs.newnode('light', - owner=self.node, + owner=self.node, attrs={ - 'color':color, + 'color': color, 'volume_intensity_scale': 0.4, - 'intensity':0.5, - 'radius':0.10 - } + 'intensity': 0.5, + 'radius': 0.10 + } ) - self.node.connectattr('position', self.light,'position') + self.node.connectattr('position', self.light, 'position') self.animate_light = None - - self._particles = bs.Timer(0.1,call=bs.WeakCall(self.particles),repeat=True) - self._sound_effect = bs.Timer(4,call=bs.WeakCall(self.sound_effect),repeat=True) + + self._particles = bs.Timer(0.1, call=bs.WeakCall(self.particles), repeat=True) + self._sound_effect = bs.Timer(4, call=bs.WeakCall(self.sound_effect), repeat=True) self.d_time = d_time - + if timer is not None: timer = int(timer) self._timer = timer @@ -111,102 +114,103 @@ class Ball(bs.Actor): self._tick_timer = bs.Timer(1.0, call=bs.WeakCall(self._tick), repeat=True) - m = bs.newnode('math', owner=self.node, attrs={'input1': (0, 0.6, 0), 'operation': 'add'}) + m = bs.newnode('math', owner=self.node, attrs={ + 'input1': (0, 0.6, 0), 'operation': 'add'}) self.node.connectattr('position', m, 'input2') self._counter = bs.newnode( - 'text', - owner=self.node, - attrs={ - 'text':str(timer), - 'in_world':True, - 'shadow':1.0, - 'flatness':0.7, - 'color':(1,1,1), - 'scale':0.013, - 'h_align':'center' - } - ) + 'text', + owner=self.node, + attrs={ + 'text': str(timer), + 'in_world': True, + 'shadow': 1.0, + 'flatness': 0.7, + 'color': (1, 1, 1), + 'scale': 0.013, + 'h_align': 'center' + } + ) m.connectattr('output', self._counter, 'position') else: self._counter = None - + def particles(self): if self.node: bs.emitfx( position=self.node.position, - velocity=(0,3,0), + velocity=(0, 3, 0), count=9, scale=2.5, spread=0.2, chunk_type='sweat' - ) - + ) + def sound_effect(self): if self.node: bs.getsound('scamper01').play(volume=0.4) - - - def explode(self,color=(3,1,0)) -> None: - sound = random.choice(['explosion01','explosion02','explosion03','explosion04','explosion05']) + + def explode(self, color=(3, 1, 0)) -> None: + sound = random.choice(['explosion01', 'explosion02', + 'explosion03', 'explosion04', 'explosion05']) bs.getsound(sound).play(volume=1) bs.emitfx(position=self.node.position, - velocity=(0,10,0), - count=100, - scale=1.0, - spread=1.0, - chunk_type='spark') + velocity=(0, 10, 0), + count=100, + scale=1.0, + spread=1.0, + chunk_type='spark') explosion = bs.newnode( - 'explosion', - attrs={ - 'position': self.node.position, - 'velocity': (0,0,0), - 'radius': 2.0, - 'big': False, - 'color':color - } - ) - bs.timer(1.0,explosion.delete) - if color == (5,1,0): - color = (1,0,0) + 'explosion', + attrs={ + 'position': self.node.position, + 'velocity': (0, 0, 0), + 'radius': 2.0, + 'big': False, + 'color': color + } + ) + bs.timer(1.0, explosion.delete) + if color == (5, 1, 0): + color = (1, 0, 0) self.activity._handle_score(1) else: - color=(0,0,1) + color = (0, 0, 1) self.activity._handle_score(0) scorch = bs.newnode( - 'scorch', - attrs={ - 'position': self.node.position, - 'size': 1.0, - 'big': True, - 'color':color, - 'presence':1 - } - ) - + 'scorch', + attrs={ + 'position': self.node.position, + 'size': 1.0, + 'big': True, + 'color': color, + 'presence': 1 + } + ) + # Set our position a bit lower so we throw more things upward. rmats = (self.explosion_material,) self.region = bs.newnode( - 'region', - delegate=self, - attrs={ - 'position': (self.node.position[0], self.node.position[1] - 0.1, self.node.position[2]), - 'scale': (2.0, 2.0, 2.0), - 'type': 'sphere', - 'materials': rmats - }, - ) + 'region', + delegate=self, + attrs={ + 'position': (self.node.position[0], self.node.position[1] - 0.1, self.node.position[2]), + 'scale': (2.0, 2.0, 2.0), + 'type': 'sphere', + 'materials': rmats + }, + ) bs.timer(0.05, self.region.delete) - + def _tick(self) -> None: c = self.color_l - c2 = (2.5,1.5,0) + c2 = (2.5, 1.5, 0) if c[2] != 0: - c2 = (0,2,3) + c2 = (0, 2, 3) if self.node: - if self._count == 1: + if self._count == 1: pos = self.node.position - color = (5,1,0) if pos[0] < 0 else (0,1,5) + color = (5, 1, 0) if pos[0] < 0 else (0, 1, 5) self.explode(color=color) return if self._count > 0: @@ -216,53 +220,54 @@ class Ball(bs.Actor): bs.getsound('tick').play() if self._count == 1: self._animate = bs.animate( - self.node, - 'mesh_scale', - { - 0:self.node.mesh_scale, - 0.1:1.5, - 0.2:self.scale - }, - loop=True - ) + self.node, + 'mesh_scale', + { + 0: self.node.mesh_scale, + 0.1: 1.5, + 0.2: self.scale + }, + loop=True + ) self.animate_light = bs.animate_array( - self.light, - 'color', - 3, - { - 0:c, - 0.1:c2, - 0.2:c - }, - loop=True - ) + self.light, + 'color', + 3, + { + 0: c, + 0.1: c2, + 0.2: c + }, + loop=True + ) else: self._animate = bs.animate( - self.node, - 'mesh_scale', - { - 0:self.node.mesh_scale, - 0.5:1.5, - 1.0:self.scale - }, - loop=True - ) + self.node, + 'mesh_scale', + { + 0: self.node.mesh_scale, + 0.5: 1.5, + 1.0: self.scale + }, + loop=True + ) self.animate_light = bs.animate_array( - self.light, - 'color', - 3, - { - 0:c, - 0.2:c2, - 0.5:c, - 1.0:c - }, - loop=True - ) + self.light, + 'color', + 3, + { + 0: c, + 0.2: c2, + 0.5: c, + 1.0: c + }, + loop=True + ) def handlemessage(self, msg: Any) -> Any: if isinstance(msg, bs.DieMessage): - if not self.node: return + if not self.node: + return self.node.delete() activity = self._activity() if activity and not msg.immediate: @@ -275,11 +280,13 @@ class Ball(bs.Actor): elif isinstance(msg, bs.PickedUpMessage): d = self.d_time + def damage(): if (msg is not None and msg.node.exists() and msg.node.getdelegate(PlayerSpaz).hitpoints > 0): spaz = msg.node.getdelegate(PlayerSpaz) - spaz.node.color = (spaz.node.color[0]-0.1,spaz.node.color[1]-0.1,spaz.node.color[2]-0.1) + spaz.node.color = (spaz.node.color[0]-0.1, + spaz.node.color[1]-0.1, spaz.node.color[2]-0.1) if spaz.node.hold_node != self.node: self.handlemessage(bs.DroppedMessage(spaz.node)) if spaz.hitpoints > 10000: @@ -323,51 +330,54 @@ class Ball(bs.Actor): if activity: if s_player in activity.players: self.last_players_to_touch[s_player.team.id] = s_player - + elif isinstance(msg, ExplodeHitMessage): node = bs.getcollision().opposingnode - if not self.node: return + if not self.node: + return nodepos = self.region.position mag = 2000.0 - + node.handlemessage( bs.HitMessage( - pos=nodepos, - velocity=(0, 0, 0), - magnitude=mag, - hit_type='explosion', - hit_subtype='normal', - radius=2.0 - ) - ) + pos=nodepos, + velocity=(0, 0, 0), + magnitude=mag, + hit_type='explosion', + hit_subtype='normal', + radius=2.0 + ) + ) self.handlemessage(bs.DieMessage()) else: super().handlemessage(msg) -###HUMAN### +### HUMAN### + + class NewPlayerSpaz(PlayerSpaz): - + move_mult = 1.0 reload = True extra_jump = True - ###calls - + # calls + def impulse(self): self.reload = False p = self.node self.node.handlemessage( - "impulse", - p.position[0], p.position[1]+40, p.position[2], - 0, 0, 0, - 160, 0, 0, 0, - 0, 205, 0) - bs.timer(0.4,self.refresh) - + "impulse", + p.position[0], p.position[1]+40, p.position[2], + 0, 0, 0, + 160, 0, 0, 0, + 0, 205, 0) + bs.timer(0.4, self.refresh) + def refresh(self): self.reload = True - + def drop_bomb(self) -> Optional[Bomb]: - + if (self.land_mine_count <= 0 and self.bomb_count <= 0) or self.frozen: return None assert self.node @@ -381,15 +391,15 @@ class NewPlayerSpaz(PlayerSpaz): else: dropping_bomb = True bomb_type = self.bomb_type - + if bomb_type == 'banana': bs.getsound('penguinHit1').play(volume=0.3) bomb = NewBomb(position=(pos[0], pos[1] + 0.7, pos[2]), - velocity=(vel[0], vel[1], vel[2]), - bomb_type = bomb_type, - radius = 1.0, - source_player=self.source_player, - owner=self.node) + velocity=(vel[0], vel[1], vel[2]), + bomb_type=bomb_type, + radius=1.0, + source_player=self.source_player, + owner=self.node) else: bomb = Bomb(position=(pos[0], pos[1] - 0.0, pos[2]), velocity=(vel[0], vel[1], vel[2]), @@ -397,7 +407,6 @@ class NewPlayerSpaz(PlayerSpaz): blast_radius=self.blast_radius, source_player=self.source_player, owner=self.node).autoretain() - assert bomb.node if dropping_bomb: @@ -405,24 +414,24 @@ class NewPlayerSpaz(PlayerSpaz): bomb.node.add_death_action( bs.WeakCall(self.handlemessage, BombDiedMessage())) self._pick_up(bomb.node) - + try: for clb in self._dropped_bomb_callbacks: clb(self, bomb) except Exception: return - + return bomb - + def on_jump_press(self) -> None: if not self.node: return self.node.jump_pressed = True self._turbo_filter_add_press('jump') - + if self.reload and self.extra_jump: self.impulse() - + def handlemessage(self, msg: Any) -> Any: if isinstance(msg, PickupMessage): if not self.node: @@ -434,13 +443,13 @@ class NewPlayerSpaz(PlayerSpaz): except bs.NotFoundError: return True if opposingnode.getnodetype() == 'spaz': - player = opposingnode.getdelegate(PlayerSpaz,True).getplayer(Player, True) + player = opposingnode.getdelegate(PlayerSpaz, True).getplayer(Player, True) if player.actor.shield: return None super().handlemessage(msg) return super().handlemessage(msg) - - + + class Player(bs.Player['Team']): """Our player type for this game.""" @@ -463,17 +472,17 @@ if lang == 'Spanish': bomb_timer = 'Temporizador' space_wall = 'Espacio Debajo de la Red' num_bones = 'Huesos Distractores' - b_count = ['Nada','Pocos','Muchos'] + b_count = ['Nada', 'Pocos', 'Muchos'] shield = 'Inmortalidad' bomb = 'Habilitar Bananas' boxing_gloves = 'Equipar Guantes de Boxeo' difficulty = 'Dificultad' - difficulty_o = ['Fácil','Difícil','Chernobyl'] + difficulty_o = ['Fácil', 'Difícil', 'Chernobyl'] wall_color = 'Color de la Red' - w_c = ['Verde','Rojo','Naranja','Amarillo','Celeste','Azul','Rosa','Gris'] + w_c = ['Verde', 'Rojo', 'Naranja', 'Amarillo', 'Celeste', 'Azul', 'Rosa', 'Gris'] ball_body = 'Tipo de Hot Bomb' - body = ['Esfera','Cubo'] - + body = ['Esfera', 'Cubo'] + else: name = 'Hot Bomb' description = 'Get the bomb to explode on\nthe enemy team to win.' @@ -484,16 +493,16 @@ else: bomb_timer = 'Timer' space_wall = 'Space Under the Mesh' num_bones = 'Distractor Bones' - b_count = ['None','Few','Many'] + b_count = ['None', 'Few', 'Many'] shield = 'Immortality' bomb = 'Enable Bananas' difficulty = 'Difficulty' - difficulty_o = ['Easy','Hard','Chernobyl'] + difficulty_o = ['Easy', 'Hard', 'Chernobyl'] wall_color = 'Mesh Color' - w_c = ['Green','Red','Orange','Yellow','Light blue','Blue','Ping','Gray'] + w_c = ['Green', 'Red', 'Orange', 'Yellow', 'Light blue', 'Blue', 'Ping', 'Gray'] ball_body = 'Type of Hot Bomb' - body = ['Sphere','Box'] - + body = ['Sphere', 'Box'] + # ba_meta export bascenev1.GameActivity class HotBombGame(bs.TeamGameActivity[Player, Team]): @@ -530,7 +539,7 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): ('Longer', 3.0), ], default=0.5, - + ), bs.FloatChoiceSetting( difficulty, @@ -540,14 +549,14 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): (difficulty_o[2], 0.01), ], default=0.15, - + ), bs.IntChoiceSetting( bomb_timer, - choices=[(str(choice)+'s',choice) for choice in range(2,11)], + choices=[(str(choice)+'s', choice) for choice in range(2, 11)], default=5, - ), + ), bs.IntChoiceSetting( num_bones, choices=[ @@ -556,7 +565,7 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): (b_count[2], 5), ], default=2, - + ), bs.IntChoiceSetting( ball_body, @@ -565,7 +574,7 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): ), bs.IntChoiceSetting( wall_color, - choices=[(color,w_c.index(color)) for color in w_c], + choices=[(color, w_c.index(color)) for color in w_c], default=0, ), @@ -573,7 +582,7 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): bs.BoolSetting(space_wall, default=True), bs.BoolSetting(bomb, default=True), bs.BoolSetting(shield, default=False), - + ] default_music = bs.MusicType.HOCKEY @@ -588,7 +597,7 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): def __init__(self, settings: dict): super().__init__(settings) self._bomb_timer = int(settings[bomb_timer]) - self._space_under_wall = bool(settings[space_wall]) + self._space_under_wall = bool(settings[space_wall]) self._num_bones = int(settings[num_bones]) self._shield = bool(settings[shield]) self._bomb = bool(settings[bomb]) @@ -596,10 +605,10 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): self._epic_mode = bool(settings['Epic Mode']) self._wall_color = int(settings[wall_color]) self._ball_body = int(settings[ball_body]) - - self.bodys = ['sphere','crate'] - self.meshs = ['bombSticky','powerupSimple'] - + + self.bodys = ['sphere', 'crate'] + self.meshs = ['bombSticky', 'powerupSimple'] + shared = SharedObjects.get() self._scoreboard = Scoreboard() self._cheer_sound = bs.getsound('cheer') @@ -611,13 +620,13 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): self.ball_body = self.bodys[self._ball_body] self.ball_tex = bs.gettexture('powerupCurse') self._ball_sound = bs.getsound('splatter') - + self.last_point = None - self.colors = [(0.25,0.5,0.25), (1, 0.15, 0.15), (1, 0.5, 0), (1, 1, 0), - (0.2, 1, 1), (0.1, 0.1, 1), (1, 0.3, 0.5),(0.5, 0.5, 0.5)] + self.colors = [(0.25, 0.5, 0.25), (1, 0.15, 0.15), (1, 0.5, 0), (1, 1, 0), + (0.2, 1, 1), (0.1, 0.1, 1), (1, 0.3, 0.5), (0.5, 0.5, 0.5)] # self.slow_motion = self._epic_mode - + self.ball_material = bs.Material() self.ball_material.add_actions(actions=(('modify_part_collision', 'friction', 0.5))) @@ -635,10 +644,10 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): ) self.ball_material.add_actions( conditions=( - 'they_have_material',shared.footing_material + 'they_have_material', shared.footing_material ), actions=( - 'impact_sound',self._ball_sound, 0.2, 4 + 'impact_sound', self._ball_sound, 0.2, 4 ) ) @@ -648,27 +657,27 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): 'they_have_material', shared.player_material ), actions=( - ('call', 'at_connect',self._handle_ball_player_collide), + ('call', 'at_connect', self._handle_ball_player_collide), ) ) # We want the ball to kill powerups; not get stopped by them self.ball_material.add_actions( conditions=( - 'they_have_material',PowerupBoxFactory.get().powerup_material), + 'they_have_material', PowerupBoxFactory.get().powerup_material), actions=( ('modify_part_collision', 'physical', False), ('message', 'their_node', 'at_connect', bs.DieMessage()) ) ) - + self._score_region_material = bs.Material() self._score_region_material.add_actions( conditions=( 'they_have_material', self.ball_material ), actions=( - ('modify_part_collision', 'collide',True), + ('modify_part_collision', 'collide', True), ('modify_part_collision', 'physical', False), ('call', 'at_connect', self._handle_score) ) @@ -680,35 +689,35 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): 'they_have_material', self.ball_material ), actions=( - ('modify_part_collision', 'collide',True), + ('modify_part_collision', 'collide', True), ('modify_part_collision', 'physical', False), ('call', 'at_connect', self._reset_count) ) ) - + self._reaction_material = bs.Material() self._reaction_material.add_actions( conditions=( 'they_have_material', shared.player_material ), actions=( - ('modify_part_collision', 'collide',True), + ('modify_part_collision', 'collide', True), ('modify_part_collision', 'physical', False), ('call', 'at_connect', self._reaction) ) ) - + self._reaction_material.add_actions( conditions=( 'they_have_material', HealthFactory.get().health_material ), actions=( - ('modify_part_collision', 'collide',True), + ('modify_part_collision', 'collide', True), ('modify_part_collision', 'physical', True) ) ) - - self._collide=bs.Material() + + self._collide = bs.Material() self._collide.add_actions( conditions=( ('they_are_different_node_than_us', ), @@ -719,24 +728,24 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): ('modify_part_collision', 'collide', True) ) ) - - self._wall_material=bs.Material() + + self._wall_material = bs.Material() self._wall_material.add_actions( conditions=( 'we_are_older_than', 1 - ), + ), actions=( ('modify_part_collision', 'collide', True) ) ) - + self.ice_material = bs.Material() self.ice_material.add_actions( actions=( - 'modify_part_collision','friction',0.05 + 'modify_part_collision', 'friction', 0.05 ) ) - + self._ball_spawn_pos: Optional[Sequence[float]] = None self._ball: Optional[Ball] = None self._score_to_win = int(settings['Score to Win']) @@ -755,26 +764,26 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): def on_begin(self) -> None: super().on_begin() self.setup_standard_time_limit(self._time_limit) - self._ball_spawn_pos = (random.choice([-5,5]),4,0) - bs.timer(5,self._spawn_ball) - bs.timer(0.1,self.update_ball,repeat=True) + self._ball_spawn_pos = (random.choice([-5, 5]), 4, 0) + bs.timer(5, self._spawn_ball) + bs.timer(0.1, self.update_ball, repeat=True) self.add_game_complements() self.add_map_complements() self._update_scoreboard() self._chant_sound.play() - + def _reaction(self): node: bs.Node = bs.getcollision().opposingnode bs.getsound('hiss').play(volume=0.75) - + node.handlemessage( "impulse", - node.position[0],node.position[1],node.position[2], - -node.velocity[0]*2,-node.velocity[1],-node.velocity[2], - 100,100,0,0, - -node.velocity[0],-node.velocity[1],-node.velocity[2] + node.position[0], node.position[1], node.position[2], + -node.velocity[0]*2, -node.velocity[1], -node.velocity[2], + 100, 100, 0, 0, + -node.velocity[0], -node.velocity[1], -node.velocity[2] ) - + bs.emitfx( position=node.position, count=20, @@ -785,21 +794,21 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): def add_game_complements(self): HealthBox( - position=(-1,3.5,-5+random.random()*10) + position=(-1, 3.5, -5+random.random()*10) ) HealthBox( - position=(1,3.5,-5+random.random()*10) + position=(1, 3.5, -5+random.random()*10) ) ### g = 0 while g < self._num_bones: b = 0 Torso( - position=(-6+random.random()*12,3.5,-5+random.random()*10) + position=(-6+random.random()*12, 3.5, -5+random.random()*10) ) while b < 6: Bone( - position=(-6+random.random()*12,2,-5+random.random()*10), + position=(-6+random.random()*12, 2, -5+random.random()*10), style=b ) b += 1 @@ -809,88 +818,88 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): part_of_wall = bs.newnode( 'locator', attrs={ - 'shape':'box', - 'position':(-7.169,0.5,0.5), - 'color':self.wall_color, - 'opacity':1, - 'drawShadow':False, - 'draw_beauty':True, - 'additive':False, - 'size':[14.7,2,16] + 'shape': 'box', + 'position': (-7.169, 0.5, 0.5), + 'color': self.wall_color, + 'opacity': 1, + 'drawShadow': False, + 'draw_beauty': True, + 'additive': False, + 'size': [14.7, 2, 16] } ) part_of_wall2 = bs.newnode( - 'locator', - attrs={ - 'shape':'box', - 'position':(0,-13.51,0.5) if self._space_under_wall else (0,-35.540,0.5), - 'color':self.wall_color, - 'opacity':1, - 'drawShadow':False, - 'draw_beauty':True, - 'additive':False, - 'size':[0.3,30,13] if self._space_under_wall else [0.3,75,13] - } - ) + 'locator', + attrs={ + 'shape': 'box', + 'position': (0, -13.51, 0.5) if self._space_under_wall else (0, -35.540, 0.5), + 'color': self.wall_color, + 'opacity': 1, + 'drawShadow': False, + 'draw_beauty': True, + 'additive': False, + 'size': [0.3, 30, 13] if self._space_under_wall else [0.3, 75, 13] + } + ) wall = bs.newnode( 'region', attrs={ - 'position': (0,1.11,0.5) if self._space_under_wall else (0,0.75,0.5), - 'scale': (0.3,0.75,13) if self._space_under_wall else (0.3,1.5,13), + 'position': (0, 1.11, 0.5) if self._space_under_wall else (0, 0.75, 0.5), + 'scale': (0.3, 0.75, 13) if self._space_under_wall else (0.3, 1.5, 13), 'type': 'box', - 'materials': (self._wall_material,self._reaction_material) + 'materials': (self._wall_material, self._reaction_material) } ) # RESET REGION - pos = (0,5.3,0) + pos = (0, 5.3, 0) bs.newnode( 'region', attrs={ 'position': pos, - 'scale': (0.001,15,12), + 'scale': (0.001, 15, 12), 'type': 'box', - 'materials': [self._check_region_material,self._reaction_material] + 'materials': [self._check_region_material, self._reaction_material] } ) - + bs.newnode( 'region', attrs={ 'position': pos, - 'scale': (0.3,15,12), + 'scale': (0.3, 15, 12), 'type': 'box', 'materials': [self._collide] } ) - + def add_map_complements(self): - #TEXT + # TEXT text = bs.newnode('text', - attrs={'position':(0,2.5,-6), - 'text':'Hot Bomb by\nSEBASTIAN2059 and zPanxo', - 'in_world':True, - 'shadow':1.0, - 'flatness':0.7, - 'color':(1.91,1.31,0.59), - 'opacity':0.25-0.15, - 'scale':0.013+0.007, - 'h_align':'center'}) + attrs={'position': (0, 2.5, -6), + 'text': 'Hot Bomb by\nSEBASTIAN2059 and zPanxo', + 'in_world': True, + 'shadow': 1.0, + 'flatness': 0.7, + 'color': (1.91, 1.31, 0.59), + 'opacity': 0.25-0.15, + 'scale': 0.013+0.007, + 'h_align': 'center'}) walls_data = { - 'w1':[ - (11,5.5,0), - (4.5,11,13) - ], - 'w2':[ - (-11,5.5,0), - (4.5,11,13) + 'w1': [ + (11, 5.5, 0), + (4.5, 11, 13) ], - 'w3':[ - (0,5.5,-6.1), - (19,11,1) + 'w2': [ + (-11, 5.5, 0), + (4.5, 11, 13) ], - 'w4':[ - (0,5.5,6.5), - (19,11,1) + 'w3': [ + (0, 5.5, -6.1), + (19, 11, 1) + ], + 'w4': [ + (0, 5.5, 6.5), + (19, 11, 1) ], } for i in walls_data: @@ -904,72 +913,72 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): } ) - for i in [-5,-2.5,0,2.5,5]: - pos = (11,6.5,0) + for i in [-5, -2.5, 0, 2.5, 5]: + pos = (11, 6.5, 0) Box( - position=(pos[0]-0.5,pos[1]-5.5,pos[2]+i), + position=(pos[0]-0.5, pos[1]-5.5, pos[2]+i), texture='powerupPunch' ) Box( - position=(pos[0]-0.5,pos[1]-3,pos[2]+i), + position=(pos[0]-0.5, pos[1]-3, pos[2]+i), texture='powerupPunch' ) Box( - position=(pos[0]-0.5,pos[1]-0.5,pos[2]+i), + position=(pos[0]-0.5, pos[1]-0.5, pos[2]+i), texture='powerupPunch' ) - pos = (-11,6.5,0) + pos = (-11, 6.5, 0) Box( - position=(pos[0]+0.5,pos[1]-5.5,pos[2]+i), + position=(pos[0]+0.5, pos[1]-5.5, pos[2]+i), texture='powerupIceBombs' ) Box( - position=(pos[0]+0.5,pos[1]-3,pos[2]+i), + position=(pos[0]+0.5, pos[1]-3, pos[2]+i), texture='powerupIceBombs' ) Box( - position=(pos[0]+0.5,pos[1]-0.5,pos[2]+i), + position=(pos[0]+0.5, pos[1]-0.5, pos[2]+i), texture='powerupIceBombs' ) - + def spawn_player(self, player: Player) -> bs.Actor: position = self.get_position(player) name = player.getname() display_color = _babase.safecolor(player.color, target_intensity=0.75) actor = NewPlayerSpaz( - color=player.color, - highlight=player.highlight, - character=player.character, - player=player - ) + color=player.color, + highlight=player.highlight, + character=player.character, + player=player + ) player.actor = actor - + player.actor.node.name = name player.actor.node.name_color = display_color player.actor.bomb_type_default = 'banana' player.actor.bomb_type = 'banana' - + actor.connect_controls_to_player(enable_punch=True, - enable_bomb=self._bomb, - enable_pickup=True) + enable_bomb=self._bomb, + enable_pickup=True) actor.node.hockey = True actor.hitpoints_max = 100000 actor.hitpoints = 100000 actor.equip_boxing_gloves() if self._shield: actor.equip_shields() - actor.shield.color = (0,0,0) + actor.shield.color = (0, 0, 0) actor.shield.radius = 0.1 actor.shield_hitpoints = actor.shield_hitpoints_max = 100000 - - #Move to the stand position and add a flash of light. + + # Move to the stand position and add a flash of light. actor.handlemessage( StandMessage( position, random.uniform(0, 360))) bs.getsound('spawn').play(volume=0.6) return actor - + def on_team_join(self, team: Team) -> None: self._update_scoreboard() @@ -977,7 +986,7 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): collision = bs.getcollision() try: ball = collision.sourcenode.getdelegate(Ball, True) - player = collision.opposingnode.getdelegate(PlayerSpaz,True).getplayer(Player, True) + player = collision.opposingnode.getdelegate(PlayerSpaz, True).getplayer(Player, True) except bs.NotFoundError: return @@ -985,15 +994,15 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): def _kill_ball(self) -> None: self._ball = None - + def _reset_count(self) -> None: """reset counter of ball.""" assert self._ball is not None - + if self._ball.scored: return - + bs.getsound('laser').play() self._ball._count = self._bomb_timer self._ball._counter.text = str(self._bomb_timer) @@ -1003,39 +1012,41 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): repeat=True ) self._ball._animate = bs.animate( - self._ball.node, - 'mesh_scale', - { - 0:self._ball.node.mesh_scale, - 0.1:self._ball.scale - } - ) + self._ball.node, + 'mesh_scale', + { + 0: self._ball.node.mesh_scale, + 0.1: self._ball.scale + } + ) if self._ball.light.color[0] == 0: - self._ball.light.color = (2,0,0) + self._ball.light.color = (2, 0, 0) else: - self._ball.light.color = (0,0,3) - + self._ball.light.color = (0, 0, 3) + def update_ball(self): - if not self._ball: return - if not self._ball.node: return + if not self._ball: + return + if not self._ball.node: + return gnode = bs.getactivity().globalsnode - + if self._ball.node.position[0] > 0: self._ball.node.color_texture = bs.gettexture('powerupIceBombs') - bs.animate_array(gnode,'vignette_outer',3,{1.0:(0.4, 0.4, 0.9)}) - self._ball.color_l = (0,0,3.5) - self._ball._counter.color = (0,0,5) + bs.animate_array(gnode, 'vignette_outer', 3, {1.0: (0.4, 0.4, 0.9)}) + self._ball.color_l = (0, 0, 3.5) + self._ball._counter.color = (0, 0, 5) else: self._ball.node.color_texture = bs.gettexture('powerupPunch') - bs.animate_array(gnode,'vignette_outer',3,{1.0:(0.6,0.45,0.45)}) - self._ball.color_l = (2.5,0,0) - self._ball._counter.color = (1.2,0,0) + bs.animate_array(gnode, 'vignette_outer', 3, {1.0: (0.6, 0.45, 0.45)}) + self._ball.color_l = (2.5, 0, 0) + self._ball._counter.color = (1.2, 0, 0) - def _handle_score(self,index=0) -> None: + def _handle_score(self, index=0) -> None: """A point has been scored.""" assert self._ball is not None - + for team in self.teams: if team.id == index: scoring_team = team @@ -1062,14 +1073,14 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): # End game if we won. if team.score >= self._score_to_win: self.end_game() - + elif team.id != index: # Tell all players to celebrate. for player in team.players: if player.actor: player.actor.handlemessage(bs.DieMessage()) - + self._foghorn_sound.play() self._cheer_sound.play() @@ -1091,10 +1102,10 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): # Respawn dead players if they're still in the game. if isinstance(msg, bs.PlayerDiedMessage): - + player = msg.getplayer(Player) spaz = player.actor - spaz.node.color = (-1,-1,-1) + spaz.node.color = (-1, -1, -1) spaz.node.color_mask_texture = bs.gettexture('bonesColorMask') spaz.node.color_texture = bs.gettexture('bonesColor') spaz.node.head_mesh = bs.getmesh('bonesHead') @@ -1122,7 +1133,7 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): else: super().handlemessage(msg) - def _flash_ball_spawn(self,pos,color=(1,0,0)) -> None: + def _flash_ball_spawn(self, pos, color=(1, 0, 0)) -> None: light = bs.newnode('light', attrs={ 'position': pos, @@ -1136,37 +1147,37 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): timer = self._bomb_timer self._swipsound.play() self._whistle_sound.play() - pos = (random.choice([5,-5]),2,0) + pos = (random.choice([5, -5]), 2, 0) if self.last_point != None: if self.last_point == 0: - pos = (-5,2,0) + pos = (-5, 2, 0) else: - pos = (5,2,0) - - color = (0,0,1*2) if pos[0] == 5 else (1*1.5,0,0) + pos = (5, 2, 0) + + color = (0, 0, 1*2) if pos[0] == 5 else (1*1.5, 0, 0) texture = 'powerupPunch' if pos[0] == -5 else 'powerupIceBombs' - counter_color = (1,0,0) if pos[0] == -5 else (0,0,5) - #self._flash_ball_spawn(pos,color) - self._ball = Ball(position=pos,timer=timer,d_time=self.damage_time,color=color) + counter_color = (1, 0, 0) if pos[0] == -5 else (0, 0, 5) + # self._flash_ball_spawn(pos,color) + self._ball = Ball(position=pos, timer=timer, d_time=self.damage_time, color=color) self._ball.node.color_texture = bs.gettexture(texture) self._ball._counter.color = counter_color - + def get_position(self, player: Player) -> bs.Actor: - position = (0,1,0) + position = (0, 1, 0) team = player.team.id if team == 0: - position = (random.randint(-7,-3),0.25,random.randint(-5,5)) + position = (random.randint(-7, -3), 0.25, random.randint(-5, 5)) angle = 90 else: - position = (random.randint(3,7),0.25,random.randint(-5,5)) + position = (random.randint(3, 7), 0.25, random.randint(-5, 5)) angle = 270 return position - + def respawn_player(self, player: PlayerType, respawn_time: Optional[float] = None) -> None: from babase._general import WeakCall - + assert player if respawn_time is None: respawn_time = 3.0 @@ -1185,7 +1196,7 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): respawn_time, WeakCall(self.spawn_player_if_exists, player)) player.customdata['respawn_icon'] = RespawnIcon( player, respawn_time) - + def spawn_player_if_exists(self, player: PlayerType) -> None: """ A utility method which calls self.spawn_player() *only* if the @@ -1196,43 +1207,46 @@ class HotBombGame(bs.TeamGameActivity[Player, Team]): if player: self.spawn_player(player) - def spawn_player_spaz(self, player: PlayerType) -> None: - position = (0,1,0) + position = (0, 1, 0) angle = None team = player.team.id if team == 0: - position = (random.randint(-7,-3),0.25,random.randint(-5,5)) + position = (random.randint(-7, -3), 0.25, random.randint(-5, 5)) angle = 90 else: - position = (random.randint(3,7),0.25,random.randint(-5,5)) + position = (random.randint(3, 7), 0.25, random.randint(-5, 5)) angle = 270 - + return super().spawn_player_spaz(player, position, angle) -#####New-Bomb##### +##### New-Bomb##### + + class ExplodeMessage: """Tells an object to explode.""" - + + class ImpactMessage: """Tell an object it touched something.""" + class NewBomb(bs.Actor): - + def __init__(self, position: Sequence[float] = (0, 1, 0), velocity: Sequence[float] = (0, 0, 0), bomb_type: str = '', radius: float = 2.0, source_player: bs.Player = None, owner: bs.Node = None): - + super().__init__() - + shared = SharedObjects.get() # Material for powerups. self.bomb_material = bs.Material() self.explode_material = bs.Material() - + self.bomb_material.add_actions( conditions=( ('we_are_older_than', 200), @@ -1248,48 +1262,48 @@ class NewBomb(bs.Actor): ), ), actions=('message', 'our_node', 'at_connect', ImpactMessage())) - + self.explode_material.add_actions( conditions=('they_have_material', shared.player_material), - actions=(('modify_part_collision', 'collide',True), + actions=(('modify_part_collision', 'collide', True), ('modify_part_collision', 'physical', False), ('call', 'at_connect', self._touch_player))) - + self._source_player = source_player self.owner = owner self.bomb_type = bomb_type self.radius = radius - + owner_color = self.owner.source_player._team.color - + if self.bomb_type == 'banana': self.node: bs.Node = bs.newnode('prop', delegate=self, attrs={ 'position': position, 'velocity': velocity, 'color_texture': bs.gettexture('powerupBomb'), 'mesh': bs.getmesh('penguinTorso'), - 'mesh_scale':0.7, - 'body_scale':0.7, - 'density':3, + 'mesh_scale': 0.7, + 'body_scale': 0.7, + 'density': 3, 'reflection': 'soft', 'reflection_scale': [1.0], 'shadow_size': 0.3, 'body': 'sphere', 'owner': owner, - 'materials': (shared.object_material,self.bomb_material)}) - - bs.animate(self.node,'mesh_scale',{0:0,0.2:1,0.26:0.7}) + 'materials': (shared.object_material, self.bomb_material)}) + + bs.animate(self.node, 'mesh_scale', {0: 0, 0.2: 1, 0.26: 0.7}) self.light = bs.newnode('light', owner=self.node, attrs={ - 'color':owner_color, - 'volume_intensity_scale': 2.0, - 'intensity':1, - 'radius':0.1}) - self.node.connectattr('position', self.light,'position') - + 'color': owner_color, + 'volume_intensity_scale': 2.0, + 'intensity': 1, + 'radius': 0.1}) + self.node.connectattr('position', self.light, 'position') + self.spawn: bs.Timer = bs.Timer( - 10.0,self._check,repeat=True) - + 10.0, self._check, repeat=True) + def _impact(self) -> None: node = bs.getcollision().opposingnode node_delegate = node.getdelegate(object) @@ -1297,12 +1311,11 @@ class NewBomb(bs.Actor): if (node is self.owner): return self.handlemessage(ExplodeMessage()) - - + def _explode(self): if self.node: # Set our position a bit lower so we throw more things upward. - + pos = self.node.position rmats = (self.explode_material,) self.explode_region = bs.newnode( @@ -1318,26 +1331,25 @@ class NewBomb(bs.Actor): if self.bomb_type == 'banana': bs.getsound('stickyImpact').play(volume=0.35) a = bs.emitfx(position=self.node.position, - velocity=(0,1,0), - count=15, - scale=1.0, - spread=0.1, - chunk_type='spark') + velocity=(0, 1, 0), + count=15, + scale=1.0, + spread=0.1, + chunk_type='spark') scorch = bs.newnode('scorch', - attrs={ - 'position': self.node.position, - 'size': 1.0, - 'big': False, - 'color':(1,1,0) - }) - - bs.animate(scorch,'size',{0:1.0,5:0}) - bs.timer(5,scorch.delete) - + attrs={ + 'position': self.node.position, + 'size': 1.0, + 'big': False, + 'color': (1, 1, 0) + }) + + bs.animate(scorch, 'size', {0: 1.0, 5: 0}) + bs.timer(5, scorch.delete) bs.timer(0.05, self.explode_region.delete) bs.timer(0.001, bs.WeakCall(self.handlemessage, bs.DieMessage())) - + def _touch_player(self): node = bs.getcollision().opposingnode collision = bs.getcollision() @@ -1347,7 +1359,7 @@ class NewBomb(bs.Actor): Player, True) except bs.NotFoundError: return - + if self.bomb_type == 'banana': color = player.team.color owner_team = self.owner.source_player._team @@ -1356,8 +1368,9 @@ class NewBomb(bs.Actor): if player.team == owner_team: return player.actor.node.handlemessage('knockout', 500.0) - bs.animate_array(player.actor.node,'color',3,{0:color,0.1:(1.5,1,0),0.5:(1.5,1,0),0.6:color}) - + bs.animate_array(player.actor.node, 'color', 3, { + 0: color, 0.1: (1.5, 1, 0), 0.5: (1.5, 1, 0), 0.6: color}) + def _check(self) -> None: """Prevent the cube from annihilating.""" @@ -1372,8 +1385,10 @@ class NewBomb(bs.Actor): elif isinstance(msg, bs.OutOfBoundsMessage): if self.node: self.node.delete() - -######Object##### + +###### Object##### + + class HealthFactory: """Wraps up media and other resources used by bs.Bombs. @@ -1386,7 +1401,7 @@ class HealthFactory: health_mesh The bs.mesh of a standard health. - + health_tex The bs.Texture for health. @@ -1409,9 +1424,7 @@ class HealthFactory: activity.customdata[cls._STORENAME] = factory assert isinstance(factory, HealthFactory) return factory - - - + def __init__(self) -> None: """Instantiate a BombFactory. @@ -1419,13 +1432,13 @@ class HealthFactory: to get a shared instance. """ shared = SharedObjects.get() - + self.health_mesh = bs.getmesh('egg') - + self.health_tex = bs.gettexture('eggTex1') - + self.health_sound = bs.getsound('activateBeep') - + # Set up our material so new bombs don't collide with objects # that they are initially overlapping. self.health_material = bs.Material() @@ -1451,21 +1464,22 @@ class HealthFactory: ) self.health_material.add_actions(actions=('modify_part_collision', - 'friction', 0.3)) + 'friction', 0.3)) + class HealthBox(bs.Actor): - + def __init__(self, position: Sequence[float] = (0, 1, 0), velocity: Sequence[float] = (0, 0, 0), texture: str = 'powerupHealth'): super().__init__() - + shared = SharedObjects.get() factory = HealthFactory.get() self.healthbox_material = bs.Material() self.healthbox_material.add_actions( conditions=( - 'they_are_different_node_than_us', + 'they_are_different_node_than_us', ), actions=( ('modify_part_collision', 'collide', True) @@ -1476,27 +1490,27 @@ class HealthBox(bs.Actor): 'velocity': velocity, 'color_texture': bs.gettexture(texture), 'mesh': bs.getmesh('powerup'), - 'light_mesh':bs.getmesh('powerupSimple'), - 'mesh_scale':1, + 'light_mesh': bs.getmesh('powerupSimple'), + 'mesh_scale': 1, 'body': 'crate', - 'body_scale':1, - 'density':1, - 'damping':0, - 'gravity_scale':1, + 'body_scale': 1, + 'density': 1, + 'damping': 0, + 'gravity_scale': 1, 'reflection': 'powerup', 'reflection_scale': [0.5], 'shadow_size': 0.0, - 'materials': (shared.object_material,self.healthbox_material,factory.health_material)}) - + 'materials': (shared.object_material, self.healthbox_material, factory.health_material)}) + self.light = bs.newnode('light', owner=self.node, attrs={ - 'color':(1,1,1), - 'volume_intensity_scale': 0.4, - 'intensity':0.7, - 'radius':0.0}) - self.node.connectattr('position', self.light,'position') - + 'color': (1, 1, 1), + 'volume_intensity_scale': 0.4, + 'intensity': 0.7, + 'radius': 0.0}) + self.node.connectattr('position', self.light, 'position') + self.spawn: bs.Timer = bs.Timer( - 10.0,self._check,repeat=True) + 10.0, self._check, repeat=True) def _check(self) -> None: """Prevent the cube from annihilating.""" @@ -1516,7 +1530,7 @@ class HealthBox(bs.Actor): t_color = spaz.team.color spaz.actor.node.color = t_color bs.getsound('healthPowerup').play(volume=0.5) - bs.animate(self.light,'radius',{0:0.0,0.1:0.2,0.7:0}) + bs.animate(self.light, 'radius', {0: 0.0, 0.1: 0.2, 0.7: 0}) except: pass @@ -1524,13 +1538,14 @@ class HealthBox(bs.Actor): spaz = msg.node.getdelegate(PlayerSpaz) self.regen_timer = None + class Torso(bs.Actor): - + def __init__(self, position: Sequence[float] = (0, 1, 0), velocity: Sequence[float] = (0, 0, 0), texture: str = 'bonesColor'): super().__init__() - + shared = SharedObjects.get() self.node: bs.Node = bs.newnode('prop', delegate=self, attrs={ @@ -1538,19 +1553,19 @@ class Torso(bs.Actor): 'velocity': velocity, 'color_texture': bs.gettexture(texture), 'mesh': bs.getmesh('bonesTorso'), - 'mesh_scale':1, + 'mesh_scale': 1, 'body': 'sphere', - 'body_scale':0.5, - 'density':6, - 'damping':0, - 'gravity_scale':1, + 'body_scale': 0.5, + 'density': 6, + 'damping': 0, + 'gravity_scale': 1, 'reflection': 'soft', 'reflection_scale': [0], 'shadow_size': 0.0, 'materials': (shared.object_material,)}) - + self.spawn: bs.Timer = bs.Timer( - 10.0,self._check,repeat=True) + 10.0, self._check, repeat=True) def _check(self) -> None: """Prevent the cube from annihilating.""" @@ -1564,16 +1579,18 @@ class Torso(bs.Actor): if self.node: self.node.delete() + class Bone(bs.Actor): - + def __init__(self, position: Sequence[float] = (0, 1, 0), velocity: Sequence[float] = (0, 0, 0), texture: str = 'bonesColor', style: int = 0): super().__init__() - + shared = SharedObjects.get() - meshs = ['bonesUpperArm','bonesUpperLeg','bonesForeArm','bonesPelvis','bonesToes','bonesHand'] + meshs = ['bonesUpperArm', 'bonesUpperLeg', 'bonesForeArm', + 'bonesPelvis', 'bonesToes', 'bonesHand'] bone = None mesh = 0 for i in meshs: @@ -1586,19 +1603,19 @@ class Bone(bs.Actor): 'velocity': velocity, 'color_texture': bs.gettexture(texture), 'mesh': bs.getmesh(bone), - 'mesh_scale':1.5, + 'mesh_scale': 1.5, 'body': 'crate', - 'body_scale':0.6, - 'density':2, - 'damping':0, - 'gravity_scale':1, + 'body_scale': 0.6, + 'density': 2, + 'damping': 0, + 'gravity_scale': 1, 'reflection': 'soft', 'reflection_scale': [0], 'shadow_size': 0.0, 'materials': (shared.object_material,)}) - + self.spawn: bs.Timer = bs.Timer( - 10.0,self._check,repeat=True) + 10.0, self._check, repeat=True) def _check(self) -> None: """Prevent the cube from annihilating.""" @@ -1611,20 +1628,22 @@ class Bone(bs.Actor): elif isinstance(msg, bs.OutOfBoundsMessage): if self.node: self.node.delete() - -######Object##### + +###### Object##### + + class Box(bs.Actor): - + def __init__(self, position: Sequence[float] = (0, 1, 0), velocity: Sequence[float] = (0, 0, 0), texture: str = 'powerupCurse'): super().__init__() - + shared = SharedObjects.get() - self.dont_collide=bs.Material() + self.dont_collide = bs.Material() self.dont_collide.add_actions( conditions=( - 'they_are_different_node_than_us', + 'they_are_different_node_than_us', ), actions=( ('modify_part_collision', 'collide', False) @@ -1637,13 +1656,13 @@ class Box(bs.Actor): 'color_texture': bs.gettexture(texture), 'mesh': bs.getmesh('powerup'), 'light_mesh': bs.getmesh('powerupSimple'), - 'mesh_scale':4, + 'mesh_scale': 4, 'body': 'box', - 'body_scale':3, - 'density':9999, - 'damping':9999, - 'gravity_scale':0, + 'body_scale': 3, + 'density': 9999, + 'damping': 9999, + 'gravity_scale': 0, 'reflection': 'soft', 'reflection_scale': [0.25], 'shadow_size': 0.0, - 'materials': [self.dont_collide,]}) \ No newline at end of file + 'materials': [self.dont_collide,]})