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
b053dffe
Commit
b053dffe
authored
Sep 27, 2018
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added song select music, more keys
parent
f72c09f4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
19 deletions
+48
-19
public/src/js/assets.js
public/src/js/assets.js
+1
-0
public/src/js/game.js
public/src/js/game.js
+6
-2
public/src/js/keyboard.js
public/src/js/keyboard.js
+21
-8
public/src/js/scoresheet.js
public/src/js/scoresheet.js
+4
-4
public/src/js/songselect.js
public/src/js/songselect.js
+16
-5
No files found.
public/src/js/assets.js
View file @
b053dffe
...
@@ -91,6 +91,7 @@ var assets = {
...
@@ -91,6 +91,7 @@ var assets = {
"
renda.ogg
"
"
renda.ogg
"
],
],
"
audioMusic
"
:
[
"
audioMusic
"
:
[
"
bgm_songsel.ogg
"
,
"
bgm_result.ogg
"
,
"
bgm_result.ogg
"
,
"
bgm_setsume.ogg
"
"
bgm_setsume.ogg
"
],
],
...
...
public/src/js/game.js
View file @
b053dffe
...
@@ -351,8 +351,12 @@ class Game{
...
@@ -351,8 +351,12 @@ class Game{
}
}
}
}
getAccurateTime
(){
getAccurateTime
(){
var
currentDate
=
new
Date
()
if
(
this
.
isPaused
()){
return
currentDate
.
getTime
()
-
this
.
startDate
.
getTime
()
-
this
.
elapsedTimeSincePause
return
this
.
getElapsedTime
().
ms
}
else
{
var
currentDate
=
new
Date
()
return
currentDate
.
getTime
()
-
this
.
startDate
.
getTime
()
-
this
.
elapsedTimeSincePause
}
}
}
getCircles
(){
getCircles
(){
return
this
.
songData
.
circles
return
this
.
songData
.
circles
...
...
public/src/js/keyboard.js
View file @
b053dffe
...
@@ -91,7 +91,7 @@ class Keyboard{
...
@@ -91,7 +91,7 @@ class Keyboard{
var
ms
=
this
.
game
.
getAccurateTime
()
var
ms
=
this
.
game
.
getAccurateTime
()
this
.
gamepadMenu
.
play
((
pressed
,
keyCode
)
=>
{
this
.
gamepadMenu
.
play
((
pressed
,
keyCode
)
=>
{
if
(
pressed
){
if
(
pressed
){
if
(
this
.
game
.
isPaused
()
){
if
(
paused
){
if
(
keyCode
===
"
cancel
"
){
if
(
keyCode
===
"
cancel
"
){
return
setTimeout
(()
=>
{
return
setTimeout
(()
=>
{
this
.
controller
.
togglePauseMenu
()
this
.
controller
.
togglePauseMenu
()
...
@@ -110,17 +110,30 @@ class Keyboard{
...
@@ -110,17 +110,30 @@ class Keyboard{
this
.
controller
.
togglePauseMenu
()
this
.
controller
.
togglePauseMenu
()
})
})
if
(
this
.
game
.
isPaused
()){
if
(
this
.
game
.
isPaused
()){
this
.
checkKey
(
this
.
kbd
[
"
previous
"
],
"
menu
"
,
()
=>
{
var
moveMenuMinus
=
()
=>
{
moveMenu
=
-
1
moveMenu
=
-
1
}
)
}
this
.
checkKey
(
this
.
kbd
[
"
next
"
],
"
menu
"
,
()
=>
{
var
moveMenuPlus
=
()
=>
{
moveMenu
=
1
moveMenu
=
1
}
)
}
this
.
checkKey
(
this
.
kbd
[
"
confirm
"
],
"
menu
"
,
()
=>
{
var
moveMenuConfirm
=
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
document
.
getElementsByClassName
(
"
selected
"
)[
0
].
click
()
var
selected
=
document
.
getElementsByClassName
(
"
selected
"
)[
0
]
if
(
selected
){
selected
.
click
()
}
},
200
)
},
200
)
})
for
(
var
key
in
this
.
keyTime
){
this
.
keyTime
[
key
]
=
null
}
}
this
.
checkKey
(
this
.
kbd
[
"
previous
"
],
"
menu
"
,
moveMenuMinus
)
this
.
checkKey
(
this
.
kbd
[
"
ka_l
"
],
"
menu
"
,
moveMenuMinus
)
this
.
checkKey
(
this
.
kbd
[
"
next
"
],
"
menu
"
,
moveMenuPlus
)
this
.
checkKey
(
this
.
kbd
[
"
ka_r
"
],
"
menu
"
,
moveMenuPlus
)
this
.
checkKey
(
this
.
kbd
[
"
confirm
"
],
"
menu
"
,
moveMenuConfirm
)
this
.
checkKey
(
this
.
kbd
[
"
don_l
"
],
"
menu
"
,
moveMenuConfirm
)
this
.
checkKey
(
this
.
kbd
[
"
don_r
"
],
"
menu
"
,
moveMenuConfirm
)
}
}
if
(
moveMenu
){
if
(
moveMenu
){
assets
.
sounds
[
"
ka
"
].
play
()
assets
.
sounds
[
"
ka
"
].
play
()
...
...
public/src/js/scoresheet.js
View file @
b053dffe
...
@@ -116,11 +116,11 @@ class Scoresheet{
...
@@ -116,11 +116,11 @@ class Scoresheet{
code
=
event
.
keyCode
code
=
event
.
keyCode
}
}
var
selected
=
this
.
elem
(
"
selected
"
,
this
.
scoresheet
)
var
selected
=
this
.
elem
(
"
selected
"
,
this
.
scoresheet
)
if
(
code
==
13
){
if
(
code
==
13
||
code
==
32
||
code
==
86
||
code
==
66
){
// Enter
// Enter
, Space, V, B
selected
.
click
()
selected
.
click
()
}
else
if
(
code
==
37
||
code
==
39
){
}
else
if
(
code
==
37
||
code
==
39
||
code
==
67
||
code
==
78
){
// Left, Right
// Left, Right
, C, N
selected
.
classList
.
remove
(
"
selected
"
)
selected
.
classList
.
remove
(
"
selected
"
)
var
next
=
selected
.
nextElementSibling
var
next
=
selected
.
nextElementSibling
if
(
!
next
){
if
(
!
next
){
...
...
public/src/js/songselect.js
View file @
b053dffe
...
@@ -177,7 +177,9 @@ class SongSelect{
...
@@ -177,7 +177,9 @@ class SongSelect{
this
.
selectedSong
=
0
this
.
selectedSong
=
0
this
.
selectedDiff
=
0
this
.
selectedDiff
=
0
if
(
fromTutorial
){
assets
.
sounds
[
"
bgm_songsel
"
].
playLoop
(
0.1
,
false
,
0
,
1.442
,
3.506
)
if
(
fromTutorial
||
!
"
selectedSong
"
in
localStorage
){
this
.
selectedSong
=
this
.
songs
.
findIndex
(
song
=>
song
.
action
===
"
tutorial
"
)
this
.
selectedSong
=
this
.
songs
.
findIndex
(
song
=>
song
.
action
===
"
tutorial
"
)
}
else
{
}
else
{
if
(
"
selectedSong
"
in
localStorage
){
if
(
"
selectedSong
"
in
localStorage
){
...
@@ -636,8 +638,8 @@ class SongSelect{
...
@@ -636,8 +638,8 @@ class SongSelect{
if
(
this
.
previewing
!==
null
){
if
(
this
.
previewing
!==
null
){
this
.
endPreview
()
this
.
endPreview
()
}
}
}
else
if
(
screen
!==
"
title
"
){
}
else
if
(
screen
!==
"
title
"
&&
ms
>
this
.
state
.
moveMS
+
100
){
if
(
this
.
previewing
!==
this
.
selectedSong
){
if
(
this
.
previewing
!==
this
.
selectedSong
&&
"
id
"
in
this
.
songs
[
this
.
selectedSong
]
){
this
.
startPreview
()
this
.
startPreview
()
}
}
}
}
...
@@ -1478,7 +1480,7 @@ class SongSelect{
...
@@ -1478,7 +1480,7 @@ class SongSelect{
var
currentSong
=
this
.
songs
[
this
.
selectedSong
]
var
currentSong
=
this
.
songs
[
this
.
selectedSong
]
var
id
=
currentSong
.
id
var
id
=
currentSong
.
id
var
prvTime
=
currentSong
.
preview
var
prvTime
=
currentSong
.
preview
this
.
endPreview
()
this
.
endPreview
(
true
)
if
(
"
id
"
in
currentSong
){
if
(
"
id
"
in
currentSong
){
var
startLoad
=
this
.
getMS
()
var
startLoad
=
this
.
getMS
()
...
@@ -1508,13 +1510,17 @@ class SongSelect{
...
@@ -1508,13 +1510,17 @@ class SongSelect{
}
}
}
}
previewLoaded
(
startLoad
,
prvtime
){
previewLoaded
(
startLoad
,
prvtime
){
snd
.
musicGain
.
fadeOut
(
0.4
)
var
endLoad
=
this
.
getMS
()
var
endLoad
=
this
.
getMS
()
var
difference
=
endLoad
-
startLoad
var
difference
=
endLoad
-
startLoad
var
minDelay
=
300
var
minDelay
=
300
var
delay
=
minDelay
-
Math
.
min
(
minDelay
,
difference
)
var
delay
=
minDelay
-
Math
.
min
(
minDelay
,
difference
)
this
.
preview
.
playLoop
(
delay
/
1000
,
false
,
prvtime
/
1000
)
this
.
preview
.
playLoop
(
delay
/
1000
,
false
,
prvtime
/
1000
)
}
}
endPreview
()
{
endPreview
(
noFadeIn
){
if
(
!
noFadeIn
){
snd
.
musicGain
.
fadeIn
(
0.4
)
}
this
.
previewId
++
this
.
previewId
++
this
.
previewing
=
null
this
.
previewing
=
null
if
(
this
.
preview
){
if
(
this
.
preview
){
...
@@ -1559,6 +1565,11 @@ class SongSelect{
...
@@ -1559,6 +1565,11 @@ class SongSelect{
}
}
clean
(){
clean
(){
assets
.
sounds
[
"
bgm_songsel
"
].
stop
()
snd
.
musicGain
.
fadeIn
()
setTimeout
(()
=>
{
snd
.
musicGain
.
fadeIn
()
},
500
)
this
.
redrawRunning
=
false
this
.
redrawRunning
=
false
this
.
endPreview
()
this
.
endPreview
()
pageEvents
.
keyRemove
(
this
,
"
all
"
)
pageEvents
.
keyRemove
(
this
,
"
all
"
)
...
...
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