mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
convert indents to spaces
This commit is contained in:
@@ -13,7 +13,7 @@ local GameMode = Object:extend()
|
||||
function GameMode:new(player_name, input_file, replay_grade)
|
||||
VCTRL.toggle(MOBILE and not input_file and not SETTINGS.tvMode)
|
||||
|
||||
if player_name == nil then self.training = true else self.training = false end
|
||||
if player_name == nil then self.training = true else self.training = false end
|
||||
if input_file ~= nil then
|
||||
input_file = love.filesystem.read(REPLAY_DIR..input_file)
|
||||
input_file = lualzw.decompress(input_file)
|
||||
@@ -23,10 +23,10 @@ function GameMode:new(player_name, input_file, replay_grade)
|
||||
self.input_playback = true
|
||||
self.grade = replay_grade
|
||||
self.frames = 1
|
||||
elseif self.training then
|
||||
player_name = 'TRN'
|
||||
replay_grade = 'N/A'
|
||||
self.randomizer = Randomizer(false, nil)
|
||||
elseif self.training then
|
||||
player_name = 'TRN'
|
||||
replay_grade = 'N/A'
|
||||
self.randomizer = Randomizer(false, nil)
|
||||
self.input_playback = false
|
||||
self.frames = 0
|
||||
else
|
||||
@@ -64,22 +64,22 @@ function GameMode:new(player_name, input_file, replay_grade)
|
||||
"9k", "8k", "7k", "6k", "5k", "4k", "3k", "2k", "1k",
|
||||
"1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D"
|
||||
}
|
||||
self.promo_table = {
|
||||
self.promo_table = {
|
||||
26666, 53333, 79999, 106666, 133333, 159999, 186666, 213333, 239999, 266666,
|
||||
293333, 319999, 346666, 373333, 399999, 426666, 453333, 479999, 506666,
|
||||
533333, 559999, 586666, 613333, 639999, 666666, 693333, 719999, 719999
|
||||
}
|
||||
self.autopromo_table = {
|
||||
self.autopromo_table = {
|
||||
79999, 106666, 133333, 159999, 186666, 213333, 239999, 266666, 293333, 319999,
|
||||
346666, 373333, 399999, 426666, 453333, 479999, 506666, 533333, 559999,
|
||||
586666, 613333, 639999, 666666, 693333, 719999, 746666, 773333, 1000000
|
||||
}
|
||||
self.demo_table = {
|
||||
}
|
||||
self.demo_table = {
|
||||
-1, 13332, 25000, 40000, 50000, 60000, 60000, 120000, 120000, 120000,
|
||||
180000, 180000, 240000, 240000, 300000, 300000, 360000, 360000, 360000,
|
||||
420000, 420000, 480000, 480000, 480000, 480000, 540000, 540000, 540000
|
||||
}
|
||||
self.speed_divisor = 10000
|
||||
self.speed_divisor = 10000
|
||||
self.line_clear_flash = 0
|
||||
self.lines_cleared = 0
|
||||
SOUNDS['bgm_firsthalf']:setVolume(0.3)
|
||||
@@ -89,7 +89,7 @@ function GameMode:new(player_name, input_file, replay_grade)
|
||||
self.input_saved = false
|
||||
self.end_grid_clear = false
|
||||
self.last_active = 0
|
||||
self.move_count = 0
|
||||
self.move_count = 0
|
||||
self.target = 0
|
||||
self.last_percent = 0
|
||||
self.total_speed_loss = 0
|
||||
@@ -162,15 +162,15 @@ end
|
||||
|
||||
function GameMode:updateGradeHistory()
|
||||
if self.grade_score >= self.promo_table[self.grade] then
|
||||
if (self.grade == 28 and self.grade_history[2] < 4) or self.grade < 28 then self.grade_history[2] = self.grade_history[2] + 1 end
|
||||
self.point_flash = 60
|
||||
self.point_flash_color = {0,1,0,1}
|
||||
elseif self.grade_score <= self.demo_table[self.grade] then
|
||||
if (self.grade == 1 and self.grade_history[2] > 0) or self.grade > 1 then self.grade_history[2] = self.grade_history[2] - 1 end
|
||||
self.point_flash = 60
|
||||
self.point_flash_color = {1,0,0,1}
|
||||
end
|
||||
local auto_flag = false
|
||||
if (self.grade == 28 and self.grade_history[2] < 4) or self.grade < 28 then self.grade_history[2] = self.grade_history[2] + 1 end
|
||||
self.point_flash = 60
|
||||
self.point_flash_color = {0,1,0,1}
|
||||
elseif self.grade_score <= self.demo_table[self.grade] then
|
||||
if (self.grade == 1 and self.grade_history[2] > 0) or self.grade > 1 then self.grade_history[2] = self.grade_history[2] - 1 end
|
||||
self.point_flash = 60
|
||||
self.point_flash_color = {1,0,0,1}
|
||||
end
|
||||
local auto_flag = false
|
||||
while self.grade_score >= self.autopromo_table[self.grade] and self.grade < 28 do
|
||||
self.grade = self.grade + 1
|
||||
self.point_flash = 1
|
||||
@@ -178,7 +178,7 @@ function GameMode:updateGradeHistory()
|
||||
self.grade_change_color = {0,0,1,1}
|
||||
self.end_game_sound = "autopromote"
|
||||
auto_flag = true
|
||||
end
|
||||
end
|
||||
if self.grade_history[2] >= 5 and self.grade < 28 and auto_flag == false then
|
||||
self.grade = self.grade + 1
|
||||
self.point_flash = 1
|
||||
@@ -194,7 +194,7 @@ function GameMode:updateGradeHistory()
|
||||
end
|
||||
if self.starting_grade ~= self.grade then
|
||||
self.grade_history[1] = self.grade
|
||||
self.grade_history[2] = 2
|
||||
self.grade_history[2] = 2
|
||||
end
|
||||
self.grade_history[4] = self.grade_history[4] + 1
|
||||
end
|
||||
@@ -227,31 +227,31 @@ end
|
||||
function GameMode:getARR() return 1 end
|
||||
function GameMode:getDropSpeed() return 1 end
|
||||
function GameMode:getARE()
|
||||
if self.training then return 20 end
|
||||
if self.speed_level <= #self.delay_table then return self.delay_table[self.speed_level][2]
|
||||
if self.training then return 20 end
|
||||
if self.speed_level <= #self.delay_table then return self.delay_table[self.speed_level][2]
|
||||
else return self.delay_table[#self.delay_table][2] end
|
||||
end
|
||||
|
||||
function GameMode:getLineARE() return self:getARE() end
|
||||
|
||||
function GameMode:getLockDelay()
|
||||
if self.training then return 99999999999 end
|
||||
if self.speed_level <= #self.delay_table then return self.delay_table[self.speed_level][3]
|
||||
if self.training then return 99999999999 end
|
||||
if self.speed_level <= #self.delay_table then return self.delay_table[self.speed_level][3]
|
||||
else return self.delay_table[#self.delay_table][3] end
|
||||
end
|
||||
|
||||
function GameMode:getLineClearDelay() return self:getARE() end
|
||||
|
||||
function GameMode:getDasLimit()
|
||||
if self.training then return 8 end
|
||||
if self.speed_level <= #self.delay_table then return self.delay_table[self.speed_level][4]
|
||||
if self.training then return 8 end
|
||||
if self.speed_level <= #self.delay_table then return self.delay_table[self.speed_level][4]
|
||||
else return self.delay_table[#self.delay_table][4] end
|
||||
end
|
||||
function GameMode:getDasCutDelay() return 0 end
|
||||
|
||||
function GameMode:getGravity()
|
||||
if self.training then return 20 end
|
||||
if self.speed_level <= #self.delay_table then return self.delay_table[self.speed_level][1]
|
||||
if self.training then return 20 end
|
||||
if self.speed_level <= #self.delay_table then return self.delay_table[self.speed_level][1]
|
||||
else return self.delay_table[#self.delay_table][1] end
|
||||
end
|
||||
|
||||
@@ -346,8 +346,8 @@ function GameMode:update(inputs, ruleset)
|
||||
if self.grade_change_flash > 0 and self.game_over_frames >= 2 then self.grade_change_flash = self.grade_change_flash - 1 end
|
||||
if self.point_flash > 0 and self.game_over_frames >= 2 then self.point_flash = self.point_flash - 1 end
|
||||
if self.game_over_frames == 2 then
|
||||
PlaySEOnce(self.end_game_sound)
|
||||
end
|
||||
PlaySEOnce(self.end_game_sound)
|
||||
end
|
||||
if self.game_over or self.completed then
|
||||
self.game_over_frames = self.game_over_frames + 1
|
||||
if self.game_over_frames == 1 then self:storeInput(inputs) end
|
||||
@@ -369,24 +369,24 @@ function GameMode:update(inputs, ruleset)
|
||||
self.up_lock = true
|
||||
end
|
||||
if not inputs["up"] then self.up_lock = false end
|
||||
local dir_list = {"down", "left", "right"}
|
||||
for i = 1, #dir_list do
|
||||
if inputs[dir_list[i]] and not table.contains(self.directions_pressed, dir_list[i]) then
|
||||
table.insert(self.directions_pressed, dir_list[i])
|
||||
elseif not inputs[dir_list[i]] then
|
||||
for j=1, #self.directions_pressed do
|
||||
if self.directions_pressed[j] == dir_list[i] then table.remove(self.directions_pressed, j) end
|
||||
end
|
||||
end
|
||||
end
|
||||
if #self.directions_pressed > 0 then
|
||||
for i=1, #self.directions_pressed-1 do
|
||||
inputs[self.directions_pressed[i]] = false
|
||||
end
|
||||
inputs[self.directions_pressed[#self.directions_pressed]] = true
|
||||
if inputs['left'] then self.lastdir = -1
|
||||
elseif inputs['right'] then self.lastdir = 1 end
|
||||
end
|
||||
local dir_list = {"down", "left", "right"}
|
||||
for i = 1, #dir_list do
|
||||
if inputs[dir_list[i]] and not table.contains(self.directions_pressed, dir_list[i]) then
|
||||
table.insert(self.directions_pressed, dir_list[i])
|
||||
elseif not inputs[dir_list[i]] then
|
||||
for j=1, #self.directions_pressed do
|
||||
if self.directions_pressed[j] == dir_list[i] then table.remove(self.directions_pressed, j) end
|
||||
end
|
||||
end
|
||||
end
|
||||
if #self.directions_pressed > 0 then
|
||||
for i=1, #self.directions_pressed-1 do
|
||||
inputs[self.directions_pressed[i]] = false
|
||||
end
|
||||
inputs[self.directions_pressed[#self.directions_pressed]] = true
|
||||
if inputs['left'] then self.lastdir = -1
|
||||
elseif inputs['right'] then self.lastdir = 1 end
|
||||
end
|
||||
|
||||
-- advance one frame
|
||||
|
||||
@@ -521,7 +521,7 @@ function GameMode:stackQualityCheck()
|
||||
local stack_clean = self:detectHoles(x, y)
|
||||
if not stack_clean then
|
||||
hole_num = hole_num + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -541,26 +541,26 @@ function GameMode:doStackQuality()
|
||||
if total_speed <= 0 then total_speed = 0.001 end
|
||||
self.total_speed_loss = total_speed / #self.speed_table
|
||||
if #self.speed_table == 0 then self.total_speed_loss = 0 end
|
||||
self.last_holes = contiguous_holes
|
||||
self.last_holes = contiguous_holes
|
||||
end
|
||||
|
||||
function GameMode:doSpeedCheck()
|
||||
self.target = self.move_count
|
||||
local speed = (self.target/self.active_frames)
|
||||
if speed > 1 then speed = 1 end
|
||||
table.insert(self.speed_table, 1, speed)
|
||||
self.target = self.move_count
|
||||
local speed = (self.target/self.active_frames)
|
||||
if speed > 1 then speed = 1 end
|
||||
table.insert(self.speed_table, 1, speed)
|
||||
while #self.speed_table > 50 do
|
||||
table.remove(self.speed_table, #self.speed_table)
|
||||
end
|
||||
local total_speed = 0
|
||||
for i=1, #self.speed_table do
|
||||
total_speed = total_speed + self.speed_table[i]
|
||||
end
|
||||
local total_speed = 0
|
||||
for i=1, #self.speed_table do
|
||||
total_speed = total_speed + self.speed_table[i]
|
||||
end
|
||||
if total_speed <= 0 then total_speed = 0.001 end
|
||||
self.total_speed_loss = total_speed / #self.speed_table
|
||||
self.total_speed_loss = total_speed / #self.speed_table
|
||||
if #self.speed_table == 0 then self.total_speed_loss = 0 end
|
||||
self.last_active = self.active_frames
|
||||
self.last_percent = speed
|
||||
self.last_active = self.active_frames
|
||||
self.last_percent = speed
|
||||
self.active_frames = 0
|
||||
self.move_count = 0
|
||||
end
|
||||
@@ -571,7 +571,7 @@ function GameMode:updateScore(cleared_lines)
|
||||
while cleared_lines+self.total_lines > 300 do
|
||||
cleared_lines = cleared_lines - 1
|
||||
end
|
||||
self.last_speed = math.ceil(self.total_speed_loss * self.bonus_components['speed'] * cleared_lines)
|
||||
self.last_speed = math.ceil(self.total_speed_loss * self.bonus_components['speed'] * cleared_lines)
|
||||
self.line_clear_flash = 240
|
||||
self.lines_cleared = cleared_lines
|
||||
self.score_to_add = self.lineClearPoints[cleared_lines] + self.last_speed
|
||||
@@ -590,25 +590,25 @@ function GameMode:advanceOneFrame()
|
||||
love.audio.stop()
|
||||
self.audio_stopped = true
|
||||
end
|
||||
end
|
||||
end
|
||||
if self.training and not SOUNDS['bgm_title']:isPlaying() and SETTINGS["music"] then SOUNDS['bgm_title']:play() end
|
||||
if not self.training then
|
||||
if self.nextbgmflag and SOUNDS['bgm_firsthalf']:isPlaying() then
|
||||
if SOUNDS['bgm_firsthalf']:getVolume() > 0.1 then
|
||||
SOUNDS['bgm_firsthalf']:setVolume(SOUNDS['bgm_firsthalf']:getVolume()-0.01)
|
||||
else
|
||||
SOUNDS['bgm_firsthalf']:stop()
|
||||
end
|
||||
end
|
||||
if self.ready_frames < 1 and not SOUNDS['bgm_firsthalf']:isPlaying() and not SOUNDS['bgm_secondhalf']:isPlaying() and SETTINGS["music"] then
|
||||
if not self.nextbgmflag then SOUNDS['bgm_firsthalf']:play()
|
||||
elseif self.total_lines < 296 then SOUNDS['bgm_secondhalf']:play() end
|
||||
end
|
||||
if self.total_lines >= 296 then
|
||||
SOUNDS['bgm_firsthalf']:stop()
|
||||
SOUNDS['bgm_secondhalf']:stop()
|
||||
end
|
||||
end
|
||||
if not self.training then
|
||||
if self.nextbgmflag and SOUNDS['bgm_firsthalf']:isPlaying() then
|
||||
if SOUNDS['bgm_firsthalf']:getVolume() > 0.1 then
|
||||
SOUNDS['bgm_firsthalf']:setVolume(SOUNDS['bgm_firsthalf']:getVolume()-0.01)
|
||||
else
|
||||
SOUNDS['bgm_firsthalf']:stop()
|
||||
end
|
||||
end
|
||||
if self.ready_frames < 1 and not SOUNDS['bgm_firsthalf']:isPlaying() and not SOUNDS['bgm_secondhalf']:isPlaying() and SETTINGS["music"] then
|
||||
if not self.nextbgmflag then SOUNDS['bgm_firsthalf']:play()
|
||||
elseif self.total_lines < 296 then SOUNDS['bgm_secondhalf']:play() end
|
||||
end
|
||||
if self.total_lines >= 296 then
|
||||
SOUNDS['bgm_firsthalf']:stop()
|
||||
SOUNDS['bgm_secondhalf']:stop()
|
||||
end
|
||||
end
|
||||
if self.clear then
|
||||
self.completed = true
|
||||
end
|
||||
@@ -637,29 +637,29 @@ end
|
||||
function GameMode:onAttemptPieceMove(piece, grid) end
|
||||
function GameMode:onAttemptPieceRotate(piece, grid) end
|
||||
function GameMode:onPieceMove(piece, grid, dx)
|
||||
if not self.moved then
|
||||
self.move_count = self.move_count + 1
|
||||
self.moved = true
|
||||
end
|
||||
if not self.moved then
|
||||
self.move_count = self.move_count + 1
|
||||
self.moved = true
|
||||
end
|
||||
end
|
||||
function GameMode:onPieceRotate(piece, grid, drot)
|
||||
if not self.moved then
|
||||
self.move_count = self.move_count + 1
|
||||
self.moved = true
|
||||
end
|
||||
if not self.moved then
|
||||
self.move_count = self.move_count + 1
|
||||
self.moved = true
|
||||
end
|
||||
end
|
||||
function GameMode:onPieceDrop(piece, grid, dy)
|
||||
if not self.moved then
|
||||
self.move_count = self.move_count + 1
|
||||
self.moved = true
|
||||
end
|
||||
if not self.moved then
|
||||
self.move_count = self.move_count + 1
|
||||
self.moved = true
|
||||
end
|
||||
end
|
||||
function GameMode:onPieceLock(piece, cleared_row_count)
|
||||
if not self.moved then
|
||||
self.move_count = self.move_count + 1
|
||||
self.moved = true
|
||||
end
|
||||
self.lastdir = 0
|
||||
if not self.moved then
|
||||
self.move_count = self.move_count + 1
|
||||
self.moved = true
|
||||
end
|
||||
self.lastdir = 0
|
||||
PlaySE("lock")
|
||||
end
|
||||
|
||||
@@ -680,7 +680,7 @@ function GameMode:onGameOver()
|
||||
if not self.training then VCTRL.toggle(false) end
|
||||
if not self.input_playback and not self.training and not PENTO_MODE then
|
||||
if not self.did_grades then
|
||||
self.grade_score = self.grade_score + self.speed_level
|
||||
self.grade_score = self.grade_score + self.speed_level
|
||||
if #self.speed_table >= 49 then
|
||||
self:updateGradeHistory()
|
||||
end
|
||||
@@ -690,16 +690,16 @@ function GameMode:onGameOver()
|
||||
end
|
||||
self:drawEndScoringInfo()
|
||||
elseif not self.did_grades then
|
||||
self.grade_score = self.grade_score + self.speed_level
|
||||
self.did_grades = true
|
||||
end
|
||||
self.grade_score = self.grade_score + self.speed_level
|
||||
self.did_grades = true
|
||||
end
|
||||
if PENTO_MODE and not self.training then self:drawEndScoringInfo() end
|
||||
end
|
||||
|
||||
function GameMode:drawEndScoringInfo()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
drawText("Score: ", 247, 135, 1000, "left")
|
||||
drawBigText(string.format("%s", self.grade_score), 247, 150, 100, "center")
|
||||
drawText("Score: ", 247, 135, 1000, "left")
|
||||
drawBigText(string.format("%s", self.grade_score), 247, 150, 100, "center")
|
||||
if not PENTO_MODE then
|
||||
drawText("Best scores:", 247, 220, 1000, "left")
|
||||
|
||||
@@ -869,10 +869,10 @@ function GameMode:drawLineClearAnimation()
|
||||
fade_timer = self.lcd/20
|
||||
love.graphics.setColor(1,1,1,fade_timer)
|
||||
love.graphics.draw(BLOCKS[block.skin][block.colour..'_d'], real_x, real_y+fall_timer)
|
||||
if self.lcd > self:getLineClearDelay() - 5 then
|
||||
love.graphics.setColor(1,1,1,fade_timer*0.3)
|
||||
love.graphics.draw(BLOCKS[block.skin]['W'], real_x, real_y+fall_timer)
|
||||
end
|
||||
if self.lcd > self:getLineClearDelay() - 5 then
|
||||
love.graphics.setColor(1,1,1,fade_timer*0.3)
|
||||
love.graphics.draw(BLOCKS[block.skin]['W'], real_x, real_y+fall_timer)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -921,61 +921,61 @@ function GameMode:drawGrid()
|
||||
end
|
||||
|
||||
function GameMode:drawInputDisplay(left, top)
|
||||
if self.replay_inputs[self.frames] ~= nil then
|
||||
drawText("+", left+10, top+8, 1000, "left")
|
||||
drawText("▼", left+10, top+18, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['down']),1,1-boolToInt(self.replay_inputs[self.frames]['down']),1})
|
||||
drawText("◀", left, top+8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['left']),1,1-boolToInt(self.replay_inputs[self.frames]['left']),1})
|
||||
drawText("▶", left+20, top+8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['right']),1,1-boolToInt(self.replay_inputs[self.frames]['right']),1})
|
||||
drawText("L", left+35, top+8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['rotate_left']),1,1-boolToInt(self.replay_inputs[self.frames]['rotate_left']),1})
|
||||
drawText("R", left+50, top+8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['rotate_right']),1,1-boolToInt(self.replay_inputs[self.frames]['rotate_right']),1})
|
||||
drawText("L", left+65, top+8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['rotate_left2']),1,1-boolToInt(self.replay_inputs[self.frames]['rotate_left2']),1})
|
||||
drawText("R", left+80, top+8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['rotate_right2']),1,1-boolToInt(self.replay_inputs[self.frames]['rotate_right2']),1})
|
||||
else
|
||||
drawText("+", left+10, top+8, 1000, "left")
|
||||
drawText("▼", left+10, top+18, 1000, "left")
|
||||
drawText("◀", left, top+8, 1000, "left")
|
||||
drawText("▶", left+20, top+8, 1000, "left")
|
||||
drawText("L", left+35, top+8, 1000, "left")
|
||||
drawText("R", left+50, top+8, 1000, "left")
|
||||
drawText("L", left+65, top+8, 1000, "left")
|
||||
drawText("R", left+80, top+8, 1000, "left")
|
||||
end
|
||||
if self.replay_inputs[self.frames] ~= nil then
|
||||
drawText("+", left+10, top+8, 1000, "left")
|
||||
drawText(CHAR.key.down , left+10, top+18, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['down']),1,1-boolToInt(self.replay_inputs[self.frames]['down']),1})
|
||||
drawText(CHAR.key.left , left , top+ 8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['left']),1,1-boolToInt(self.replay_inputs[self.frames]['left']),1})
|
||||
drawText(CHAR.key.right, left+20, top+ 8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['right']),1,1-boolToInt(self.replay_inputs[self.frames]['right']),1})
|
||||
drawText("L", left+35, top+8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['rotate_left']),1,1-boolToInt(self.replay_inputs[self.frames]['rotate_left']),1})
|
||||
drawText("R", left+50, top+8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['rotate_right']),1,1-boolToInt(self.replay_inputs[self.frames]['rotate_right']),1})
|
||||
drawText("L", left+65, top+8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['rotate_left2']),1,1-boolToInt(self.replay_inputs[self.frames]['rotate_left2']),1})
|
||||
drawText("R", left+80, top+8, 1000, "left",{1-boolToInt(self.replay_inputs[self.frames]['rotate_right2']),1,1-boolToInt(self.replay_inputs[self.frames]['rotate_right2']),1})
|
||||
else
|
||||
drawText("+", left+10, top+8, 1000, "left")
|
||||
drawText(CHAR.key.down , left+10, top+18, 1000)
|
||||
drawText(CHAR.key.left , left , top+ 8, 1000)
|
||||
drawText(CHAR.key.right, left+20, top+ 8, 1000)
|
||||
drawText("L", left+35, top+8, 1000, "left")
|
||||
drawText("R", left+50, top+8, 1000, "left")
|
||||
drawText("L", left+65, top+8, 1000, "left")
|
||||
drawText("R", left+80, top+8, 1000, "left")
|
||||
end
|
||||
end
|
||||
|
||||
function GameMode:drawSpeedStats(left, top)
|
||||
love.graphics.setColor(0,0,0,0.5)
|
||||
love.graphics.rectangle("fill", left+3, top+3, 190, 145, 10, 10)
|
||||
love.graphics.setColor(0.05,0.05,0.05,1)
|
||||
love.graphics.rectangle("fill", left, top, 190, 145, 10, 10)
|
||||
love.graphics.setColor(0,0,0,0.5)
|
||||
love.graphics.rectangle("fill", left+3, top+3, 190, 145, 10, 10)
|
||||
love.graphics.setColor(0.05,0.05,0.05,1)
|
||||
love.graphics.rectangle("fill", left, top, 190, 145, 10, 10)
|
||||
drawText("Efficiency Bonus: ", left+15, top+10, 1000, "left")
|
||||
local lines = self.total_lines
|
||||
if lines == 0 then lines = 1 end
|
||||
if self.move_count == 0 then
|
||||
drawText(string.format(" %4d Num. of Moves", self.target), left+15, top+25, 1000, "left")
|
||||
else
|
||||
drawText(string.format(" %4d Num. of Moves", self.move_count), left+15, top+25, 1000, "left")
|
||||
end
|
||||
drawText(string.format("/ %4d Active Frames", self.last_active), left+15, top+40, 1000, "left")
|
||||
drawText(string.format("= %1.2f\n (0 added for hole)\n %1.2f %dpc Average\nx %s x Lines\n+ %4d", self.last_percent, self.total_speed_loss, #self.speed_table, self.bonus_components['speed'], self.last_speed), left+15, top+55, 1000, "left")
|
||||
if lines == 0 then lines = 1 end
|
||||
if self.move_count == 0 then
|
||||
drawText(string.format(" %4d Num. of Moves", self.target), left+15, top+25, 1000, "left")
|
||||
else
|
||||
drawText(string.format(" %4d Num. of Moves", self.move_count), left+15, top+25, 1000, "left")
|
||||
end
|
||||
drawText(string.format("/ %4d Active Frames", self.last_active), left+15, top+40, 1000, "left")
|
||||
drawText(string.format("= %1.2f\n (0 added for hole)\n %1.2f %dpc Average\nx %s x Lines\n+ %4d", self.last_percent, self.total_speed_loss, #self.speed_table, self.bonus_components['speed'], self.last_speed), left+15, top+55, 1000, "left")
|
||||
end
|
||||
|
||||
function GameMode:drawLinesStats(left, top)
|
||||
love.graphics.setColor(0,0,0,0.5)
|
||||
love.graphics.rectangle("fill", left+3, top+3, 190, 90, 10, 10)
|
||||
love.graphics.setColor(0.05,0.05,0.05,1)
|
||||
love.graphics.rectangle("fill", left, top, 190, 90, 10, 10)
|
||||
love.graphics.setColor(0,0,0,0.5)
|
||||
love.graphics.rectangle("fill", left+3, top+3, 190, 90, 10, 10)
|
||||
love.graphics.setColor(0.05,0.05,0.05,1)
|
||||
love.graphics.rectangle("fill", left, top, 190, 90, 10, 10)
|
||||
local lines = self.total_lines
|
||||
if lines == 0 then lines = 1 end
|
||||
if lines == 0 then lines = 1 end
|
||||
drawText("Lines Bonus: ", left+15, top+10, 1000, "left")
|
||||
-- drawText(string.format("+ %4d %3d%%", self.lineClearPoints[self.lines_cleared], (self.score_totals['lines']/(self.lineClearPoints[4]*math.ceil(lines/4)))*100), left+15, top+25, 1000, "left")
|
||||
drawText(string.format("2 x Lines = %d\n3 x Lines = %d\n4 x Lines = %d", self.lineClearPoints[2], self.lineClearPoints[3], self.lineClearPoints[4]), left+15, top+25, 1000, "left")
|
||||
-- drawText(string.format("+ %4d %3d%%", self.lineClearPoints[self.lines_cleared], (self.score_totals['lines']/(self.lineClearPoints[4]*math.ceil(lines/4)))*100), left+15, top+25, 1000, "left")
|
||||
drawText(string.format("2 x Lines = %d\n3 x Lines = %d\n4 x Lines = %d", self.lineClearPoints[2], self.lineClearPoints[3], self.lineClearPoints[4]), left+15, top+25, 1000, "left")
|
||||
end
|
||||
|
||||
function GameMode:drawScoringInfo()
|
||||
-- Name & Grade
|
||||
love.graphics.setColor(0,0,0,0.5)
|
||||
love.graphics.rectangle("fill", 98, 83, 110, 180, 10, 10)
|
||||
love.graphics.setColor(0.05,0.05,0.05,1)
|
||||
love.graphics.setColor(0.05,0.05,0.05,1)
|
||||
love.graphics.rectangle("fill", 95, 80, 110, 180, 10, 10)
|
||||
if not PENTO_MODE then drawText("Grade:", 100, 128, 1000, "left") end
|
||||
-- Line & Level
|
||||
@@ -988,46 +988,46 @@ function GameMode:drawScoringInfo()
|
||||
end
|
||||
-- REPLAY
|
||||
if self.input_playback then
|
||||
love.graphics.setColor(0,0,0,0.5)
|
||||
love.graphics.rectangle("fill", 68, 270, 140, 190, 10, 10)
|
||||
love.graphics.setColor(0.05,0.05,0.05,1)
|
||||
love.graphics.rectangle("fill", 65, 267, 140, 190, 10, 10)
|
||||
love.graphics.setColor(0,0,0,0.5)
|
||||
love.graphics.rectangle("fill", 68, 270, 140, 190, 10, 10)
|
||||
love.graphics.setColor(0.05,0.05,0.05,1)
|
||||
love.graphics.rectangle("fill", 65, 267, 140, 190, 10, 10)
|
||||
drawText(string.format("Replay in progress\n\n\n\n\n\n\n\n\n%s", formatTime(self.frames)), 70, 275, 1000, "left")
|
||||
drawBigText(string.format("%s", self.grade), 100, 143, 1000, "left")
|
||||
self:drawInputDisplay(103,185)
|
||||
elseif not PENTO_MODE then
|
||||
if math.mod(self.grade_change_flash, 5) ~= 0 then
|
||||
drawBigText(string.format("%s", self.gradeNames[self.grade]), 100, 143, 1000, "left", self.grade_change_color)
|
||||
else
|
||||
drawBigText(string.format("%s", self.gradeNames[self.grade]), 100, 143, 1000, "left")
|
||||
end
|
||||
local points_text = nil
|
||||
elseif not PENTO_MODE then
|
||||
if math.mod(self.grade_change_flash, 5) ~= 0 then
|
||||
drawBigText(string.format("%s", self.gradeNames[self.grade]), 100, 143, 1000, "left", self.grade_change_color)
|
||||
else
|
||||
drawBigText(string.format("%s", self.gradeNames[self.grade]), 100, 143, 1000, "left")
|
||||
end
|
||||
local points_text = nil
|
||||
if self.grade == 1 and self.grade_history[2] == 2 then
|
||||
points_text = " |.."
|
||||
elseif self.grade == 1 and self.grade_history[2] == 3 then
|
||||
points_text = " .|."
|
||||
elseif self.grade == 1 and self.grade_history[2] == 4 then
|
||||
points_text = " ..|"
|
||||
elseif self.grade_history[2] == 0 then
|
||||
points_text = "|...."
|
||||
elseif self.grade_history[2] == 1 then
|
||||
points_text = ".|..."
|
||||
elseif self.grade_history[2] == 2 then
|
||||
points_text = "..|.."
|
||||
elseif self.grade_history[2] == 3 then
|
||||
points_text = "...|."
|
||||
elseif self.grade_history[2] == 4 then
|
||||
points_text = "....|"
|
||||
end
|
||||
if self.grade > 1 then points_text = '-'..points_text
|
||||
else points_text = ' '..points_text end
|
||||
if self.grade < 28 then points_text = points_text..'+' end
|
||||
drawText("Promotion\nMeter:", 100, 174, 1000, "left")
|
||||
if self.point_flash > 0 then
|
||||
drawBigText(points_text, 100, 208, 1000, "left", self.point_flash_color)
|
||||
else
|
||||
drawBigText(points_text, 100, 208, 1000, "left")
|
||||
end
|
||||
elseif self.grade_history[2] == 0 then
|
||||
points_text = "|...."
|
||||
elseif self.grade_history[2] == 1 then
|
||||
points_text = ".|..."
|
||||
elseif self.grade_history[2] == 2 then
|
||||
points_text = "..|.."
|
||||
elseif self.grade_history[2] == 3 then
|
||||
points_text = "...|."
|
||||
elseif self.grade_history[2] == 4 then
|
||||
points_text = "....|"
|
||||
end
|
||||
if self.grade > 1 then points_text = '-'..points_text
|
||||
else points_text = ' '..points_text end
|
||||
if self.grade < 28 then points_text = points_text..'+' end
|
||||
drawText("Promotion\nMeter:", 100, 174, 1000, "left")
|
||||
if self.point_flash > 0 then
|
||||
drawBigText(points_text, 100, 208, 1000, "left", self.point_flash_color)
|
||||
else
|
||||
drawBigText(points_text, 100, 208, 1000, "left")
|
||||
end
|
||||
end
|
||||
if (self.game_over or self.completed) and self.game_over_frames <= 50 and not self.input_playback and not self.training and not PENTO_MODE then
|
||||
drawText("SAVING, PLEASE WAIT", 232, 460, 1000, "left")
|
||||
@@ -1036,8 +1036,8 @@ function GameMode:drawScoringInfo()
|
||||
drawBigText(self.player_name:upper(), 100, 98, 1000, "left")
|
||||
drawText("Ver. 2", 550, 435, 1000, "left")
|
||||
if self.input_playback then
|
||||
self:drawSpeedStats(385, 99)
|
||||
self:drawLinesStats(385, 251)
|
||||
self:drawSpeedStats(385, 99)
|
||||
self:drawLinesStats(385, 251)
|
||||
love.graphics.setColor(0,0,0,0.5)
|
||||
love.graphics.rectangle("fill", 385+3, 348+3, 190, 50, 10, 10)
|
||||
love.graphics.setColor(0.05,0.05,0.05,1)
|
||||
@@ -1066,17 +1066,17 @@ function GameMode:drawBackground()
|
||||
if BACKGROUNDS[bg]:tell() >= limit then
|
||||
BACKGROUNDS[bg]:rewind()
|
||||
end
|
||||
if bg == 0 or bg == 8 or bg == 9 or bg == 3 then brightness = 0.7 end
|
||||
love.graphics.setColor(brightness, brightness, brightness, 1)
|
||||
if bg == 0 or bg == 8 or bg == 9 or bg == 3 then brightness = 0.7 end
|
||||
love.graphics.setColor(brightness, brightness, brightness, 1)
|
||||
love.graphics.draw(BACKGROUNDS[bg])
|
||||
end
|
||||
|
||||
function GameMode:drawFrame()
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.line(216,80,216,80+(16*self.grid.height))
|
||||
love.graphics.line(216+(16*self.grid.width),80,216+(16*self.grid.width),80+(16*self.grid.height))
|
||||
love.graphics.line(216,80+(16*self.grid.height),216+(16*self.grid.width),80+(16*self.grid.height))
|
||||
love.graphics.line(216,80,216+(16*self.grid.width),80)
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.line(216,80,216,80+(16*self.grid.height))
|
||||
love.graphics.line(216+(16*self.grid.width),80,216+(16*self.grid.width),80+(16*self.grid.height))
|
||||
love.graphics.line(216,80+(16*self.grid.height),216+(16*self.grid.width),80+(16*self.grid.height))
|
||||
love.graphics.line(216,80,216+(16*self.grid.width),80)
|
||||
love.graphics.setColor(0, 0, 0, 1)
|
||||
love.graphics.rectangle(
|
||||
"fill", 216, 80,
|
||||
|
||||
Reference in New Issue
Block a user