Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Jochen Bauer
spn-website
Commits
653ab2f2
Commit
653ab2f2
authored
May 11, 2018
by
Hubert Denkmair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
different tv views
parent
bd7c06f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
visualization/static/visualization/Game.js
visualization/static/visualization/Game.js
+1
-0
visualization/templates/visualization/tv.html
visualization/templates/visualization/tv.html
+25
-0
No files found.
visualization/static/visualization/Game.js
View file @
653ab2f2
...
...
@@ -168,6 +168,7 @@ Game.prototype.HandleBotStatsMessage = function(data)
arr
.
push
(
data
[
id
]);
}
arr
.
sort
(
function
(
a
,
b
)
{
return
b
.
m
-
a
.
m
;
});
this
.
stats
=
arr
;
for
(
let
d
of
arr
.
slice
(
0
,
20
))
{
let
snake
=
this
.
vis
.
GetSnake
(
d
.
id
);
...
...
visualization/templates/visualization/tv.html
View file @
653ab2f2
...
...
@@ -46,5 +46,30 @@
{
game
.
vis
.
Resize
();
};
let
currentView
=
0
;
window
.
setInterval
(
function
()
{
currentView
=
(
currentView
+
1
)
%
10
;
if
(
currentView
==
0
)
{
game
.
vis
.
Unfollow
();
let
vp
=
game
.
vis
.
viewport
;
let
scale
=
vp
.
_screenWidth
/
game
.
vis
.
world_size_x
;
vp
.
scale
.
x
=
scale
;
vp
.
scale
.
y
=
scale
;
vp
.
position
.
set
(
0
,
0
);
}
else
if
(
currentView
>
5
)
{
let
index
=
currentView
-
5
;
if
(
game
.
stats
&&
(
game
.
stats
.
length
>
index
))
{
let
snake_id
=
game
.
stats
[
index
].
id
;
let
snake
=
game
.
vis
.
GetSnake
(
snake_id
);
game
.
vis
.
FollowName
(
snake
.
GetName
(),
true
);
}
}
},
3000
);
</script>
{% endblock %}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment