Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Personal Website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TheJoeCoder
Personal Website
Commits
d6d384ae
Verified
Commit
d6d384ae
authored
11 months ago
by
TheJoeCoder
Browse files
Options
Downloads
Patches
Plain Diff
Add velocity debug
parent
fa39a373
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
static/js/background_anim.js
+16
-0
16 additions, 0 deletions
static/js/background_anim.js
with
16 additions
and
0 deletions
static/js/background_anim.js
+
16
−
0
View file @
d6d384ae
...
...
@@ -17,6 +17,8 @@ const LINE_COLOUR = "#777";
const
VELOCITY_SLOWDOWN_MULTIPLIER
=
0.998
;
const
VELOCITY_PUSH_MULTIPLIER
=
1.8
;
const
SHOW_VELOCITIES
=
true
;
// ----
// Sort-of constants (change with window size)
...
...
@@ -188,6 +190,15 @@ const drawConnectingLines = () => {
ctx
.
closePath
();
};
const
drawDebugText
=
()
=>
{
for
(
let
dot
of
dots
)
{
ctx
.
beginPath
();
ctx
.
font
=
"
15px Arial
"
;
ctx
.
fillText
(
`
${
dot
.
vx
}
/
${
dot
.
vy
}
`
,
dot
.
x
,
dot
.
y
);
ctx
.
closePath
();
}
};
const
draw
=
()
=>
{
// Clear the screen
ctx
.
clearRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
);
...
...
@@ -201,6 +212,11 @@ const draw = () => {
// Draw connecting lines
drawConnectingLines
();
// Draw velocity text
if
(
SHOW_VELOCITIES
)
{
drawDebugText
();
}
};
const
physics
=
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment