mirror of
https://github.com/yuukiwww/taiko-web.git
synced 2024-09-29 04:39:14 +02:00
ばいそく機能を追加
This commit is contained in:
parent
5cbc5732a7
commit
dab0bef293
@ -1112,7 +1112,7 @@
|
||||
ctx.fillStyle = "#7e7c76"
|
||||
ctx.fill(this.optionsPath.shadow)
|
||||
ctx.translate(2, -2)
|
||||
ctx.fillStyle = "#d9d6ce"
|
||||
ctx.fillStyle = "gold"
|
||||
ctx.fill(this.optionsPath.main)
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ class Controller{
|
||||
constructor(...args){
|
||||
this.init(...args)
|
||||
}
|
||||
init(selectedSong, songData, autoPlayEnabled, multiplayer, touchEnabled){
|
||||
init(selectedSong, songData, autoPlayEnabled, multiplayer, touchEnabled, baisoku = 1){
|
||||
this.selectedSong = selectedSong
|
||||
this.songData = songData
|
||||
this.autoPlayEnabled = autoPlayEnabled
|
||||
@ -82,7 +82,10 @@ class Controller{
|
||||
}
|
||||
|
||||
this.game = new Game(this, this.selectedSong, this.parsedSongData)
|
||||
this.view = new View(this)
|
||||
this.view = new View(this, baisoku)
|
||||
if (this.view.baisoku > 1) {
|
||||
this.saveScore = false;
|
||||
}
|
||||
this.mekadon = new Mekadon(this, this.game)
|
||||
this.keyboard = new GameInput(this)
|
||||
if(!autoPlayEnabled && this.multiplayer !== 2){
|
||||
|
@ -2,11 +2,12 @@ class LoadSong{
|
||||
constructor(...args){
|
||||
this.init(...args)
|
||||
}
|
||||
init(selectedSong, autoPlayEnabled, multiplayer, touchEnabled){
|
||||
init(selectedSong, autoPlayEnabled, multiplayer, touchEnabled, baisoku = 1){
|
||||
this.selectedSong = selectedSong
|
||||
this.autoPlayEnabled = autoPlayEnabled
|
||||
this.multiplayer = multiplayer
|
||||
this.touchEnabled = touchEnabled
|
||||
this.baisoku = baisoku
|
||||
var resolution = settings.getItem("resolution")
|
||||
this.imgScale = 1
|
||||
if(resolution === "medium"){
|
||||
@ -318,8 +319,8 @@ class LoadSong{
|
||||
}else if(event.type === "gamestart"){
|
||||
this.clean()
|
||||
p2.clearMessage("songsel")
|
||||
var taikoGame1 = new Controller(song, this.songData, false, 1, this.touchEnabled)
|
||||
var taikoGame2 = new Controller(this.selectedSong2, this.song2Data, true, 2, this.touchEnabled)
|
||||
var taikoGame1 = new Controller(song, this.songData, false, 1, this.touchEnabled, this.baisoku)
|
||||
var taikoGame2 = new Controller(this.selectedSong2, this.song2Data, true, 2, this.touchEnabled, this.baisoku)
|
||||
taikoGame1.run(taikoGame2)
|
||||
pageEvents.send("load-song-player2", this.selectedSong2)
|
||||
}else if(event.type === "left" || event.type === "gameend"){
|
||||
@ -335,7 +336,7 @@ class LoadSong{
|
||||
})
|
||||
}else{
|
||||
this.clean()
|
||||
var taikoGame = new Controller(song, this.songData, this.autoPlayEnabled, false, this.touchEnabled)
|
||||
var taikoGame = new Controller(song, this.songData, this.autoPlayEnabled, false, this.touchEnabled, this.baisoku)
|
||||
taikoGame.run()
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ class SongSelect{
|
||||
iconFill: "#e7cbe1",
|
||||
letterSpacing: 4
|
||||
}]
|
||||
this.optionsList = [strings.none, strings.auto, strings.netplay]
|
||||
this.optionsList = [strings.none, strings.auto, strings.netplay, "ばいそく", "さんばい", "よんばい", "ばいそく+オート", "さんばい+オート", "よんばい+オート"]
|
||||
|
||||
this.draw = new CanvasDraw(noSmoothing)
|
||||
this.songTitleCache = new CanvasCache(noSmoothing)
|
||||
@ -347,7 +347,7 @@ class SongSelect{
|
||||
waitPreview: 0
|
||||
}
|
||||
this.songSelecting = {
|
||||
speed: 400,
|
||||
speed: 200,
|
||||
resize: 0.3,
|
||||
scrollDelay: 0.1
|
||||
}
|
||||
@ -898,7 +898,21 @@ class SongSelect{
|
||||
}
|
||||
var autoplay = false
|
||||
var multiplayer = false
|
||||
if(p2.session || this.state.options === 2){
|
||||
var baisoku = 1;
|
||||
if (this.state.options >= 3 || this.state.options <= 8) {
|
||||
const mapping = {
|
||||
3: 2,
|
||||
4: 3,
|
||||
5: 4,
|
||||
6: 2,
|
||||
7: 3,
|
||||
8: 4
|
||||
};
|
||||
baisoku = mapping[this.state.options];
|
||||
if (this.state.options >= 6) {
|
||||
autoplay = true
|
||||
}
|
||||
}if(p2.session || this.state.options === 2){
|
||||
multiplayer = true
|
||||
}else if(this.state.options === 1){
|
||||
autoplay = true
|
||||
@ -922,7 +936,7 @@ class SongSelect{
|
||||
"stars": selectedSong.courses[diff].stars,
|
||||
"hash": selectedSong.hash,
|
||||
"lyrics": selectedSong.lyrics
|
||||
}, autoplay, multiplayer, touch)
|
||||
}, autoplay, multiplayer, touch, baisoku)
|
||||
}
|
||||
toOptions(moveBy){
|
||||
if(!p2.session){
|
||||
|
@ -2,8 +2,9 @@
|
||||
constructor(...args){
|
||||
this.init(...args)
|
||||
}
|
||||
init(controller){
|
||||
init(controller, baisoku = 1){
|
||||
this.controller = controller
|
||||
this.baisoku = baisoku
|
||||
|
||||
this.canvas = document.getElementById("canvas")
|
||||
this.ctx = this.canvas.getContext("2d")
|
||||
@ -1487,11 +1488,11 @@
|
||||
var measureH = 130 * mul
|
||||
|
||||
measures.forEach(measure => {
|
||||
var timeForDistance = this.posToMs(distanceForCircle, measure.speed)
|
||||
var timeForDistance = this.posToMs(distanceForCircle, measure.speed * this.baisoku)
|
||||
var startingTime = measure.ms - timeForDistance + this.controller.videoLatency
|
||||
var finishTime = measure.ms + this.posToMs(this.slotPos.x - this.slotPos.paddingLeft + 3, measure.speed) + this.controller.videoLatency
|
||||
var finishTime = measure.ms + this.posToMs(this.slotPos.x - this.slotPos.paddingLeft + 3, measure.speed * this.baisoku) + this.controller.videoLatency
|
||||
if(measure.visible && (!measure.branch || measure.branch.active) && ms >= startingTime && ms <= finishTime){
|
||||
var measureX = this.slotPos.x + this.msToPos(measure.ms - ms + this.controller.videoLatency, measure.speed)
|
||||
var measureX = this.slotPos.x + this.msToPos(measure.ms - ms + this.controller.videoLatency, measure.speed * this.baisoku)
|
||||
this.ctx.strokeStyle = measure.branchFirst ? "#ff0" : "#bdbdbd"
|
||||
this.ctx.lineWidth = 3
|
||||
this.ctx.beginPath()
|
||||
@ -1537,7 +1538,7 @@
|
||||
|
||||
for(var i = circles.length; i--;){
|
||||
var circle = circles[i]
|
||||
var speed = circle.speed
|
||||
var speed = circle.speed * this.baisoku
|
||||
|
||||
var timeForDistance = this.posToMs(distanceForCircle + this.slotPos.size / 2, speed)
|
||||
var startingTime = circle.ms - timeForDistance + this.controller.videoLatency
|
||||
@ -1626,7 +1627,7 @@
|
||||
var circleMs = circle.ms
|
||||
var endTime = circle.endTime
|
||||
var animated = circle.animating
|
||||
var speed = circle.speed
|
||||
var speed = circle.speed * this.baisoku
|
||||
var played = circle.isPlayed
|
||||
var drumroll = 0
|
||||
var endX = 0
|
||||
|
Loading…
Reference in New Issue
Block a user