仿照 tetris ,只做了一些必须的部分,有些游戏玩法和动画没有做出来,(难)
- Q,左旋
- E,右旋
- S,下落
- Space,快速下落
- 鼠标右键,切换Hold
- start,开始部分的场景
- game,游戏主场景
- board,主要逻辑节点
- piece,封装俄罗斯方块的最小单元
- line,封装的行
- tetromino,封装的俄罗斯方块
- tetroino_tip,封装的提示
参照
tetromino.gd 的 init()
注意:需要将节点添加到场景树后(也就是add_child),再对子节点进行操作,不然会提示Null的错误
参照
tetromino.gd 的 transform_pieces()
tetromino下落锁定后,会将piece的父节点改为line,然后再判断line的piece节点个数是否达到最大列数
通过多个piece的动画结束后的信号通知,来判断该行piece动画全部结束