mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
Add files via upload
Updated dodge_the_ball minigame to api 8
This commit is contained in:
parent
230ae028e0
commit
dd28dc6467
1 changed files with 397 additions and 396 deletions
|
|
@ -6,18 +6,20 @@
|
||||||
|
|
||||||
# Feel free to edit.
|
# Feel free to edit.
|
||||||
|
|
||||||
# ba_meta require api 7
|
# ba_meta require api 8
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import ba
|
import babase
|
||||||
|
import bauiv1 as bui
|
||||||
|
import bascenev1 as bs
|
||||||
from random import choice
|
from random import choice
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from bastd.actor.bomb import Blast
|
from bascenev1lib.actor.bomb import Blast
|
||||||
from bastd.actor.popuptext import PopupText
|
from bascenev1lib.actor.popuptext import PopupText
|
||||||
from bastd.actor.powerupbox import PowerupBox
|
from bascenev1lib.actor.powerupbox import PowerupBox
|
||||||
from bastd.actor.onscreencountdown import OnScreenCountdown
|
from bascenev1lib.actor.onscreencountdown import OnScreenCountdown
|
||||||
from bastd.gameutils import SharedObjects
|
from bascenev1lib.gameutils import SharedObjects
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import NoReturn, Sequence, Any
|
from typing import NoReturn, Sequence, Any
|
||||||
|
|
@ -39,31 +41,28 @@ class BallType(Enum):
|
||||||
# increase the next ball speed but less than MEDIUM.
|
# increase the next ball speed but less than MEDIUM.
|
||||||
# Ball color is crimson(purple+red = pinky color type).
|
# Ball color is crimson(purple+red = pinky color type).
|
||||||
|
|
||||||
|
|
||||||
# this dict decide the ball_type spawning rate like powerup box
|
# this dict decide the ball_type spawning rate like powerup box
|
||||||
ball_type_dict: dict[BallType, int] = {
|
ball_type_dict: dict[BallType, int] = {
|
||||||
BallType.EASY: 3,
|
BallType.EASY: 3,
|
||||||
BallType.MEDIUM: 2,
|
BallType.MEDIUM: 2,
|
||||||
BallType.HARD: 1,
|
BallType.HARD: 1,
|
||||||
}
|
};
|
||||||
|
|
||||||
|
class Ball(bs.Actor):
|
||||||
class Ball(ba.Actor):
|
|
||||||
""" Shooting Ball """
|
""" Shooting Ball """
|
||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
position: Sequence[float],
|
position: Sequence[float],
|
||||||
velocity: Sequence[float],
|
velocity: Sequence[float],
|
||||||
texture: ba.Texture,
|
texture: babase.Texture,
|
||||||
body_scale: float = 1.0,
|
body_scale: float = 1.0,
|
||||||
gravity_scale: float = 1.0,
|
gravity_scale: float = 1.0,
|
||||||
) -> NoReturn:
|
) -> NoReturn:
|
||||||
|
|
||||||
super().__init__()
|
super().__init__();
|
||||||
|
|
||||||
shared = SharedObjects.get()
|
shared = SharedObjects.get();
|
||||||
|
|
||||||
ball_material = ba.Material()
|
ball_material = bs.Material();
|
||||||
ball_material.add_actions(
|
ball_material.add_actions(
|
||||||
conditions=(
|
conditions=(
|
||||||
(
|
(
|
||||||
|
|
@ -75,9 +74,9 @@ class Ball(ba.Actor):
|
||||||
('they_have_material', shared.object_material),
|
('they_have_material', shared.object_material),
|
||||||
),
|
),
|
||||||
actions=('modify_node_collision', 'collide', False),
|
actions=('modify_node_collision', 'collide', False),
|
||||||
)
|
);
|
||||||
|
|
||||||
self.node = ba.newnode(
|
self.node = bs.newnode(
|
||||||
'prop',
|
'prop',
|
||||||
delegate=self,
|
delegate=self,
|
||||||
attrs={
|
attrs={
|
||||||
|
|
@ -85,29 +84,29 @@ class Ball(ba.Actor):
|
||||||
'position': position,
|
'position': position,
|
||||||
'velocity': velocity,
|
'velocity': velocity,
|
||||||
'body_scale': body_scale,
|
'body_scale': body_scale,
|
||||||
'model': ba.getmodel('frostyPelvis'),
|
'mesh': bs.getmesh('frostyPelvis'),
|
||||||
'model_scale': body_scale,
|
'mesh_scale': body_scale,
|
||||||
'color_texture': texture,
|
'color_texture': texture,
|
||||||
'gravity_scale': gravity_scale,
|
'gravity_scale': gravity_scale,
|
||||||
'density': 4.0, # increase density of ball so ball collide with player with heavy force. # ammm very bad grammer
|
'density': 4.0, # increase density of ball so ball collide with player with heavy force. # ammm very bad grammer
|
||||||
'materials': (ball_material,),
|
'materials': (ball_material,),
|
||||||
},
|
},
|
||||||
)
|
);
|
||||||
|
|
||||||
# die the ball manually incase the ball doesn't fall the outside of the map
|
# die the ball manually incase the ball doesn't fall the outside of the map
|
||||||
ba.timer(2.5, ba.WeakCall(self.handlemessage, ba.DieMessage()))
|
bs.timer(2.5, bs.WeakCall(self.handlemessage, bs.DieMessage()));
|
||||||
|
|
||||||
# i am not handling anything in this ball Class(except for diemessage).
|
# i am not handling anything in this ball Class(except for diemessage).
|
||||||
# all game things and logics going to be in the box class
|
# all game things and logics going to be in the box class
|
||||||
def handlemessage(self, msg: Any) -> Any:
|
def handlemessage(self, msg: Any) -> Any:
|
||||||
|
|
||||||
if isinstance(msg, ba.DieMessage):
|
if isinstance(msg, bs.DieMessage):
|
||||||
self.node.delete()
|
self.node.delete();
|
||||||
else:
|
else:
|
||||||
super().handlemessage(msg)
|
super().handlemessage(msg);
|
||||||
|
|
||||||
|
|
||||||
class Box(ba.Actor):
|
class Box(bs.Actor):
|
||||||
""" A box that spawn midle of map as a decoration perpose """
|
""" A box that spawn midle of map as a decoration perpose """
|
||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
|
|
@ -115,11 +114,11 @@ class Box(ba.Actor):
|
||||||
velocity: Sequence[float],
|
velocity: Sequence[float],
|
||||||
) -> NoReturn:
|
) -> NoReturn:
|
||||||
|
|
||||||
super().__init__()
|
super().__init__();
|
||||||
|
|
||||||
shared = SharedObjects.get()
|
shared = SharedObjects.get();
|
||||||
# self.ball_jump = 0.0;
|
# self.ball_jump = 0.0;
|
||||||
no_hit_material = ba.Material()
|
no_hit_material = bs.Material();
|
||||||
# we don't need that the box was move and collide with objects.
|
# we don't need that the box was move and collide with objects.
|
||||||
no_hit_material.add_actions(
|
no_hit_material.add_actions(
|
||||||
conditions=(
|
conditions=(
|
||||||
|
|
@ -128,7 +127,7 @@ class Box(ba.Actor):
|
||||||
('they_have_material', shared.attack_material),
|
('they_have_material', shared.attack_material),
|
||||||
),
|
),
|
||||||
actions=('modify_part_collision', 'collide', False),
|
actions=('modify_part_collision', 'collide', False),
|
||||||
)
|
);
|
||||||
|
|
||||||
no_hit_material.add_actions(
|
no_hit_material.add_actions(
|
||||||
conditions=(
|
conditions=(
|
||||||
|
|
@ -140,27 +139,27 @@ class Box(ba.Actor):
|
||||||
('modify_part_collision', 'collide', False),
|
('modify_part_collision', 'collide', False),
|
||||||
('modify_part_collision', 'physical', False),
|
('modify_part_collision', 'physical', False),
|
||||||
),
|
),
|
||||||
)
|
);
|
||||||
|
|
||||||
self.node = ba.newnode(
|
self.node = bs.newnode(
|
||||||
'prop',
|
'prop',
|
||||||
delegate=self,
|
delegate=self,
|
||||||
attrs={
|
attrs={
|
||||||
'body': 'box',
|
'body': 'box',
|
||||||
'position': position,
|
'position': position,
|
||||||
'model': ba.getmodel('powerup'),
|
'mesh': bs.getmesh('powerup'),
|
||||||
'light_model': ba.getmodel('powerupSimple'),
|
'light_mesh': bs.getmesh('powerupSimple'),
|
||||||
'shadow_size': 0.5,
|
'shadow_size': 0.5,
|
||||||
'body_scale': 1.4,
|
'body_scale': 1.4,
|
||||||
'model_scale': 1.4,
|
'mesh_scale': 1.4,
|
||||||
'color_texture': ba.gettexture('landMineLit'),
|
'color_texture': bs.gettexture('landMineLit'),
|
||||||
'reflection': 'powerup',
|
'reflection': 'powerup',
|
||||||
'reflection_scale': [1.0],
|
'reflection_scale': [1.0],
|
||||||
'materials': (no_hit_material,),
|
'materials': (no_hit_material,),
|
||||||
},
|
},
|
||||||
)
|
);
|
||||||
# light
|
# light
|
||||||
self.light = ba.newnode(
|
self.light = bs.newnode(
|
||||||
"light",
|
"light",
|
||||||
owner = self.node,
|
owner = self.node,
|
||||||
attrs={
|
attrs={
|
||||||
|
|
@ -168,12 +167,12 @@ class Box(ba.Actor):
|
||||||
'intensity' : 0.8,
|
'intensity' : 0.8,
|
||||||
'color': (0.0, 1.0, 0.0),
|
'color': (0.0, 1.0, 0.0),
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
self.node.connectattr("position", self.light, "position")
|
self.node.connectattr("position", self.light, "position");
|
||||||
# Drawing circle and circleOutline in radius of 3,
|
# Drawing circle and circleOutline in radius of 3,
|
||||||
# so player can see that how close he is to the box.
|
# so player can see that how close he is to the box.
|
||||||
# If player is inside this circle the ball speed will increase.
|
# If player is inside this circle the ball speed will increase.
|
||||||
circle = ba.newnode(
|
circle = bs.newnode(
|
||||||
"locator",
|
"locator",
|
||||||
owner = self.node,
|
owner = self.node,
|
||||||
attrs = {
|
attrs = {
|
||||||
|
|
@ -185,9 +184,9 @@ class Box(ba.Actor):
|
||||||
'additive': True,
|
'additive': True,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
self.node.connectattr("position", circle, "position")
|
self.node.connectattr("position", circle, "position");
|
||||||
# also adding a outline cause its look nice.
|
# also adding a outline cause its look nice.
|
||||||
circle_outline = ba.newnode(
|
circle_outline = bs.newnode(
|
||||||
"locator",
|
"locator",
|
||||||
owner = self.node,
|
owner = self.node,
|
||||||
attrs = {
|
attrs = {
|
||||||
|
|
@ -198,76 +197,76 @@ class Box(ba.Actor):
|
||||||
'draw_beauty': False,
|
'draw_beauty': False,
|
||||||
'additive': True,
|
'additive': True,
|
||||||
},
|
},
|
||||||
)
|
);
|
||||||
self.node.connectattr("position", circle_outline, "position")
|
self.node.connectattr("position", circle_outline, "position");
|
||||||
|
|
||||||
# all ball attribute that we need.
|
# all ball attribute that we need.
|
||||||
self.ball_type: BallType = BallType.EASY
|
self.ball_type: BallType = BallType.EASY;
|
||||||
self.shoot_timer: ba.Timer | None = None
|
self.shoot_timer: bs.Timer | None = None;
|
||||||
self.shoot_speed: float = 0.0
|
self.shoot_speed: float = 0.0;
|
||||||
# this force the shoot if player is inside the red circle.
|
# this force the shoot if player is inside the red circle.
|
||||||
self.force_shoot_speed: float = 0.0
|
self.force_shoot_speed: float = 0.0;
|
||||||
self.ball_mag = 3000
|
self.ball_mag = 3000;
|
||||||
self.ball_gravity: float = 1.0
|
self.ball_gravity: float = 1.0;
|
||||||
self.ball_tex: ba.Texture | None = None
|
self.ball_tex: babase.Texture | None = None;
|
||||||
# only for Hard ball_type
|
# only for Hard ball_type
|
||||||
self.player_facing_direction: list[float, float] = [0.0, 0.0]
|
self.player_facing_direction: list[float, float] = [0.0, 0.0];
|
||||||
# ball shoot soound.
|
# ball shoot soound.
|
||||||
self.shoot_sound = ba.getsound('laserReverse')
|
self.shoot_sound = bs.getsound('laserReverse');
|
||||||
|
|
||||||
# same as "powerupdist"
|
# same as "powerupdist"
|
||||||
self.ball_type_dist: list[BallType] = []
|
self.ball_type_dist: list[BallType] = [];
|
||||||
|
|
||||||
for ball in ball_type_dict:
|
for ball in ball_type_dict:
|
||||||
for _ in range(ball_type_dict[ball]):
|
for _ in range(ball_type_dict[ball]):
|
||||||
self.ball_type_dist.append(ball)
|
self.ball_type_dist.append(ball);
|
||||||
|
|
||||||
# Here main logic of game goes here.
|
# Here main logic of game goes here.
|
||||||
# like shoot balls, shoot speed, anything we want goes here(except for some thing).
|
# like shoot balls, shoot speed, anything we want goes here(except for some thing).
|
||||||
def start_shoot(self) -> NoReturn:
|
def start_shoot(self) -> NoReturn:
|
||||||
|
|
||||||
# getting all allive players in a list.
|
# getting all allive players in a list.
|
||||||
alive_players_list = self.activity.get_alive_players()
|
alive_players_list = self.activity.get_alive_players();
|
||||||
|
|
||||||
# make sure that list is not Empty.
|
# make sure that list is not Empty.
|
||||||
if len(alive_players_list) > 0:
|
if len(alive_players_list) > 0:
|
||||||
|
|
||||||
# choosing a random player from list.
|
# choosing a random player from list.
|
||||||
target_player = choice(alive_players_list)
|
target_player = choice(alive_players_list);
|
||||||
# highlight the target player
|
# highlight the target player
|
||||||
self.highlight_target_player(target_player)
|
self.highlight_target_player(target_player);
|
||||||
|
|
||||||
# to finding difference between player and box.
|
# to finding difference between player and box.
|
||||||
# we just need to subtract player pos and ball pos.
|
# we just need to subtract player pos and ball pos.
|
||||||
# Same logic as eric applied in Target Practice Gamemode.
|
# Same logic as eric applied in Target Practice Gamemode.
|
||||||
difference = ba.Vec3(target_player.position) - ba.Vec3(self.node.position)
|
difference = babase.Vec3(target_player.position) - babase.Vec3(self.node.position);
|
||||||
|
|
||||||
# discard Y position so ball shoot more straight.
|
# discard Y position so ball shoot more straight.
|
||||||
difference[1] = 0.0
|
difference[1] = 0.0
|
||||||
|
|
||||||
# and now, this length method returns distance in float.
|
# and now, this length method returns distance in float.
|
||||||
# we're gonna use this value for calculating player analog stick
|
# we're gonna use this value for calculating player analog stick
|
||||||
distance = difference.length()
|
distance = difference.length();
|
||||||
|
|
||||||
# shoot a random BallType
|
# shoot a random BallType
|
||||||
self.upgrade_ball_type(choice(self.ball_type_dist))
|
self.upgrade_ball_type(choice(self.ball_type_dist));
|
||||||
|
|
||||||
# and check the ball_type and upgrade it gravity_scale, texture, next ball speed.
|
# and check the ball_type and upgrade it gravity_scale, texture, next ball speed.
|
||||||
self.check_ball_type(self.ball_type)
|
self.check_ball_type(self.ball_type);
|
||||||
|
|
||||||
# For HARD ball i am just focusing on player analog stick facing direction.
|
# For HARD ball i am just focusing on player analog stick facing direction.
|
||||||
# Not very accurate and that's we need.
|
# Not very accurate and that's we need.
|
||||||
if self.ball_type == BallType.HARD:
|
if self.ball_type == BallType.HARD:
|
||||||
self.calculate_player_analog_stick(target_player, distance)
|
self.calculate_player_analog_stick(target_player, distance);
|
||||||
else:
|
else:
|
||||||
self.player_facing_direction = [0.0, 0.0]
|
self.player_facing_direction = [0.0, 0.0];
|
||||||
|
|
||||||
pos = self.node.position
|
pos = self.node.position;
|
||||||
|
|
||||||
if self.ball_type == BallType.MEDIUM or self.ball_type == BallType.HARD:
|
if self.ball_type == BallType.MEDIUM or self.ball_type == BallType.HARD:
|
||||||
# Target head by increasing Y pos.
|
# Target head by increasing Y pos.
|
||||||
# How this work? cause ball gravity_scale is ......
|
# How this work? cause ball gravity_scale is ......
|
||||||
pos = (pos[0], pos[1]+.25, pos[2])
|
pos = (pos[0], pos[1]+.25, pos[2]);
|
||||||
|
|
||||||
# ball is generating..
|
# ball is generating..
|
||||||
ball = Ball(
|
ball = Ball(
|
||||||
|
|
@ -276,14 +275,14 @@ class Box(ba.Actor):
|
||||||
texture = self.ball_tex,
|
texture = self.ball_tex,
|
||||||
gravity_scale = self.ball_gravity,
|
gravity_scale = self.ball_gravity,
|
||||||
body_scale = 1.0,
|
body_scale = 1.0,
|
||||||
).autoretain()
|
).autoretain();
|
||||||
|
|
||||||
# shoot Animation and sound.
|
# shoot Animation and sound.
|
||||||
self.shoot_animation()
|
self.shoot_animation();
|
||||||
|
|
||||||
# force the shoot speed if player try to go inside the red circle.
|
# force the shoot speed if player try to go inside the red circle.
|
||||||
if self.force_shoot_speed != 0.0:
|
if self.force_shoot_speed != 0.0:
|
||||||
self.shoot_speed = self.force_shoot_speed
|
self.shoot_speed = self.force_shoot_speed;
|
||||||
|
|
||||||
# push the ball to the player
|
# push the ball to the player
|
||||||
ball.node.handlemessage(
|
ball.node.handlemessage(
|
||||||
|
|
@ -299,59 +298,61 @@ class Box(ba.Actor):
|
||||||
difference[0] + self.player_facing_direction[0], # force direction X
|
difference[0] + self.player_facing_direction[0], # force direction X
|
||||||
difference[1] , # force direction Y
|
difference[1] , # force direction Y
|
||||||
difference[2] + self.player_facing_direction[1], # force direction Z
|
difference[2] + self.player_facing_direction[1], # force direction Z
|
||||||
)
|
);
|
||||||
# creating our timer and shoot the ball again.(and we create a loop)
|
# creating our timer and shoot the ball again.(and we create a loop)
|
||||||
self.shoot_timer = ba.Timer(self.shoot_speed, self.start_shoot)
|
self.shoot_timer = bs.Timer(self.shoot_speed, self.start_shoot);
|
||||||
|
|
||||||
def upgrade_ball_type(self, ball_type: BallType) -> NoReturn:
|
def upgrade_ball_type(self, ball_type: BallType) -> NoReturn:
|
||||||
|
|
||||||
self.ball_type = ball_type
|
self.ball_type = ball_type;
|
||||||
|
|
||||||
def check_ball_type(self, ball_type: BallType) -> NoReturn:
|
def check_ball_type(self, ball_type: BallType) -> NoReturn:
|
||||||
|
|
||||||
if ball_type == BallType.EASY:
|
if ball_type == BallType.EASY:
|
||||||
self.shoot_speed = 0.8
|
self.shoot_speed = 0.8;
|
||||||
self.ball_gravity = 1.0
|
self.ball_gravity = 1.0;
|
||||||
# next ball shoot speed
|
# next ball shoot speed
|
||||||
self.ball_mag = 3000
|
self.ball_mag = 3000;
|
||||||
# box light color and ball tex
|
# box light color and ball tex
|
||||||
self.light.color = (1.0, 1.0, 0.0)
|
self.light.color = (1.0, 1.0, 0.0);
|
||||||
self.ball_tex = ba.gettexture('egg4')
|
self.ball_tex = bs.gettexture('egg4');
|
||||||
elif ball_type == BallType.MEDIUM:
|
elif ball_type == BallType.MEDIUM:
|
||||||
self.ball_mag = 3000
|
self.ball_mag = 3000;
|
||||||
# decrease the gravity scale so, ball shoot without falling and straight.
|
# decrease the gravity scale so, ball shoot without falling and straight.
|
||||||
self.ball_gravity = 0.0
|
self.ball_gravity = 0.0;
|
||||||
# next ball shoot speed.
|
# next ball shoot speed.
|
||||||
self.shoot_speed = 0.4
|
self.shoot_speed = 0.4;
|
||||||
# box light color and ball tex.
|
# box light color and ball tex.
|
||||||
self.light.color = (1.0, 0.0, 1.0)
|
self.light.color = (1.0, 0.0, 1.0);
|
||||||
self.ball_tex = ba.gettexture('egg3')
|
self.ball_tex = bs.gettexture('egg3');
|
||||||
elif ball_type == BallType.HARD:
|
elif ball_type == BallType.HARD:
|
||||||
self.ball_mag = 2500
|
self.ball_mag = 2500;
|
||||||
self.ball_gravity = 0.0
|
self.ball_gravity = 0.0;
|
||||||
# next ball shoot speed.
|
# next ball shoot speed.
|
||||||
self.shoot_speed = 0.6
|
self.shoot_speed = 0.6;
|
||||||
# box light color and ball tex.
|
# box light color and ball tex.
|
||||||
self.light.color = (1.0, 0.2, 1.0)
|
self.light.color = (1.0, 0.2, 1.0);
|
||||||
self.ball_tex = ba.gettexture('egg1')
|
self.ball_tex = bs.gettexture('egg1');
|
||||||
|
|
||||||
def shoot_animation(self) -> NoReturn:
|
def shoot_animation(self) -> NoReturn:
|
||||||
|
|
||||||
ba.animate(
|
bs.animate(
|
||||||
self.node,
|
self.node,
|
||||||
"model_scale", {
|
"mesh_scale",{
|
||||||
0.00: 1.4,
|
0.00: 1.4,
|
||||||
0.05: 1.7,
|
0.05: 1.7,
|
||||||
0.10: 1.4,
|
0.10: 1.4,
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
# playing shoot sound.
|
# playing shoot sound.
|
||||||
ba.playsound(self.shoot_sound, position=self.node.position)
|
# self.shoot_sound, position = self.node.position.play();
|
||||||
|
self.shoot_sound.play()
|
||||||
|
|
||||||
def highlight_target_player(self, player: ba.Player) -> NoReturn:
|
|
||||||
|
def highlight_target_player(self, player: bs.Player) -> NoReturn:
|
||||||
|
|
||||||
# adding light
|
# adding light
|
||||||
light = ba.newnode(
|
light = bs.newnode(
|
||||||
"light",
|
"light",
|
||||||
owner = self.node,
|
owner = self.node,
|
||||||
attrs={
|
attrs={
|
||||||
|
|
@ -359,8 +360,8 @@ class Box(ba.Actor):
|
||||||
'intensity':1.0,
|
'intensity':1.0,
|
||||||
'color': (1.0, 0.0, 0.0),
|
'color': (1.0, 0.0, 0.0),
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
ba.animate(
|
bs.animate(
|
||||||
light,
|
light,
|
||||||
"radius",{
|
"radius",{
|
||||||
0.05: 0.02,
|
0.05: 0.02,
|
||||||
|
|
@ -372,9 +373,9 @@ class Box(ba.Actor):
|
||||||
0.35: 0.02,
|
0.35: 0.02,
|
||||||
0.40: 0.00,
|
0.40: 0.00,
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
# And a circle outline with ugly animation.
|
# And a circle outline with ugly animation.
|
||||||
circle_outline = ba.newnode(
|
circle_outline = bs.newnode(
|
||||||
"locator",
|
"locator",
|
||||||
owner = player.actor.node,
|
owner = player.actor.node,
|
||||||
attrs={
|
attrs={
|
||||||
|
|
@ -384,8 +385,8 @@ class Box(ba.Actor):
|
||||||
'draw_beauty': False,
|
'draw_beauty': False,
|
||||||
'additive': True,
|
'additive': True,
|
||||||
},
|
},
|
||||||
)
|
);
|
||||||
ba.animate_array(
|
bs.animate_array(
|
||||||
circle_outline,
|
circle_outline,
|
||||||
'size',
|
'size',
|
||||||
1, {
|
1, {
|
||||||
|
|
@ -398,31 +399,31 @@ class Box(ba.Actor):
|
||||||
0.35: [0.6],
|
0.35: [0.6],
|
||||||
0.40: [0.0],
|
0.40: [0.0],
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
|
|
||||||
# coonect it and...
|
# coonect it and...
|
||||||
player.actor.node.connectattr("position", light, "position")
|
player.actor.node.connectattr("position", light, "position");
|
||||||
player.actor.node.connectattr("position", circle_outline, "position")
|
player.actor.node.connectattr("position", circle_outline, "position");
|
||||||
|
|
||||||
# immediately delete the node after another player has been targeted.
|
# immediately delete the node after another player has been targeted.
|
||||||
self.shoot_speed = 0.5 if self.shoot_speed == 0.0 else self.shoot_speed
|
self.shoot_speed = 0.5 if self.shoot_speed == 0.0 else self.shoot_speed;
|
||||||
ba.timer(self.shoot_speed, light.delete)
|
bs.timer(self.shoot_speed, light.delete);
|
||||||
ba.timer(self.shoot_speed, circle_outline.delete)
|
bs.timer(self.shoot_speed, circle_outline.delete);
|
||||||
|
|
||||||
def calculate_player_analog_stick(self, player: ba.Player, distance: float) -> NoReturn:
|
def calculate_player_analog_stick(self, player:bs.Player, distance: float) -> NoReturn:
|
||||||
# at first i was very confused how i can read the player analog stick \
|
# at first i was very confused how i can read the player analog stick \
|
||||||
# then i saw TheMikirog#1984 autorun plugin code.
|
# then i saw TheMikirog#1984 autorun plugin code.
|
||||||
# and i got it how analog stick values are works.
|
# and i got it how analog stick values are works.
|
||||||
# just need to store analog stick facing direction and need some calculation according how far player pushed analog stick.
|
# just need to store analog stick facing direction and need some calculation according how far player pushed analog stick.
|
||||||
# Notice that how vertical direction is inverted, so we need to put a minus infront of veriable.(so ball isn't shoot at wrong direction).
|
# Notice that how vertical direction is inverted, so we need to put a minus infront of veriable.(so ball isn't shoot at wrong direction).
|
||||||
self.player_facing_direction[0] = player.actor.node.move_left_right
|
self.player_facing_direction[0] = player.actor.node.move_left_right;
|
||||||
self.player_facing_direction[1] = -player.actor.node.move_up_down
|
self.player_facing_direction[1] = -player.actor.node.move_up_down;
|
||||||
|
|
||||||
# if player is too close and the player pushing his analog stick fully the ball shoot's too far away to player.
|
# if player is too close and the player pushing his analog stick fully the ball shoot's too far away to player.
|
||||||
# so, we need to reduce the value of "self.player_facing_direction" to fix this problem.
|
# so, we need to reduce the value of "self.player_facing_direction" to fix this problem.
|
||||||
if distance <= 3:
|
if distance <= 3:
|
||||||
self.player_facing_direction[0] = 0.4 if self.player_facing_direction[0] > 0 else -0.4
|
self.player_facing_direction[0] = 0.4 if self.player_facing_direction[0] > 0 else -0.4;
|
||||||
self.player_facing_direction[1] = 0.4 if self.player_facing_direction[0] > 0 else -0.4
|
self.player_facing_direction[1] = 0.4 if self.player_facing_direction[0] > 0 else -0.4;
|
||||||
# same problem to long distance but in reverse, the ball can't reach to the player,
|
# same problem to long distance but in reverse, the ball can't reach to the player,
|
||||||
# its because player analog stick value is between 1 and -1,
|
# its because player analog stick value is between 1 and -1,
|
||||||
# and this value is low to shoot ball forward to Player if player is too far from the box.
|
# and this value is low to shoot ball forward to Player if player is too far from the box.
|
||||||
|
|
@ -431,151 +432,149 @@ class Box(ba.Actor):
|
||||||
# So many calculation according to how analog stick pushed by player.
|
# So many calculation according to how analog stick pushed by player.
|
||||||
# Horizontal(left-right) calculation
|
# Horizontal(left-right) calculation
|
||||||
if self.player_facing_direction[0] > 0.4:
|
if self.player_facing_direction[0] > 0.4:
|
||||||
self.player_facing_direction[0] = 1.5
|
self.player_facing_direction[0] = 1.5;
|
||||||
elif self.player_facing_direction[0] < -0.4:
|
elif self.player_facing_direction[0] < -0.4:
|
||||||
self.player_facing_direction[0] = -1.5
|
self.player_facing_direction[0] = -1.5;
|
||||||
else:
|
else:
|
||||||
if self.player_facing_direction[0] > 0.0:
|
if self.player_facing_direction[0] > 0.0:
|
||||||
self.player_facing_direction[0] = 0.2
|
self.player_facing_direction[0] = 0.2;
|
||||||
elif self.player_facing_direction[0] < 0.0:
|
elif self.player_facing_direction[0] < 0.0:
|
||||||
self.player_facing_direction[0] = -0.2
|
self.player_facing_direction[0] = -0.2;
|
||||||
else:
|
else:
|
||||||
self.player_facing_direction[0] = 0.0
|
self.player_facing_direction[0] = 0.0;
|
||||||
|
|
||||||
# Vertical(up-down) calculation.
|
# Vertical(up-down) calculation.
|
||||||
if self.player_facing_direction[1] > 0.4:
|
if self.player_facing_direction[1] > 0.4:
|
||||||
self.player_facing_direction[1] = 1.5
|
self.player_facing_direction[1] = 1.5;
|
||||||
elif self.player_facing_direction[1] < -0.4:
|
elif self.player_facing_direction[1] < -0.4:
|
||||||
self.player_facing_direction[1] = -1.5
|
self.player_facing_direction[1] = -1.5;
|
||||||
else:
|
else:
|
||||||
if self.player_facing_direction[1] > 0.0:
|
if self.player_facing_direction[1] > 0.0:
|
||||||
self.player_facing_direction[1] = 0.2
|
self.player_facing_direction[1] = 0.2;
|
||||||
elif self.player_facing_direction[1] < 0.0:
|
elif self.player_facing_direction[1] < 0.0:
|
||||||
self.player_facing_direction[1] = -0.2
|
self.player_facing_direction[1] = -0.2;
|
||||||
else:
|
else:
|
||||||
self.player_facing_direction[1] = -0.0
|
self.player_facing_direction[1] = -0.0;
|
||||||
|
|
||||||
# if we want stop the ball shootes
|
# if we want stop the ball shootes
|
||||||
def stop_shoot(self) -> NoReturn:
|
def stop_shoot(self) -> NoReturn:
|
||||||
# Kill the timer.
|
# Kill the timer.
|
||||||
self.shoot_timer = None
|
self.shoot_timer = None;
|
||||||
|
|
||||||
|
|
||||||
class Player(ba.Player['Team']):
|
class Player(bs.Player['Team']):
|
||||||
"""Our player type for this game."""
|
"""Our player type for this game."""
|
||||||
|
|
||||||
|
|
||||||
class Team(ba.Team[Player]):
|
class Team(bs.Team[Player]):
|
||||||
"""Our team type for this game."""
|
"""Our team type for this game."""
|
||||||
|
|
||||||
# almost 80 % for game we done in box class.
|
# almost 80 % for game we done in box class.
|
||||||
# now remain things, like name, seetings, scoring, cooldonw,
|
# now remain things, like name, seetings, scoring, cooldonw,
|
||||||
# and main thing don't allow player to camp inside of box are going in this class.
|
# and main thing don't allow player to camp inside of box are going in this class.
|
||||||
|
|
||||||
# ba_meta export game
|
# ba_meta export bascenev1.GameActivity
|
||||||
|
class DodgeTheBall(bs.TeamGameActivity[Player, Team]):
|
||||||
|
|
||||||
class DodgeTheBall(ba.TeamGameActivity[Player, Team]):
|
|
||||||
|
|
||||||
# defining name, description and settings..
|
# defining name, description and settings..
|
||||||
name = 'Dodge the ball'
|
name = 'Dodge the ball';
|
||||||
description = 'Survive from shooting balls'
|
description = 'Survive from shooting balls';
|
||||||
|
|
||||||
available_settings = [
|
available_settings = [
|
||||||
ba.IntSetting(
|
bs.IntSetting(
|
||||||
'Cooldown',
|
'Cooldown',
|
||||||
min_value = 20,
|
min_value = 20,
|
||||||
default = 45,
|
default = 45,
|
||||||
increment = 5,
|
increment = 5,
|
||||||
),
|
),
|
||||||
ba.BoolSetting('Epic Mode', default=False)
|
bs.BoolSetting('Epic Mode', default=False)
|
||||||
]
|
]
|
||||||
|
|
||||||
# Don't allow joining after we start.
|
# Don't allow joining after we start.
|
||||||
allow_mid_activity_joins = False
|
allow_mid_activity_joins = False;
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def supports_session_type(cls, sessiontype: type[ba.Session]) -> bool:
|
def supports_session_type(cls, sessiontype: type[bs.Session]) -> bool:
|
||||||
# We support team and ffa sessions.
|
# We support team and ffa sessions.
|
||||||
return issubclass(sessiontype, ba.FreeForAllSession) or issubclass(
|
return issubclass(sessiontype, bs.FreeForAllSession) or issubclass(
|
||||||
sessiontype, ba.DualTeamSession,
|
sessiontype, bs.DualTeamSession,
|
||||||
)
|
);
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_supported_maps(cls, sessiontype: type[ba.Session]) -> list[str]:
|
def get_supported_maps(cls, sessiontype: type[bs.Session]) -> list[str]:
|
||||||
# This Game mode need a flat and perfect shape map where can player fall outside map.
|
# This Game mode need a flat and perfect shape map where can player fall outside map.
|
||||||
# bombsquad have "Doom Shroom" map.
|
# bombsquad have "Doom Shroom" map.
|
||||||
# Not perfect map for this game mode but its fine for this gamemode.
|
# Not perfect map for this game mode but its fine for this gamemode.
|
||||||
# the problem is that Doom Shroom is not a perfect circle and not flat also.
|
# the problem is that Doom Shroom is not a perfect circle and not flat also.
|
||||||
return ['Doom Shroom']
|
return ['Doom Shroom'];
|
||||||
|
|
||||||
def __init__(self, settings: dict):
|
def __init__(self, settings: dict):
|
||||||
super().__init__(settings)
|
super().__init__(settings);
|
||||||
self._epic_mode = bool(settings['Epic Mode'])
|
self._epic_mode = bool(settings['Epic Mode']);
|
||||||
self.countdown_time = int(settings['Cooldown'])
|
self.countdown_time = int(settings['Cooldown']);
|
||||||
|
|
||||||
self.check_player_pos_timer: ba.Timer | None = None
|
self.check_player_pos_timer: bs.Timer | None = None;
|
||||||
self.shield_drop_timer: ba.Timer | None = None
|
self.shield_drop_timer: bs.Timer | None = None;
|
||||||
# cooldown and Box
|
# cooldown and Box
|
||||||
self._countdown: OnScreenCountdown | None = None
|
self._countdown: OnScreenCountdown | None = None;
|
||||||
self.box: Box | None = None
|
self.box: Box | None = None;
|
||||||
|
|
||||||
# this lists for scoring.
|
# this lists for scoring.
|
||||||
self.joined_player_list: list[ba.Player] = []
|
self.joined_player_list: list[bs.Player] = [];
|
||||||
self.dead_player_list: list[ba.Player] = []
|
self.dead_player_list: list[bs.Player] = [];
|
||||||
|
|
||||||
# normally play RUN AWAY music cause is match with our gamemode at.. my point,
|
# normally play RUN AWAY music cause is match with our gamemode at.. my point,
|
||||||
# but in epic switch to EPIC.
|
# but in epic switch to EPIC.
|
||||||
self.slow_motion = self._epic_mode
|
self.slow_motion = self._epic_mode;
|
||||||
self.default_music = (
|
self.default_music = (
|
||||||
ba.MusicType.EPIC if self._epic_mode else ba.MusicType.RUN_AWAY
|
bs.MusicType.EPIC if self._epic_mode else bs.MusicType.RUN_AWAY
|
||||||
)
|
);
|
||||||
|
|
||||||
def get_instance_description(self) -> str | Sequence:
|
def get_instance_description(self) -> str | Sequence:
|
||||||
return 'Keep away as possible as you can'
|
return 'Keep away as possible as you can';
|
||||||
|
|
||||||
# add a tiny text under our game name.
|
# add a tiny text under our game name.
|
||||||
def get_instance_description_short(self) -> str | Sequence:
|
def get_instance_description_short(self) -> str | Sequence:
|
||||||
return 'Dodge the shooting balls'
|
return 'Dodge the shooting balls';
|
||||||
|
|
||||||
def on_begin(self) -> NoReturn:
|
def on_begin(self) -> NoReturn:
|
||||||
super().on_begin()
|
super().on_begin();
|
||||||
|
|
||||||
# spawn our box at middle of the map
|
# spawn our box at middle of the map
|
||||||
self.box = Box(
|
self.box = Box(
|
||||||
position=(0.5, 2.7, -3.9),
|
position=(0.5, 2.7, -3.9),
|
||||||
velocity=(0.0, 0.0, 0.0),
|
velocity=(0.0, 0.0, 0.0),
|
||||||
).autoretain()
|
).autoretain();
|
||||||
|
|
||||||
# create our cooldown
|
# create our cooldown
|
||||||
self._countdown = OnScreenCountdown(
|
self._countdown = OnScreenCountdown(
|
||||||
duration = self.countdown_time,
|
duration = self.countdown_time,
|
||||||
endcall = self.play_victory_sound_and_end,
|
endcall = self.play_victory_sound_and_end,
|
||||||
)
|
);
|
||||||
|
|
||||||
# and starts the cooldown and shootes.
|
# and starts the cooldown and shootes.
|
||||||
ba.timer(5.0, self._countdown.start)
|
bs.timer(5.0, self._countdown.start);
|
||||||
ba.timer(5.0, self.box.start_shoot)
|
bs.timer(5.0, self.box.start_shoot);
|
||||||
|
|
||||||
# start checking all player pos.
|
# start checking all player pos.
|
||||||
ba.timer(5.0, self.check_player_pos)
|
bs.timer(5.0, self.check_player_pos);
|
||||||
|
|
||||||
# drop shield every ten Seconds
|
# drop shield every ten Seconds
|
||||||
# need five seconds delay Because shootes start after 5 seconds.
|
# need five seconds delay Because shootes start after 5 seconds.
|
||||||
ba.timer(15.0, self.drop_shield)
|
bs.timer(15.0, self.drop_shield);
|
||||||
|
|
||||||
# This function returns all alive players in game.
|
# This function returns all alive players in game.
|
||||||
# i thinck you see this function in Box class.
|
# i thinck you see this function in Box class.
|
||||||
def get_alive_players(self) -> Sequence[ba.Player]:
|
def get_alive_players(self) -> Sequence[bs.Player]:
|
||||||
|
|
||||||
alive_players = []
|
alive_players = [];
|
||||||
|
|
||||||
for team in self.teams:
|
for team in self.teams:
|
||||||
for player in team.players:
|
for player in team.players:
|
||||||
if player.is_alive():
|
if player.is_alive():
|
||||||
alive_players.append(player)
|
alive_players.append(player);
|
||||||
|
|
||||||
return alive_players
|
return alive_players;
|
||||||
|
|
||||||
# let's disallowed camping inside of box by doing a blast and increasing ball shoot speed.
|
# let's disallowed camping inside of box by doing a blast and increasing ball shoot speed.
|
||||||
def check_player_pos(self):
|
def check_player_pos(self):
|
||||||
|
|
@ -583,14 +582,14 @@ class DodgeTheBall(ba.TeamGameActivity[Player, Team]):
|
||||||
for player in self.get_alive_players():
|
for player in self.get_alive_players():
|
||||||
|
|
||||||
# same logic as applied for the ball
|
# same logic as applied for the ball
|
||||||
difference = ba.Vec3(player.position) - ba.Vec3(self.box.node.position)
|
difference = babase.Vec3(player.position) - babase.Vec3(self.box.node.position);
|
||||||
|
|
||||||
distance = difference.length()
|
distance = difference.length();
|
||||||
|
|
||||||
if distance < 3:
|
if distance < 3:
|
||||||
self.box.force_shoot_speed = 0.2
|
self.box.force_shoot_speed = 0.2;
|
||||||
else:
|
else:
|
||||||
self.box.force_shoot_speed = 0.0
|
self.box.force_shoot_speed = 0.0;
|
||||||
|
|
||||||
if distance < 0.5:
|
if distance < 0.5:
|
||||||
Blast(
|
Blast(
|
||||||
|
|
@ -598,7 +597,7 @@ class DodgeTheBall(ba.TeamGameActivity[Player, Team]):
|
||||||
velocity = self.box.node.velocity,
|
velocity = self.box.node.velocity,
|
||||||
blast_type = 'normal',
|
blast_type = 'normal',
|
||||||
blast_radius = 1.0,
|
blast_radius = 1.0,
|
||||||
).autoretain()
|
).autoretain();
|
||||||
|
|
||||||
PopupText(
|
PopupText(
|
||||||
position = self.box.node.position,
|
position = self.box.node.position,
|
||||||
|
|
@ -606,53 +605,53 @@ class DodgeTheBall(ba.TeamGameActivity[Player, Team]):
|
||||||
random_offset = 0.0,
|
random_offset = 0.0,
|
||||||
scale = 2.0,
|
scale = 2.0,
|
||||||
color = self.box.light.color,
|
color = self.box.light.color,
|
||||||
).autoretain()
|
).autoretain();
|
||||||
|
|
||||||
# create our timer and start looping it
|
# create our timer and start looping it
|
||||||
self.check_player_pos_timer = ba.Timer(0.1, self.check_player_pos)
|
self.check_player_pos_timer = bs.Timer(0.1, self.check_player_pos);
|
||||||
|
|
||||||
# drop useless shield's too give player temptation.
|
# drop useless shield's too give player temptation.
|
||||||
def drop_shield(self) -> NoReturn:
|
def drop_shield(self) -> NoReturn:
|
||||||
|
|
||||||
pos = self.box.node.position
|
pos = self.box.node.position;
|
||||||
|
|
||||||
PowerupBox(
|
PowerupBox(
|
||||||
position = (pos[0] + 4.0, pos[1] + 3.0, pos[2]),
|
position = (pos[0] + 4.0, pos[1] + 3.0, pos[2]),
|
||||||
poweruptype = 'shield',
|
poweruptype = 'shield',
|
||||||
).autoretain()
|
).autoretain();
|
||||||
|
|
||||||
PowerupBox(
|
PowerupBox(
|
||||||
position = (pos[0] - 4.0, pos[1] + 3.0, pos[2]),
|
position = (pos[0] - 4.0, pos[1] + 3.0, pos[2]),
|
||||||
poweruptype = 'shield',
|
poweruptype = 'shield',
|
||||||
).autoretain()
|
).autoretain();
|
||||||
|
|
||||||
self.shield_drop_timer = ba.Timer(10.0, self.drop_shield)
|
self.shield_drop_timer = bs.Timer(10.0, self.drop_shield);
|
||||||
|
|
||||||
# when cooldown time up i don't want that the game end immediately.
|
# when cooldown time up i don't want that the game end immediately.
|
||||||
def play_victory_sound_and_end(self) -> NoReturn:
|
def play_victory_sound_and_end(self) -> NoReturn:
|
||||||
|
|
||||||
# kill timers
|
# kill timers
|
||||||
self.box.stop_shoot()
|
self.box.stop_shoot();
|
||||||
self.check_player_pos_timer = None
|
self.check_player_pos_timer = None
|
||||||
self.shield_drop_timer = None
|
self.shield_drop_timer = None
|
||||||
|
|
||||||
ba.timer(2.0, self.end_game)
|
bs.timer(2.0, self.end_game);
|
||||||
|
|
||||||
# this function runs when A player spawn in map
|
# this function runs when A player spawn in map
|
||||||
def spawn_player(self, player: Player) -> NoReturn:
|
def spawn_player(self, player: Player) -> NoReturn:
|
||||||
spaz = self.spawn_player_spaz(player)
|
spaz = self.spawn_player_spaz(player);
|
||||||
|
|
||||||
# reconnect this player's controls.
|
# reconnect this player's controls.
|
||||||
# without bomb, punch and pickup.
|
# without bomb, punch and pickup.
|
||||||
spaz.connect_controls_to_player(
|
spaz.connect_controls_to_player(
|
||||||
enable_punch=False, enable_bomb=False, enable_pickup=False,
|
enable_punch=False, enable_bomb=False, enable_pickup=False,
|
||||||
)
|
);
|
||||||
|
|
||||||
# storing all players for ScorinG.
|
# storing all players for ScorinG.
|
||||||
self.joined_player_list.append(player)
|
self.joined_player_list.append(player);
|
||||||
|
|
||||||
# Also lets have them make some noise when they die.
|
# Also lets have them make some noise when they die.
|
||||||
spaz.play_big_death_sound = True
|
spaz.play_big_death_sound = True;
|
||||||
|
|
||||||
# very helpful function to check end game when player dead or leav.
|
# very helpful function to check end game when player dead or leav.
|
||||||
def _check_end_game(self) -> bool:
|
def _check_end_game(self) -> bool:
|
||||||
|
|
@ -674,24 +673,24 @@ class DodgeTheBall(ba.TeamGameActivity[Player, Team]):
|
||||||
# this function called when player leave.
|
# this function called when player leave.
|
||||||
def on_player_leave(self, player: Player) -> NoReturn:
|
def on_player_leave(self, player: Player) -> NoReturn:
|
||||||
# Augment default behavior.
|
# Augment default behavior.
|
||||||
super().on_player_leave(player)
|
super().on_player_leave(player);
|
||||||
|
|
||||||
# checking end game.
|
# checking end game.
|
||||||
self._check_end_game()
|
self._check_end_game();
|
||||||
|
|
||||||
# this gamemode needs to handle only one msg "PlayerDiedMessage".
|
# this gamemode needs to handle only one msg "PlayerDiedMessage".
|
||||||
def handlemessage(self, msg: Any) -> Any:
|
def handlemessage(self, msg: Any) -> Any:
|
||||||
|
|
||||||
if isinstance(msg, ba.PlayerDiedMessage):
|
if isinstance(msg, bs.PlayerDiedMessage):
|
||||||
|
|
||||||
# Augment standard behavior.
|
# Augment standard behavior.
|
||||||
super().handlemessage(msg)
|
super().handlemessage(msg);
|
||||||
|
|
||||||
# and storing the dead player records in our dead_player_list.
|
# and storing the dead player records in our dead_player_list.
|
||||||
self.dead_player_list.append(msg.getplayer(Player))
|
self.dead_player_list.append(msg.getplayer(Player));
|
||||||
|
|
||||||
# check the end game.
|
# check the end game.
|
||||||
ba.timer(1.0, self._check_end_game)
|
bs.timer(1.0, self._check_end_game);
|
||||||
|
|
||||||
def end_game(self):
|
def end_game(self):
|
||||||
# kill timers
|
# kill timers
|
||||||
|
|
@ -736,7 +735,7 @@ class DodgeTheBall(ba.TeamGameActivity[Player, Team]):
|
||||||
|
|
||||||
# Ok now calc game results: set a score for each team and then tell \
|
# Ok now calc game results: set a score for each team and then tell \
|
||||||
# the game to end.
|
# the game to end.
|
||||||
results = ba.GameResults()
|
results = bs.GameResults()
|
||||||
|
|
||||||
# Remember that 'free-for-all' mode is simply a special form \
|
# Remember that 'free-for-all' mode is simply a special form \
|
||||||
# of 'teams' mode where each player gets their own team, so we can \
|
# of 'teams' mode where each player gets their own team, so we can \
|
||||||
|
|
@ -763,3 +762,5 @@ class DodgeTheBall(ba.TeamGameActivity[Player, Team]):
|
||||||
results.set_team_score(team, int(10 * max_index))
|
results.set_team_score(team, int(10 * max_index))
|
||||||
# and end the game
|
# and end the game
|
||||||
self.end(results=results)
|
self.end(results=results)
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue