mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-25 06:19:03 -06:00
Compare commits
3 Commits
b5db5bbdc3
...
90cf2ebef5
Author | SHA1 | Date | |
---|---|---|---|
|
90cf2ebef5 | ||
|
799a905a9c | ||
|
985f73c39d |
@ -127,9 +127,6 @@ function GameMode:update(inputs, ruleset)
|
|||||||
inputs["up"] = false
|
inputs["up"] = false
|
||||||
inputs["down"] = false
|
inputs["down"] = false
|
||||||
end
|
end
|
||||||
if inputs["up"] then
|
|
||||||
inputs["down"] = false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- advance one frame
|
-- advance one frame
|
||||||
@ -498,14 +495,7 @@ function GameMode:initializeOrHold(inputs, ruleset)
|
|||||||
self:initializeNextPiece(inputs, ruleset, self.next_queue[1])
|
self:initializeNextPiece(inputs, ruleset, self.next_queue[1])
|
||||||
end
|
end
|
||||||
self:onPieceEnter()
|
self:onPieceEnter()
|
||||||
if not self.grid:canPlacePiece(self.piece) then
|
self:onEnterOrHold(inputs, ruleset)
|
||||||
self.game_over = true
|
|
||||||
return
|
|
||||||
end
|
|
||||||
ruleset:dropPiece(
|
|
||||||
inputs, self.piece, self.grid, self:getGravity(),
|
|
||||||
self:getDropSpeed(), self.drop_locked, self.hard_drop_locked
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function GameMode:hold(inputs, ruleset, ihs)
|
function GameMode:hold(inputs, ruleset, ihs)
|
||||||
@ -530,9 +520,18 @@ function GameMode:hold(inputs, ruleset, ihs)
|
|||||||
if ihs then playSE("ihs")
|
if ihs then playSE("ihs")
|
||||||
else playSE("hold") end
|
else playSE("hold") end
|
||||||
self:onHold()
|
self:onHold()
|
||||||
|
self:onEnterOrHold(inputs, ruleset)
|
||||||
|
end
|
||||||
|
|
||||||
|
function GameMode:onEnterOrHold(inputs, ruleset)
|
||||||
if not self.grid:canPlacePiece(self.piece) then
|
if not self.grid:canPlacePiece(self.piece) then
|
||||||
self.game_over = true
|
self.game_over = true
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
ruleset:dropPiece(
|
||||||
|
inputs, self.piece, self.grid, self:getGravity(),
|
||||||
|
self:getDropSpeed(), self.drop_locked, self.hard_drop_locked
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
function GameMode:initializeNextPiece(
|
function GameMode:initializeNextPiece(
|
||||||
|
Loading…
Reference in New Issue
Block a user