mirror of
https://github.com/SashLilac/cambridge.git
synced 2025-05-13 20:21:25 -05:00
Compare commits
3 Commits
haileyjunk
...
a063f10d33
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a063f10d33 | ||
|
|
6e0b5e27c1 | ||
|
|
18e0e02c76 |
@@ -57,13 +57,13 @@ Coding conventions
|
|||||||
Use tabs to indent, spaces to align.
|
Use tabs to indent, spaces to align.
|
||||||
|
|
||||||
* Specifically, spaces should not appear at the beginning of a line, and tabs should not appear _except_ at the beginning of a line.
|
* Specifically, spaces should not appear at the beginning of a line, and tabs should not appear _except_ at the beginning of a line.
|
||||||
* The sole exception is in a multiline `if` statement; the initial `if` should have four spaces before it to align it with an `elseif` on the next line. For example:
|
* If you're aligning multiline if-statements, the initial "if", "elseif" or "else" should be flush left with the indentation level, with spaces padding the gap to the next word as necessary. For example:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
---- 4 spaces
|
if self.level < 900 then return 12
|
||||||
if self.level < 900 then return 12
|
elseif self.level < 1200 then return 8
|
||||||
elseif self.level < 1200 then return 8
|
else return 6
|
||||||
else return 6 end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
Comments at the end of lines of code must be one line long. Multi-line comments must appear in their own block.
|
Comments at the end of lines of code must be one line long. Multi-line comments must appear in their own block.
|
||||||
|
|||||||
@@ -530,6 +530,8 @@ 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
|
return
|
||||||
|
elseif self.piece:isDropBlocked(self.grid) then
|
||||||
|
playSE("bottom")
|
||||||
end
|
end
|
||||||
ruleset:dropPiece(
|
ruleset:dropPiece(
|
||||||
inputs, self.piece, self.grid, self:getGravity(),
|
inputs, self.piece, self.grid, self:getGravity(),
|
||||||
@@ -578,10 +580,6 @@ function GameMode:initializeNextPiece(
|
|||||||
self.piece_soft_locked = false
|
self.piece_soft_locked = false
|
||||||
self.buffer_hard_drop = false
|
self.buffer_hard_drop = false
|
||||||
self.buffer_soft_drop = false
|
self.buffer_soft_drop = false
|
||||||
if self.piece:isDropBlocked(self.grid) and
|
|
||||||
self.grid:canPlacePiece(self.piece) then
|
|
||||||
playSE("bottom")
|
|
||||||
end
|
|
||||||
if generate_next_piece == nil then
|
if generate_next_piece == nil then
|
||||||
table.remove(self.next_queue, 1)
|
table.remove(self.next_queue, 1)
|
||||||
table.insert(self.next_queue, self:getNextPiece(ruleset))
|
table.insert(self.next_queue, self:getNextPiece(ruleset))
|
||||||
|
|||||||
Reference in New Issue
Block a user