Sfoglia il codice sorgente

fix> 修改俄罗斯方块示例代码。

sybotan 4 anni fa
parent
commit
bde06bccc2
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      docs/.vuepress/components/engine/demo/elsfk.vue

+ 4 - 1
docs/.vuepress/components/engine/demo/elsfk.vue

@@ -15,7 +15,7 @@ import { SCanvas, SCanvasView, SPaint } from "sybotan-graph";
 import { SPaintStyle } from "sybotan-graph/lib";
 
 /**
- * 俄罗斯广场视图
+ * 俄罗斯方块视图
  *
  * @author  庞利祥 <sybotan@126.com>
  */
@@ -230,6 +230,7 @@ class TetrisView extends SCanvasView {
         this.gridPaint.fill = SColor.Red;
         this.gridPaint.style = SPaintStyle.Fill;
 
+        // 设置 GameOver 文本的颜色与字体
         this.textPaint.fill = SColor.Blue;
         this.textPaint.font.size = 40;
 
@@ -549,6 +550,8 @@ export default class Tetris1 extends Vue {
     reset(): void {
         // 初始化游戏
         this.view!!.init();
+        document.getElementById("tetris1")!!.focus();
     }
 }
 </script>
+