Rename & update volley_ball.py for 1.7.37+ (API 9)

• Removed base64 encoded text (trusting the community that they won't change the name & steal credits)
• Properly formatted for readability
This commit is contained in:
! Freaku 2025-02-08 11:16:39 +05:30 committed by GitHub
parent 24d1fad594
commit 98304c6db7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,20 +3,14 @@
# Made by your friend: Freaku # Made by your friend: Freaku
# Join BCS: # Join BCS:
# https://discord.gg/ucyaesh # https://discord.gg/ucyaesh
# My GitHub: # My GitHub:
# https://github.com/Freaku17/BombSquad-Mods-byFreaku # https://github.com/Freaku17/BombSquad-Mods-byFreaku
# CHANGELOG: # CHANGELOG:
""" """
## 2021 ## 2021
@ -38,21 +32,14 @@
""" """
# ba_meta require api 9
# ba_meta require api 8
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
import babase, random import babase
import random
import bascenev1 as bs import bascenev1 as bs
from bascenev1lib.actor.playerspaz import PlayerSpaz from bascenev1lib.actor.playerspaz import PlayerSpaz
from bascenev1lib.actor.scoreboard import Scoreboard from bascenev1lib.actor.scoreboard import Scoreboard
@ -64,7 +51,6 @@ if TYPE_CHECKING:
from typing import Any, Sequence, Dict, Type, List, Optional, Union from typing import Any, Sequence, Dict, Type, List, Optional, Union
class PuckDiedMessage: class PuckDiedMessage:
"""Inform something that a puck has died.""" """Inform something that a puck has died."""
@ -104,10 +90,9 @@ class Puck(bs.Actor):
# Since it rolls on spawn, lets make gravity # Since it rolls on spawn, lets make gravity
# to 0, and when another node (bomb/spaz) # to 0, and when another node (bomb/spaz)
# touches it. It'll act back as our normie puck! # touches it. It'll act back as our normie puck!
bs.animate(self.node, 'gravity_scale', {0:-0.1, 0.2:1}, False) bs.animate(self.node, 'gravity_scale', {0: -0.1, 0.2: 1}, False)
# When other node touches, it realises its new gravity_scale # When other node touches, it realises its new gravity_scale
def handlemessage(self, msg: Any) -> Any: def handlemessage(self, msg: Any) -> Any:
if isinstance(msg, bs.DieMessage): if isinstance(msg, bs.DieMessage):
assert self.node assert self.node
@ -148,6 +133,7 @@ class Player(bs.Player['Team']):
class Team(bs.Team[Player]): class Team(bs.Team[Player]):
"""Our team type for this game.""" """Our team type for this game."""
def __init__(self) -> None: def __init__(self) -> None:
self.score = 0 self.score = 0
@ -254,14 +240,13 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
True), ('modify_part_collision', 'physical', False), True), ('modify_part_collision', 'physical', False),
('call', 'at_connect', self._handle_score))) ('call', 'at_connect', self._handle_score)))
self._wall_material = bs.Material()
self._wall_material=bs.Material() self._fake_wall_material = bs.Material()
self._fake_wall_material=bs.Material()
self._wall_material.add_actions( self._wall_material.add_actions(
actions=( actions=(
('modify_part_collision', 'friction', 100000), ('modify_part_collision', 'friction', 100000),
)) ))
self._wall_material.add_actions( self._wall_material.add_actions(
conditions=('they_have_material', shared.pickup_material), conditions=('they_have_material', shared.pickup_material),
actions=( actions=(
@ -270,13 +255,13 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
self._wall_material.add_actions( self._wall_material.add_actions(
conditions=(('we_are_younger_than', 100), conditions=(('we_are_younger_than', 100),
'and', 'and',
('they_have_material',shared.object_material)), ('they_have_material', shared.object_material)),
actions=( actions=(
('modify_part_collision', 'collide', False), ('modify_part_collision', 'collide', False),
)) ))
self._wall_material.add_actions( self._wall_material.add_actions(
conditions=('they_have_material',shared.footing_material), conditions=('they_have_material', shared.footing_material),
actions=( actions=(
('modify_part_collision', 'friction', 9999.5), ('modify_part_collision', 'friction', 9999.5),
)) ))
@ -294,10 +279,9 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
('modify_part_collision', 'physical', True) ('modify_part_collision', 'physical', True)
)) ))
self.blocks=[] self.blocks = []
self._net_wall_material = bs.Material()
self._net_wall_material=bs.Material()
self._net_wall_material.add_actions( self._net_wall_material.add_actions(
conditions=('they_have_material', shared.player_material), conditions=('they_have_material', shared.player_material),
actions=( actions=(
@ -321,8 +305,7 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
actions=( actions=(
('modify_part_collision', 'collide', True), ('modify_part_collision', 'collide', True),
)) ))
self.net_blocc=[] self.net_blocc = []
self._puck_spawn_pos: Optional[Sequence[float]] = None self._puck_spawn_pos: Optional[Sequence[float]] = None
self._score_regions: Optional[List[bs.NodeActor]] = None self._score_regions: Optional[List[bs.NodeActor]] = None
@ -365,7 +348,7 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
bs.NodeActor( bs.NodeActor(
bs.newnode('region', bs.newnode('region',
attrs={ attrs={
'position':(5.7, 0, -0.065), 'position': (5.7, 0, -0.065),
'scale': (10.7, 0.001, 8), 'scale': (10.7, 0.001, 8),
'type': 'box', 'type': 'box',
'materials': [self._score_region_material] 'materials': [self._score_region_material]
@ -374,19 +357,29 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
bs.NodeActor( bs.NodeActor(
bs.newnode('region', bs.newnode('region',
attrs={ attrs={
'position':(-5.7, 0, -0.065), 'position': (-5.7, 0, -0.065),
'scale': (10.7, 0.001, 8), 'scale': (10.7, 0.001, 8),
'type': 'box', 'type': 'box',
'materials': [self._score_region_material] 'materials': [self._score_region_material]
}))) })))
self._update_scoreboard() self._update_scoreboard()
self._chant_sound.play() self._chant_sound.play()
import base64 if self.credit_text:
exec(base64.b64decode("aWYgc2VsZi5jcmVkaXRfdGV4dDoKICAgICMjIFBlb3BsZSBzdGVhbGVkIGNyZWRpdHMgc28gdGhhdHMgd2h5IEkgZW5jb2RlZCB0aGlzLi4uCiAgICAjIyBFdmVuIHRobyB0aGVyZSBpcyBhIG9wdGlvbiwgdGhleSBjaGFuZ2VkIGNyZWF0ZWQgYnkKICAgICMjIGxpa2Ugd3RmIGlzIHRoaWVyIHByb2JsZW0/PwogICAgCiAgICAjIyBBbnl3YXlzIGhhdmUgYSBnb29kIGRheSEKICAgIHQgPSBicy5uZXdub2RlKCd0ZXh0JywKICAgICAgICAgICAgICAgYXR0cnM9eyAndGV4dCc6IkNyZWF0ZWQgYnkg7oGIRnJlYWt1XG5Wb2xsZXlCYWxsIiwgIyMgRGlzYWJsZSAnRW5hYmxlIEJvdHRvbSBDcmVkaXRzJyB3aGVuIG1ha2luZyBwbGF5bGlzdCwgTm8gbmVlZCB0byBlZGl0IHRoaXMgbG92ZWx5Li4uCiAgICAgICAgJ3NjYWxlJzowLjcsCiAgICAgICAgJ3Bvc2l0aW9uJzooMCwwKSwgI0xldHMgaG9wZSBoZSB1c2VzIFRWIGJvcmRlciBvZiBzZXR0aW5ncz5HcmFwaGljcwogICAgICAgICdzaGFkb3cnOjAuNSwKICAgICAgICAnZmxhdG5lc3MnOjEuMiwKICAgICAgICAnY29sb3InOigxLCAxLCAxKSwKICAgICAgICAnaF9hbGlnbic6J2NlbnRlcicsCiAgICAgICAgJ3ZfYXR0YWNoJzonYm90dG9tJ30p").decode('UTF-8')) t = bs.newnode('text',
attrs={'text': "Created by Freaku\nVolleyBall", # Disable 'Enable Bottom Credits' when making playlist, No need to edit this lovely...
'scale': 0.7,
'position': (0, 0),
'shadow': 0.5,
'flatness': 1.2,
'color': (1, 1, 1),
'h_align': 'center',
'v_attach': 'bottom'})
shared = SharedObjects.get() shared = SharedObjects.get()
self.blocks.append(bs.NodeActor(bs.newnode('region',attrs={'position': (0,2.4,0),'scale': (0.8,6,20),'type': 'box','materials': (self._fake_wall_material, )}))) self.blocks.append(bs.NodeActor(bs.newnode('region', attrs={'position': (0, 2.4, 0), 'scale': (
0.8, 6, 20), 'type': 'box', 'materials': (self._fake_wall_material, )})))
self.net_blocc.append(bs.NodeActor(bs.newnode('region',attrs={'position': (0,0,0),'scale': (0.6,2.4,20),'type': 'box','materials': (self._net_wall_material, )}))) self.net_blocc.append(bs.NodeActor(bs.newnode('region', attrs={'position': (0, 0, 0), 'scale': (
0.6, 2.4, 20), 'type': 'box', 'materials': (self._net_wall_material, )})))
def on_team_join(self, team: Team) -> None: def on_team_join(self, team: Team) -> None:
self._update_scoreboard() self._update_scoreboard()
@ -426,18 +419,15 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
scoring_team = team scoring_team = team
team.score += 1 team.score += 1
# Change puck Spawn # Change puck Spawn
if team.id == 0: # left side scored if team.id == 0: # left side scored
self._puck_spawn_pos= (5, 0.42, 0) self._puck_spawn_pos = (5, 0.42, 0)
elif team.id == 1: # right side scored elif team.id == 1: # right side scored
self._puck_spawn_pos= (-5, 0.42, 0) self._puck_spawn_pos = (-5, 0.42, 0)
else: # normally shouldn't occur else: # normally shouldn't occur
self._puck_spawn_pos= (0, 0.42, 0) self._puck_spawn_pos = (0, 0.42, 0)
# Easy pizzy # Easy pizzy
for player in team.players: for player in team.players:
if player.actor: if player.actor:
player.actor.handlemessage(bs.CelebrateMessage(2.0)) player.actor.handlemessage(bs.CelebrateMessage(2.0))
@ -461,10 +451,10 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
self._puck.scored = True self._puck.scored = True
# Kill the puck (it'll respawn itself shortly). # Kill the puck (it'll respawn itself shortly).
bs.emitfx(position= bs.getcollision().position, count=int(6.0 + 7.0 * 12), scale=3, spread=0.5, chunk_type='spark') bs.emitfx(position=bs.getcollision().position, count=int(
6.0 + 7.0 * 12), scale=3, spread=0.5, chunk_type='spark')
bs.timer(0.7, self._kill_puck) bs.timer(0.7, self._kill_puck)
bs.cameraflash(duration=7.0) bs.cameraflash(duration=7.0)
self._update_scoreboard() self._update_scoreboard()
@ -494,7 +484,6 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
spaz.bomb_count = 0 spaz.bomb_count = 0
# Imagine not being able to swipe those colorful buttons ;( # Imagine not being able to swipe those colorful buttons ;(
if self._punchie_: if self._punchie_:
spaz.connect_controls_to_player(enable_punch=False) spaz.connect_controls_to_player(enable_punch=False)
@ -517,7 +506,8 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
def _flash_puck_spawn(self) -> None: def _flash_puck_spawn(self) -> None:
# Effect >>>>>> Flashly # Effect >>>>>> Flashly
bs.emitfx(position= self._puck_spawn_pos, count=int(6.0 + 7.0 * 12), scale=1.7, spread=0.4, chunk_type='spark') bs.emitfx(position=self._puck_spawn_pos, count=int(
6.0 + 7.0 * 12), scale=1.7, spread=0.4, chunk_type='spark')
def _spawn_puck(self) -> None: def _spawn_puck(self) -> None:
self._swipsound.play() self._swipsound.play()
@ -527,45 +517,26 @@ class VolleyBallGame(bs.TeamGameActivity[Player, Team]):
self._puck = Puck(position=self._puck_spawn_pos) self._puck = Puck(position=self._puck_spawn_pos)
class Pointzz: class Pointzz:
points, boxes = {}, {} points, boxes = {}, {}
points['spawn1'] = (-8.03866, 0.02275, 0.0) + (0.5, 0.05, 4.0) points['spawn1'] = (-8.03866, 0.02275, 0.0) + (0.5, 0.05, 4.0)
points['spawn2'] = (8.82311, 0.01092, 0.0) + (0.5, 0.05, 4.0) points['spawn2'] = (8.82311, 0.01092, 0.0) + (0.5, 0.05, 4.0)
boxes['area_of_interest_bounds'] = (0.0, 1.18575, 0.43262) + (0, 0, 0) + (29.81803, 11.57249, 18.89134) boxes['area_of_interest_bounds'] = (0.0, 1.18575, 0.43262) + \
(0, 0, 0) + (29.81803, 11.57249, 18.89134)
boxes['map_bounds'] = (0.0, 1.185751251, 0.4326226188) + (0.0, 0.0, 0.0) + ( boxes['map_bounds'] = (0.0, 1.185751251, 0.4326226188) + (0.0, 0.0, 0.0) + (
42.09506485, 22.81173179, 29.76723155) 42.09506485, 22.81173179, 29.76723155)
class PointzzforH: class PointzzforH:
points, boxes = {}, {} points, boxes = {}, {}
boxes['area_of_interest_bounds'] = (0.0, 0.7956858119, 0.0) + (0.0, 0.0, 0.0) + (30.80223883, 0.5961646365, 13.88431707) boxes['area_of_interest_bounds'] = (0.0, 0.7956858119, 0.0) + \
(0.0, 0.0, 0.0) + (30.80223883, 0.5961646365, 13.88431707)
boxes['map_bounds'] = (0.0, 0.7956858119, -0.4689020853) + (0.0, 0.0, 0.0) + ( boxes['map_bounds'] = (0.0, 0.7956858119, -0.4689020853) + (0.0, 0.0, 0.0) + (
35.16182389, 12.18696164, 21.52869693) 35.16182389, 12.18696164, 21.52869693)
points['spawn1'] = (-6.835352227, 0.02305323209, 0.0) + (1.0, 1.0, 3.0) points['spawn1'] = (-6.835352227, 0.02305323209, 0.0) + (1.0, 1.0, 3.0)
points['spawn2'] = (6.857415055, 0.03938567998, 0.0) + (1.0, 1.0, 3.0) points['spawn2'] = (6.857415055, 0.03938567998, 0.0) + (1.0, 1.0, 3.0)
class VolleyBallMap(bs.Map): class VolleyBallMap(bs.Map):
defs = Pointzz() defs = Pointzz()
name = "Open Field" name = "Open Field"
@ -592,42 +563,42 @@ class VolleyBallMap(bs.Map):
super().__init__() super().__init__()
shared = SharedObjects.get() shared = SharedObjects.get()
x = -5 x = -5
while x<5: while x < 5:
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,0,x), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, 0, x),
'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.25,x), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .25, x),
'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.5,x), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .5, x),
'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.75,x), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .75, x),
'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,1,x), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, 1, x),
'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
x = x + 0.5 x = x + 0.5
y = -1 y = -1
while y>-11: while y > -11:
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(y,0.01,4), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (y, 0.01, 4),
'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(y,0.01,-4), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (y, 0.01, -4),
'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-y,0.01,4), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-y, 0.01, 4),
'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-y,0.01,-4), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-y, 0.01, -4),
'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
y-=1 y -= 1
z = 0 z = 0
while z<5: while z < 5:
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(11,0.01,z), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (11, 0.01, z),
'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(11,0.01,-z), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (11, 0.01, -z),
'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-11,0.01,z), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-11, 0.01, z),
'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-11,0.01,-z), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-11, 0.01, -z),
'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
z+=1 z += 1
self.node = bs.newnode( self.node = bs.newnode(
'terrain', 'terrain',
@ -655,7 +626,6 @@ class VolleyBallMap(bs.Map):
gnode.vr_near_clip = 0.5 gnode.vr_near_clip = 0.5
class VolleyBallMapH(bs.Map): class VolleyBallMapH(bs.Map):
defs = PointzzforH() defs = PointzzforH()
name = 'Closed Arena' name = 'Closed Arena'
@ -672,7 +642,7 @@ class VolleyBallMapH(bs.Map):
def on_preload(cls) -> Any: def on_preload(cls) -> Any:
data: Dict[str, Any] = { data: Dict[str, Any] = {
'meshs': (bs.getmesh('hockeyStadiumOuter'), 'meshs': (bs.getmesh('hockeyStadiumOuter'),
bs.getmesh('hockeyStadiumInner')), bs.getmesh('hockeyStadiumInner')),
'vr_fill_mesh': bs.getmesh('footballStadiumVRFill'), 'vr_fill_mesh': bs.getmesh('footballStadiumVRFill'),
'collision_mesh': bs.getcollisionmesh('hockeyStadiumCollide'), 'collision_mesh': bs.getcollisionmesh('hockeyStadiumCollide'),
'tex': bs.gettexture('hockeyStadium'), 'tex': bs.gettexture('hockeyStadium'),
@ -686,42 +656,42 @@ class VolleyBallMapH(bs.Map):
super().__init__() super().__init__()
shared = SharedObjects.get() shared = SharedObjects.get()
x = -5 x = -5
while x<5: while x < 5:
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,0,x), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, 0, x),
'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.25,x), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .25, x),
'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.5,x), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .5, x),
'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,.75,x), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, .75, x),
'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(0,1,x), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (0, 1, x),
'color':(1,1,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 1, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
x = x + 0.5 x = x + 0.5
y = -1 y = -1
while y>-11: while y > -11:
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(y,0.01,4), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (y, 0.01, 4),
'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(y,0.01,-4), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (y, 0.01, -4),
'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-y,0.01,4), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-y, 0.01, 4),
'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-y,0.01,-4), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-y, 0.01, -4),
'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
y-=1 y -= 1
z = 0 z = 0
while z<5: while z < 5:
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(11,0.01,z), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (11, 0.01, z),
'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(11,0.01,-z), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (11, 0.01, -z),
'color':(1,0,0),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (1, 0, 0), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-11,0.01,z), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-11, 0.01, z),
'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
self.zone = bs.newnode('locator',attrs={'shape':'circle','position':(-11,0.01,-z), self.zone = bs.newnode('locator', attrs={'shape': 'circle', 'position': (-11, 0.01, -z),
'color':(0,0,1),'opacity':1,'draw_beauty':True,'additive':False,'size':[0.40]}) 'color': (0, 0, 1), 'opacity': 1, 'draw_beauty': True, 'additive': False, 'size': [0.40]})
z+=1 z += 1
self.node = bs.newnode('terrain', self.node = bs.newnode('terrain',
delegate=self, delegate=self,
@ -729,7 +699,8 @@ class VolleyBallMapH(bs.Map):
'mesh': 'mesh':
None, None,
'collision_mesh': 'collision_mesh':
bs.getcollisionmesh('footballStadiumCollide'), # we dont want Goalposts... # we dont want Goalposts...
bs.getcollisionmesh('footballStadiumCollide'),
'color_texture': 'color_texture':
self.preloaddata['tex'], self.preloaddata['tex'],
'materials': [ 'materials': [
@ -750,7 +721,7 @@ class VolleyBallMapH(bs.Map):
'opacity': 0.92, 'opacity': 0.92,
'opacity_in_low_or_medium_quality': 1.0, 'opacity_in_low_or_medium_quality': 1.0,
'materials': mats, 'materials': mats,
'color': (0.4,0.9,0) 'color': (0.4, 0.9, 0)
}) })
self.background = bs.newnode( self.background = bs.newnode(
@ -759,7 +730,7 @@ class VolleyBallMapH(bs.Map):
'mesh': bs.getmesh('natureBackground'), 'mesh': bs.getmesh('natureBackground'),
'lighting': False, 'lighting': False,
'background': True, 'background': True,
'color': (0.5,0.30,0.4) 'color': (0.5, 0.30, 0.4)
}) })
gnode = bs.getactivity().globalsnode gnode = bs.getactivity().globalsnode
@ -772,9 +743,7 @@ class VolleyBallMapH(bs.Map):
gnode.vignette_inner = (0.93, 0.93, 0.95) gnode.vignette_inner = (0.93, 0.93, 0.95)
gnode.vr_camera_offset = (0, -0.8, -1.1) gnode.vr_camera_offset = (0, -0.8, -1.1)
gnode.vr_near_clip = 0.5 gnode.vr_near_clip = 0.5
#self.is_hockey = True # self.is_hockey = True
bs._map.register_map(VolleyBallMap) bs._map.register_map(VolleyBallMap)