Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
js13k2024
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
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bye
js13k2024
Commits
ee4ead95
Commit
ee4ead95
authored
10 months ago
by
Bye
Browse files
Options
Downloads
Patches
Plain Diff
basic setup
parent
527beaf3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
index.html
+8
-0
8 additions, 0 deletions
index.html
src/main.js
+22
-0
22 additions, 0 deletions
src/main.js
with
30 additions
and
0 deletions
index.html
0 → 100644
+
8
−
0
View file @
ee4ead95
<style>
canvas
{
width
:
100vw
;
height
:
100vh
}
body
{
margin
:
0
}
</style>
<canvas
id=
"canvas"
>
This browser requires the
<code>
<
canvas
>
</code>
element to work
</canvas>
<script
src=
"./src/main.js"
type=
"module"
></script>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main.js
0 → 100644
+
22
−
0
View file @
ee4ead95
import
Canvas
from
"
../hampsterengine/src/canvas.js
"
;
import
Engine
from
"
../hampsterengine/src/engine.js
"
;
const
canvas
=
new
Canvas
(
'
canvas
'
);
const
engine
=
new
Engine
(
canvas
);
function
main
()
{
requestAnimationFrame
(
main
);
canvas
.
updateCanvasSize
();
}
function
load
()
{
if
(
engine
.
loading
)
{
engine
.
loadLoop
();
setTimeout
(
load
,
1000
/
60
);
}
else
{
main
();
}
}
load
();
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