Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
Taiko Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Taiko Web
Commits
e1b8b45d
Commit
e1b8b45d
authored
Oct 06, 2018
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change drum to match Switch, add fullscreen to songsel, fix tutorial
parent
57632a83
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
120 additions
and
174 deletions
+120
-174
public/index.html
public/index.html
+3
-2
public/src/css/game.css
public/src/css/game.css
+7
-24
public/src/css/main.css
public/src/css/main.css
+11
-1
public/src/js/assets.js
public/src/js/assets.js
+0
-2
public/src/js/controller.js
public/src/js/controller.js
+1
-1
public/src/js/loader.js
public/src/js/loader.js
+3
-7
public/src/js/main.js
public/src/js/main.js
+29
-0
public/src/js/scoresheet.js
public/src/js/scoresheet.js
+6
-3
public/src/js/songselect.js
public/src/js/songselect.js
+13
-1
public/src/js/titlescreen.js
public/src/js/titlescreen.js
+6
-2
public/src/js/tutorial.js
public/src/js/tutorial.js
+11
-3
public/src/js/view.js
public/src/js/view.js
+27
-123
public/src/views/game.html
public/src/views/game.html
+2
-5
public/src/views/songselect.html
public/src/views/songselect.html
+1
-0
No files found.
public/index.html
View file @
e1b8b45d
...
@@ -47,11 +47,12 @@
...
@@ -47,11 +47,12 @@
<script
src=
"/src/js/viewassets.js"
></script>
<script
src=
"/src/js/viewassets.js"
></script>
<script
src=
"/src/js/gamerules.js"
></script>
<script
src=
"/src/js/gamerules.js"
></script>
<script
src=
"/src/js/canvasdraw.js"
></script>
<script
src=
"/src/js/canvasdraw.js"
></script>
<script
src=
"/src/js/loader.js"
></script>
</head>
</head>
<body>
<body>
<div
id=
"assets"
></div>
<div
id=
"assets"
></div>
<div
id=
"screen"
></div>
<div
id=
"screen"
></div>
<script
src=
"/src/js/
loader
.js"
></script>
<script
src=
"/src/js/
main
.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
public/src/css/game.css
View file @
e1b8b45d
...
@@ -51,50 +51,33 @@
...
@@ -51,50 +51,33 @@
pointer-events
:
none
;
pointer-events
:
none
;
z-index
:
1
;
z-index
:
1
;
}
}
#touch-
bg
{
#touch-
drum
{
display
:
none
;
display
:
none
;
position
:
absolute
;
position
:
absolute
;
right
:
0
;
right
:
0
;
bottom
:
0
;
bottom
:
0
;
left
:
0
;
left
:
0
;
width
:
50%
;
height
:
50%
;
height
:
50%
;
background
:
url(/assets/img/touch_bg.png)
center
bottom
;
background-size
:
cover
;
overflow
:
hidden
;
}
#touch-bg-blue
{
position
:
absolute
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
background
:
url(/assets/img/touch_bg_blue.png)
center
bottom
;
background-size
:
cover
;
opacity
:
0
;
}
#touch-drum
{
position
:
absolute
;
right
:
0
;
bottom
:
0
;
left
:
0
;
text-align
:
center
;
text-align
:
center
;
margin
:
auto
;
margin
:
auto
;
}
}
#touch-drum
img
{
#touch-drum
-
img
{
width
:
100%
;
width
:
100%
;
}
}
#touch-buttons
{
#touch-buttons
{
display
:
none
;
display
:
none
;
position
:
absolute
;
position
:
absolute
;
top
:
7
vh
;
top
:
6.5
vh
;
right
:
2vh
;
right
:
2vh
;
opacity
:
0.5
;
opacity
:
0.5
;
z-index
:
5
;
z-index
:
5
;
}
}
#touch-buttons
img
{
#touch-buttons
img
{
width
:
12vh
;
width
:
12.5vmin
;
height
:
12.5vmin
;
}
}
.touch-visible
#touch-
bg
,
.touch-visible
#touch-
drum
,
.touch-visible
#touch-buttons
{
.touch-visible
#touch-buttons
{
display
:
block
;
display
:
block
;
}
}
...
...
public/src/css/main.css
View file @
e1b8b45d
...
@@ -137,8 +137,9 @@ body{
...
@@ -137,8 +137,9 @@ body{
border
:
5px
black
solid
;
border
:
5px
black
solid
;
border-radius
:
10px
;
border-radius
:
10px
;
height
:
65%
;
height
:
65%
;
width
:
50%
;
max-width
:
800px
;
padding
:
20px
;
padding
:
20px
;
margin
:
8px
;
font-size
:
16pt
;
font-size
:
16pt
;
position
:
relative
;
position
:
relative
;
}
}
...
@@ -214,3 +215,12 @@ kbd{
...
@@ -214,3 +215,12 @@ kbd{
left
:
0
;
left
:
0
;
margin
:
auto
;
margin
:
auto
;
}
}
#song-select
#touch-full-btn
{
display
:
none
;
position
:
absolute
;
top
:
0
;
right
:
0
;
width
:
12.5vmin
;
height
:
12.5vmin
;
opacity
:
0.5
;
}
public/src/js/assets.js
View file @
e1b8b45d
...
@@ -40,8 +40,6 @@ var assets = {
...
@@ -40,8 +40,6 @@ var assets = {
"
bg_score_p1.png
"
,
"
bg_score_p1.png
"
,
"
bg_score_p2.png
"
,
"
bg_score_p2.png
"
,
"
badge_auto.png
"
,
"
badge_auto.png
"
,
"
touch_bg.png
"
,
"
touch_bg_blue.png
"
,
"
touch_drum.png
"
,
"
touch_drum.png
"
,
"
touch_pause.png
"
,
"
touch_pause.png
"
,
"
touch_fullscreen.png
"
"
touch_fullscreen.png
"
...
...
public/src/js/controller.js
View file @
e1b8b45d
...
@@ -131,7 +131,7 @@ class Controller{
...
@@ -131,7 +131,7 @@ class Controller{
if
(
!
fadeIn
){
if
(
!
fadeIn
){
this
.
clean
()
this
.
clean
()
}
}
new
SongSelect
(
false
,
fadeIn
)
new
SongSelect
(
false
,
fadeIn
,
this
.
touchEnabled
)
}
}
restartSong
(){
restartSong
(){
this
.
clean
()
this
.
clean
()
...
...
public/src/js/loader.js
View file @
e1b8b45d
class
Loader
{
class
Loader
{
constructor
(){
constructor
(
callback
){
this
.
callback
=
callback
this
.
loadedAssets
=
0
this
.
loadedAssets
=
0
this
.
assetsDiv
=
document
.
getElementById
(
"
assets
"
)
this
.
assetsDiv
=
document
.
getElementById
(
"
assets
"
)
this
.
ajax
(
"
src/views/loader.html
"
).
then
(
this
.
run
.
bind
(
this
))
this
.
ajax
(
"
src/views/loader.html
"
).
then
(
this
.
run
.
bind
(
this
))
...
@@ -83,7 +84,7 @@ class Loader{
...
@@ -83,7 +84,7 @@ class Loader{
Promise
.
all
(
this
.
promises
).
then
(()
=>
{
Promise
.
all
(
this
.
promises
).
then
(()
=>
{
this
.
clean
()
this
.
clean
()
new
Titlescreen
()
this
.
callback
()
},
this
.
errorMsg
.
bind
(
this
))
},
this
.
errorMsg
.
bind
(
this
))
}
}
loadSound
(
name
,
gain
){
loadSound
(
name
,
gain
){
...
@@ -132,8 +133,3 @@ class Loader{
...
@@ -132,8 +133,3 @@ class Loader{
delete
this
.
promises
delete
this
.
promises
}
}
}
}
var
pageEvents
=
new
PageEvents
()
var
loader
=
new
Loader
()
var
snd
=
{}
var
p2
public/src/js/main.js
0 → 100644
View file @
e1b8b45d
function
toggleFullscreen
(){
var
root
=
document
.
documentElement
if
(
"
requestFullscreen
"
in
root
){
if
(
document
.
fullscreenElement
){
document
.
exitFullscreen
()
}
else
{
root
.
requestFullscreen
()
}
}
else
if
(
"
webkitRequestFullscreen
"
in
root
){
if
(
document
.
webkitFullscreenElement
){
document
.
webkitExitFullscreen
()
}
else
{
root
.
webkitRequestFullscreen
()
}
}
else
if
(
"
mozRequestFullScreen
"
in
root
){
if
(
document
.
mozFullScreenElement
){
document
.
mozCancelFullScreen
()
}
else
{
root
.
mozRequestFullScreen
()
}
}
}
var
pageEvents
=
new
PageEvents
()
var
snd
=
{}
var
p2
var
loader
=
new
Loader
(()
=>
{
new
Titlescreen
()
})
public/src/js/scoresheet.js
View file @
e1b8b45d
...
@@ -58,8 +58,11 @@ class Scoresheet{
...
@@ -58,8 +58,11 @@ class Scoresheet{
event
.
preventDefault
()
event
.
preventDefault
()
this
.
canvas
.
style
.
cursor
=
""
this
.
canvas
.
style
.
cursor
=
""
this
.
state
.
pointerLocked
=
true
this
.
state
.
pointerLocked
=
true
}
else
if
(
event
.
which
!==
1
){
}
else
{
return
this
.
state
.
pointerLocked
=
false
if
(
event
.
which
!==
1
){
return
}
}
}
this
.
toNext
()
this
.
toNext
()
}
}
...
@@ -600,7 +603,7 @@ class Scoresheet{
...
@@ -600,7 +603,7 @@ class Scoresheet{
if
(
elapsed
>=
1000
){
if
(
elapsed
>=
1000
){
this
.
clean
()
this
.
clean
()
this
.
controller
.
songSelection
(
true
)
this
.
controller
.
songSelection
(
true
,
false
,
this
.
state
.
pointerLocked
)
}
}
}
}
...
...
public/src/js/songselect.js
View file @
e1b8b45d
class
SongSelect
{
class
SongSelect
{
constructor
(
fromTutorial
,
fadeIn
){
constructor
(
fromTutorial
,
fadeIn
,
touchEnabled
){
this
.
touchEnabled
=
touchEnabled
loader
.
changePage
(
"
songselect
"
)
loader
.
changePage
(
"
songselect
"
)
this
.
canvas
=
document
.
getElementById
(
"
song-sel-canvas
"
)
this
.
canvas
=
document
.
getElementById
(
"
song-sel-canvas
"
)
this
.
ctx
=
this
.
canvas
.
getContext
(
"
2d
"
)
this
.
ctx
=
this
.
canvas
.
getContext
(
"
2d
"
)
...
@@ -198,6 +200,11 @@ class SongSelect{
...
@@ -198,6 +200,11 @@ class SongSelect{
pageEvents
.
add
(
this
.
canvas
,
"
mousemove
"
,
this
.
mouseMove
.
bind
(
this
))
pageEvents
.
add
(
this
.
canvas
,
"
mousemove
"
,
this
.
mouseMove
.
bind
(
this
))
pageEvents
.
add
(
this
.
canvas
,
"
mousedown
"
,
this
.
mouseDown
.
bind
(
this
))
pageEvents
.
add
(
this
.
canvas
,
"
mousedown
"
,
this
.
mouseDown
.
bind
(
this
))
pageEvents
.
add
(
this
.
canvas
,
"
touchstart
"
,
this
.
mouseDown
.
bind
(
this
))
pageEvents
.
add
(
this
.
canvas
,
"
touchstart
"
,
this
.
mouseDown
.
bind
(
this
))
if
(
touchEnabled
){
this
.
touchFullBtn
=
document
.
getElementById
(
"
touch-full-btn
"
)
this
.
touchFullBtn
.
style
.
display
=
"
block
"
pageEvents
.
add
(
this
.
touchFullBtn
,
"
click
"
,
toggleFullscreen
)
}
}
}
keyDown
(
event
,
code
){
keyDown
(
event
,
code
){
...
@@ -1135,6 +1142,11 @@ class SongSelect{
...
@@ -1135,6 +1142,11 @@ class SongSelect{
pageEvents
.
keyRemove
(
this
,
"
all
"
)
pageEvents
.
keyRemove
(
this
,
"
all
"
)
pageEvents
.
remove
(
this
.
canvas
,
"
mousemove
"
)
pageEvents
.
remove
(
this
.
canvas
,
"
mousemove
"
)
pageEvents
.
remove
(
this
.
canvas
,
"
mousedown
"
)
pageEvents
.
remove
(
this
.
canvas
,
"
mousedown
"
)
pageEvents
.
remove
(
this
.
canvas
,
"
touchstart
"
)
if
(
this
.
touchEnabled
){
pageEvents
.
remove
(
this
.
touchFullBtn
,
"
click
"
)
delete
this
.
touchFullBtn
}
delete
this
.
ctx
delete
this
.
ctx
delete
this
.
canvas
delete
this
.
canvas
}
}
...
...
public/src/js/titlescreen.js
View file @
e1b8b45d
...
@@ -15,7 +15,11 @@ class Titlescreen{
...
@@ -15,7 +15,11 @@ class Titlescreen{
}
}
})
})
}
}
onPressed
(){
onPressed
(
event
){
if
(
event
&&
event
.
type
===
"
touchstart
"
){
event
.
preventDefault
()
this
.
touched
=
true
}
this
.
titleScreen
.
style
.
cursor
=
"
auto
"
this
.
titleScreen
.
style
.
cursor
=
"
auto
"
this
.
clean
()
this
.
clean
()
assets
.
sounds
[
"
don
"
].
play
()
assets
.
sounds
[
"
don
"
].
play
()
...
@@ -25,7 +29,7 @@ class Titlescreen{
...
@@ -25,7 +29,7 @@ class Titlescreen{
if
(
localStorage
.
getItem
(
"
tutorial
"
)
!==
"
true
"
){
if
(
localStorage
.
getItem
(
"
tutorial
"
)
!==
"
true
"
){
new
Tutorial
()
new
Tutorial
()
}
else
{
}
else
{
new
SongSelect
()
new
SongSelect
(
false
,
false
,
this
.
touched
)
}
}
}
}
clean
(){
clean
(){
...
...
public/src/js/tutorial.js
View file @
e1b8b45d
...
@@ -4,18 +4,26 @@ class Tutorial{
...
@@ -4,18 +4,26 @@ class Tutorial{
loader
.
changePage
(
"
tutorial
"
)
loader
.
changePage
(
"
tutorial
"
)
assets
.
sounds
[
"
bgm_setsume
"
].
playLoop
(
0.1
,
false
,
0
,
1.054
,
16.054
)
assets
.
sounds
[
"
bgm_setsume
"
].
playLoop
(
0.1
,
false
,
0
,
1.054
,
16.054
)
this
.
endButton
=
document
.
getElementById
(
"
tutorial-end-button
"
)
this
.
endButton
=
document
.
getElementById
(
"
tutorial-end-button
"
)
pageEvents
.
once
(
this
.
endButton
,
"
click
"
).
then
(
this
.
onEnd
.
bind
(
this
))
pageEvents
.
once
(
this
.
endButton
,
"
mousedown
"
).
then
(
this
.
onEnd
.
bind
(
this
))
pageEvents
.
once
(
this
.
endButton
,
"
touchstart
"
).
then
(
this
.
onEnd
.
bind
(
this
))
pageEvents
.
keyOnce
(
this
,
13
,
"
down
"
).
then
(
this
.
onEnd
.
bind
(
this
))
pageEvents
.
keyOnce
(
this
,
13
,
"
down
"
).
then
(
this
.
onEnd
.
bind
(
this
))
this
.
gamepad
=
new
Gamepad
({
this
.
gamepad
=
new
Gamepad
({
"
confirm
"
:
[
"
start
"
,
"
b
"
]
"
confirm
"
:
[
"
start
"
,
"
b
"
]
},
this
.
onEnd
.
bind
(
this
))
},
this
.
onEnd
.
bind
(
this
))
}
}
onEnd
(){
onEnd
(
event
){
var
touched
=
false
if
(
event
&&
event
.
type
===
"
touchstart
"
){
event
.
preventDefault
()
touched
=
true
}
this
.
clean
()
this
.
clean
()
assets
.
sounds
[
"
don
"
].
play
()
assets
.
sounds
[
"
don
"
].
play
()
localStorage
.
setItem
(
"
tutorial
"
,
"
true
"
)
localStorage
.
setItem
(
"
tutorial
"
,
"
true
"
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
new
SongSelect
(
this
.
fromSongSel
)
new
SongSelect
(
this
.
fromSongSel
,
false
,
touched
)
},
500
)
},
500
)
}
}
clean
(){
clean
(){
...
...
public/src/js/view.js
View file @
e1b8b45d
...
@@ -51,32 +51,19 @@ class View{
...
@@ -51,32 +51,19 @@ class View{
this
.
beatInterval
=
this
.
controller
.
getSongData
().
beatInfo
.
beatInterval
this
.
beatInterval
=
this
.
controller
.
getSongData
().
beatInfo
.
beatInterval
this
.
assets
=
new
ViewAssets
(
this
)
this
.
assets
=
new
ViewAssets
(
this
)
this
.
touch
=
{
this
.
touch
=
-
Infinity
don_l
:
-
Infinity
,
don_r
:
-
Infinity
,
don_c
:
-
Infinity
,
ka_l
:
-
Infinity
,
ka_r
:
-
Infinity
,
ka_c
:
-
Infinity
,
cursor
:
{
ms
:
-
Infinity
,
x
:
0
,
y
:
0
}
}
if
(
this
.
controller
.
touchEnabled
){
if
(
this
.
controller
.
touchEnabled
){
this
.
touchEnabled
=
true
this
.
touchEnabled
=
true
this
.
touchBgDiv
=
document
.
getElementById
(
"
touch-bg
"
)
this
.
touchBgBlueDiv
=
document
.
getElementById
(
"
touch-bg-blue
"
)
this
.
touchDrumDiv
=
document
.
getElementById
(
"
touch-drum
"
)
this
.
touchDrumDiv
=
document
.
getElementById
(
"
touch-drum
"
)
this
.
touchDrumImg
=
document
.
getElementById
(
"
touch-drum-img
"
)
this
.
gameDiv
.
classList
.
add
(
"
touch-visible
"
)
this
.
gameDiv
.
classList
.
add
(
"
touch-visible
"
)
pageEvents
.
add
(
this
.
canvas
.
canvas
,
"
touchstart
"
,
this
.
ontouch
.
bind
(
this
))
pageEvents
.
add
(
this
.
canvas
.
canvas
,
"
touchstart
"
,
this
.
ontouch
.
bind
(
this
))
this
.
touchFullBtn
=
document
.
getElementById
(
"
touch-full-btn
"
)
this
.
touchFullBtn
=
document
.
getElementById
(
"
touch-full-btn
"
)
pageEvents
.
add
(
this
.
touchFullBtn
,
"
click
"
,
t
his
.
t
oggleFullscreen
)
pageEvents
.
add
(
this
.
touchFullBtn
,
"
click
"
,
toggleFullscreen
)
this
.
touchPauseBtn
=
document
.
getElementById
(
"
touch-pause-btn
"
)
this
.
touchPauseBtn
=
document
.
getElementById
(
"
touch-pause-btn
"
)
pageEvents
.
add
(
this
.
touchPauseBtn
,
"
click
"
,
()
=>
{
pageEvents
.
add
(
this
.
touchPauseBtn
,
"
click
"
,
()
=>
{
...
@@ -189,13 +176,11 @@ class View{
...
@@ -189,13 +176,11 @@ class View{
}
}
})()
})()
this
.
touchCircle
=
(()
=>
{
this
.
touchCircle
=
(()
=>
{
var
padTop
=
this
.
touchDrum
.
h
*
0.062
var
padLeft
=
this
.
touchDrum
.
h
*
0.05
return
{
return
{
x
:
this
.
winW
/
2
,
x
:
this
.
winW
/
2
,
y
:
this
.
winH
+
padTop
,
y
:
this
.
winH
+
this
.
touchDrum
.
h
*
0.1
,
rx
:
this
.
touchDrum
.
w
/
2
-
padLeft
*
2
,
rx
:
this
.
touchDrum
.
w
/
2
-
this
.
touchDrum
.
h
*
0.03
,
ry
:
this
.
touchDrum
.
h
ry
:
this
.
touchDrum
.
h
*
1.07
}
}
})()
})()
}
}
...
@@ -880,13 +865,7 @@ class View{
...
@@ -880,13 +865,7 @@ class View{
drawTouch
(){
drawTouch
(){
if
(
this
.
touchEnabled
){
if
(
this
.
touchEnabled
){
var
ms
=
this
.
controller
.
getElapsedTime
()
var
ms
=
this
.
controller
.
getElapsedTime
()
this
.
ctx
.
save
()
var
bgHeight
=
(
this
.
winH
-
(
this
.
barY
+
this
.
barH
+
5
))
/
this
.
canvas
.
scale
if
(
bgHeight
!==
this
.
touchBgHeight
){
this
.
touchBgHeight
=
bgHeight
this
.
touchBgDiv
.
style
.
height
=
bgHeight
+
"
px
"
}
var
drumWidth
=
this
.
touchDrum
.
w
/
this
.
canvas
.
scale
var
drumWidth
=
this
.
touchDrum
.
w
/
this
.
canvas
.
scale
var
drumHeight
=
this
.
touchDrum
.
h
/
this
.
canvas
.
scale
var
drumHeight
=
this
.
touchDrum
.
h
/
this
.
canvas
.
scale
if
(
drumHeight
!==
this
.
touchDrumHeight
||
drumWidth
!==
this
.
touchDrumWidth
){
if
(
drumHeight
!==
this
.
touchDrumHeight
||
drumWidth
!==
this
.
touchDrumWidth
){
...
@@ -895,41 +874,15 @@ class View{
...
@@ -895,41 +874,15 @@ class View{
this
.
touchDrumDiv
.
style
.
width
=
drumWidth
+
"
px
"
this
.
touchDrumDiv
.
style
.
width
=
drumWidth
+
"
px
"
this
.
touchDrumDiv
.
style
.
height
=
drumHeight
+
"
px
"
this
.
touchDrumDiv
.
style
.
height
=
drumHeight
+
"
px
"
}
}
if
(
this
.
touch
>
ms
-
150
){
var
lastKa
=
this
.
touch
.
ka_l
>
this
.
touch
.
ka_r
?
this
.
touch
.
ka_l
:
this
.
touch
.
ka_r
if
(
!
this
.
drumPadding
){
if
(
ms
<
lastKa
+
150
){
this
.
drumPadding
=
true
if
(
!
this
.
blueBgShown
){
this
.
touchDrumImg
.
style
.
paddingTop
=
"
1%
"
this
.
blueBgShown
=
true
this
.
touchBgBlueDiv
.
style
.
opacity
=
0.5
}
}
}
else
if
(
this
.
blueBgShown
){
}
else
if
(
this
.
drumPadding
){
this
.
blueBgShown
=
false
this
.
drumPadding
=
false
this
.
touchBgBlueDiv
.
style
.
opacity
=
0
this
.
touchDrumImg
.
style
.
paddingTop
=
""
}
var
c
=
this
.
touchCircle
var
pi
=
Math
.
PI
var
lastDon
=
this
.
touch
.
don_l
>
this
.
touch
.
don_r
?
this
.
touch
.
don_l
:
this
.
touch
.
don_r
if
(
lastDon
>
ms
-
150
){
this
.
ctx
.
fillStyle
=
"
rgba(239, 86, 51, 0.5)
"
this
.
ctx
.
beginPath
()
this
.
ctx
.
ellipse
(
c
.
x
,
c
.
y
,
c
.
rx
*
0.9
,
c
.
ry
*
0.9
,
0
,
pi
,
0
)
this
.
ctx
.
fill
()
}
if
(
this
.
touch
.
don_c
>
ms
-
150
){
this
.
ctx
.
beginPath
()
this
.
ctx
.
ellipse
(
c
.
x
,
c
.
y
,
c
.
rx
*
0.6
,
c
.
ry
*
0.6
,
0
,
pi
,
0
)
this
.
ctx
.
fill
()
}
}
if
(
this
.
touch
.
ka_c
>
ms
-
150
){
this
.
ctx
.
fillStyle
=
"
rgba(33, 191, 211, 0.5)
"
this
.
ctx
.
beginPath
()
this
.
ctx
.
ellipse
(
c
.
x
,
c
.
y
,
c
.
rx
*
1.3
,
c
.
ry
*
1.3
,
0
,
pi
,
0
)
this
.
ctx
.
ellipse
(
c
.
x
,
c
.
y
,
c
.
rx
*
0.9
,
c
.
ry
*
0.9
,
0
,
0
,
pi
,
true
)
this
.
ctx
.
fill
()
}
this
.
ctx
.
restore
()
}
}
}
}
ontouch
(
event
){
ontouch
(
event
){
...
@@ -939,43 +892,24 @@ class View{
...
@@ -939,43 +892,24 @@ class View{
var
pageX
=
touch
.
pageX
*
scale
var
pageX
=
touch
.
pageX
*
scale
var
pageY
=
touch
.
pageY
*
scale
var
pageY
=
touch
.
pageY
*
scale
this
.
touch
.
cursor
=
{
ms
:
this
.
controller
.
getElapsedTime
(),
x
:
pageX
,
y
:
pageY
}
var
c
=
this
.
touchCircle
var
c
=
this
.
touchCircle
var
pi
=
Math
.
PI
var
pi
=
Math
.
PI
var
inPath
=
()
=>
this
.
ctx
.
isPointInPath
(
pageX
,
pageY
)
var
inPath
=
()
=>
this
.
ctx
.
isPointInPath
(
pageX
,
pageY
)
this
.
ctx
.
beginPath
()
this
.
ctx
.
beginPath
()
this
.
ctx
.
ellipse
(
c
.
x
,
c
.
y
,
c
.
rx
*
0.6
,
c
.
ry
*
0.6
,
0
,
pi
,
0
)
this
.
ctx
.
ellipse
(
c
.
x
,
c
.
y
,
c
.
rx
,
c
.
ry
,
0
,
pi
,
0
)
if
(
inPath
()){
if
(
inPath
()){
this
.
touchNote
(
"
don_c
"
)
if
(
pageX
<
this
.
winW
/
2
){
this
.
touchNote
(
"
don_l
"
)
}
else
{
this
.
touchNote
(
"
don_r
"
)
}
}
else
{
}
else
{
this
.
ctx
.
beginPath
()
if
(
pageX
<
this
.
winW
/
2
){
this
.
ctx
.
ellipse
(
c
.
x
,
c
.
y
,
c
.
rx
*
0.9
,
c
.
ry
*
0.9
,
0
,
pi
,
0
)
this
.
touchNote
(
"
ka_l
"
)
if
(
inPath
()){
if
(
pageX
<
this
.
winW
/
2
){
this
.
touchNote
(
"
don_l
"
)
}
else
{
this
.
touchNote
(
"
don_r
"
)
}
}
else
{
}
else
{
this
.
touchNote
(
"
ka_r
"
)
this
.
ctx
.
beginPath
()
this
.
ctx
.
ellipse
(
c
.
x
,
c
.
y
,
c
.
rx
*
1.3
,
c
.
ry
*
1.3
,
0
,
pi
,
0
)
if
(
inPath
()){
this
.
touchNote
(
"
ka_c
"
)
}
else
if
(
pageX
<
this
.
winW
/
2
){
this
.
touchNote
(
"
ka_l
"
)
}
else
{
this
.
touchNote
(
"
ka_r
"
)
}
}
}
}
}
}
}
...
@@ -984,39 +918,9 @@ class View{
...
@@ -984,39 +918,9 @@ class View{
var
keyboard
=
this
.
controller
.
keyboard
var
keyboard
=
this
.
controller
.
keyboard
var
kbd
=
keyboard
.
getBindings
()
var
kbd
=
keyboard
.
getBindings
()
var
ms
=
this
.
controller
.
game
.
getAccurateTime
()
var
ms
=
this
.
controller
.
game
.
getAccurateTime
()
this
.
touch
[
note
]
=
ms
this
.
touch
=
ms
if
(
note
===
"
don_c
"
){
keyboard
.
setKey
(
kbd
[
note
],
false
)
this
.
touchNote
(
"
don_l
"
)
keyboard
.
setKey
(
kbd
[
note
],
true
,
ms
)
this
.
touchNote
(
"
don_r
"
)
}
else
if
(
note
===
"
ka_c
"
){
this
.
touchNote
(
"
ka_l
"
)
this
.
touchNote
(
"
ka_r
"
)
}
else
{
keyboard
.
setKey
(
kbd
[
note
],
false
)
keyboard
.
setKey
(
kbd
[
note
],
true
,
ms
)
}
}
toggleFullscreen
(){
var
root
=
document
.
documentElement
if
(
"
requestFullscreen
"
in
root
){
if
(
document
.
fullscreenElement
){
document
.
exitFullscreen
()
}
else
{
root
.
requestFullscreen
()
}
}
else
if
(
"
webkitRequestFullscreen
"
in
root
){
if
(
document
.
webkitFullscreenElement
){
document
.
webkitExitFullscreen
()
}
else
{
root
.
webkitRequestFullscreen
()
}
}
else
if
(
"
mozRequestFullScreen
"
in
root
){
if
(
document
.
mozFullScreenElement
){
document
.
mozCancelFullScreen
()
}
else
{
root
.
mozRequestFullScreen
()
}
}
}
}
onmousemove
(
event
){
onmousemove
(
event
){
this
.
lastMousemove
=
this
.
controller
.
getElapsedTime
()
this
.
lastMousemove
=
this
.
controller
.
getElapsedTime
()
...
@@ -1049,10 +953,10 @@ class View{
...
@@ -1049,10 +953,10 @@ class View{
pageEvents
.
remove
(
this
.
touchFullBtn
,
"
click
"
)
pageEvents
.
remove
(
this
.
touchFullBtn
,
"
click
"
)
pageEvents
.
remove
(
this
.
touchPauseBtn
,
"
click
"
)
pageEvents
.
remove
(
this
.
touchPauseBtn
,
"
click
"
)
this
.
gameDiv
.
classList
.
remove
(
"
touch-visible
"
)
this
.
gameDiv
.
classList
.
remove
(
"
touch-visible
"
)
delete
this
.
touchBgDiv
delete
this
.
touchDrumDiv
delete
this
.
touchDrumImg
delete
this
.
touchFullBtn
delete
this
.
touchFullBtn
delete
this
.
touchPauseBtn
delete
this
.
touchPauseBtn
delete
this
.
touchBgBlueDiv
}
}
delete
this
.
pauseMenu
delete
this
.
pauseMenu
delete
this
.
cursor
delete
this
.
cursor
...
...
public/src/views/game.html
View file @
e1b8b45d
<div
id=
"game"
>
<div
id=
"game"
>
<h3
alt=
""
class=
"stroke-sub game-song"
></h3>
<h3
alt=
""
class=
"stroke-sub game-song"
></h3>
<div
id=
"touch-bg"
>
<div
id=
"touch-drum"
>
<div
id=
"touch-bg-blue"
></div>
<img
id=
"touch-drum-img"
src=
"/assets/img/touch_drum.png"
>
<div
id=
"touch-drum"
>
<img
src=
"/assets/img/touch_drum.png"
>
</div>
</div>
</div>
<canvas
id=
"canvas"
></canvas>
<canvas
id=
"canvas"
></canvas>
<div
id=
"pause-menu"
>
<div
id=
"pause-menu"
>
...
...
public/src/views/songselect.html
View file @
e1b8b45d
<div
id=
"song-select"
>
<div
id=
"song-select"
>
<canvas
id=
"song-sel-canvas"
></canvas>
<canvas
id=
"song-sel-canvas"
></canvas>
<img
id=
"touch-full-btn"
src=
"/assets/img/touch_fullscreen.png"
>
</div>
</div>
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