Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webTAS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Florent Becker
webTAS
Commits
a0f25afd
Commit
a0f25afd
authored
Aug 26, 2021
by
Daniel Hader
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slight parameter tweaks
parent
ee276548
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
tile.js
tile.js
+8
-5
No files found.
tile.js
View file @
a0f25afd
...
...
@@ -16,10 +16,10 @@ class TileType {
const
bitmap
=
document
.
createElement
(
'canvas'
);
const
ctx
=
bitmap
.
getContext
(
'2d'
);
const
TEX_SIZE
=
512
;
const
TEX_SIZE
=
256
;
const
LINE_DASH
=
[
5
*
TEX_SIZE
/
100
,
3
*
TEX_SIZE
/
100
];
const
NAME_SIZE
=
TEX_SIZE
/
10
const
LABEL_SIZE
=
TEX_SIZE
/
6
;
const
LABEL_SIZE
=
TEX_SIZE
/
5
;
const
GLUE_SIZE
=
TEX_SIZE
/
10
;
const
GLUE_OFFSET
=
TEX_SIZE
/
5
;
...
...
@@ -33,10 +33,10 @@ class TileType {
ctx
.
textAlign
=
'center'
;
ctx
.
font
=
`
${
LABEL_SIZE
}
px Arial`
;
ctx
.
fillText
(
label
,
TEX_SIZE
/
2
,
TEX_SIZE
/
2
);
ctx
.
fillText
(
label
,
TEX_SIZE
/
2
,
4
*
TEX_SIZE
/
7
);
ctx
.
font
=
`
${
NAME_SIZE
}
px Arial`
;
ctx
.
fillText
(
name
,
TEX_SIZE
/
2
,
3
*
TEX_SIZE
/
5
);
ctx
.
fillText
(
name
,
TEX_SIZE
/
2
,
5
*
TEX_SIZE
/
7
);
ctx
.
strokeStyle
=
'black'
;
ctx
.
font
=
`
${
GLUE_SIZE
}
px Arial`
;
...
...
@@ -101,6 +101,7 @@ class System {
this
.
temperature
=
temperature
;
this
.
tile_types
=
tile_types
;
this
.
tiles
=
[];
this
.
grid
=
new
Map
();
this
.
frontier
=
new
Map
();
this
.
fitting_tiles
=
new
Map
();
...
...
@@ -131,6 +132,8 @@ class System {
const
tile
=
new
Tile
(
this
.
tile_types
[
type_index
],
x
,
y
);
if
(
seed
)
this
.
seed
.
push
(
tile
);
else
this
.
history
.
push
(
tile
);
this
.
tiles
.
push
(
tile
);
this
.
grid
.
set
(
coord
,
type_index
);
this
.
removeFrontier
(
x
,
y
);
...
...
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