fix issue with block placement
This commit is contained in:
@@ -52,3 +52,13 @@ class AirBlock(Block):
|
||||
|
||||
def __init__(self, x: int, y: int):
|
||||
super().__init__(x, y)
|
||||
|
||||
|
||||
class WaterBlock(Block):
|
||||
id = 'water'
|
||||
color = COLORS.get(id)
|
||||
flowable = True
|
||||
collision = False
|
||||
|
||||
def __init__(self, x: int, y: int):
|
||||
super().__init__(x, y)
|
||||
@@ -1,4 +1,5 @@
|
||||
from module import WIDTH, HEIGHT, JUMP_FORCE
|
||||
from module.block import AirBlock
|
||||
|
||||
|
||||
# 玩家类
|
||||
@@ -8,7 +9,7 @@ class Player:
|
||||
self.y = HEIGHT // 2
|
||||
self.velocity = 0
|
||||
self.on_ground = False
|
||||
self.selected_block = "grass"
|
||||
self.selected_block = AirBlock
|
||||
|
||||
def move(self, dx, dy):
|
||||
new_x = self.x + dx
|
||||
|
||||
Reference in New Issue
Block a user