<!--pages/game/game.wxml-->
<view class="container">
<view>玩家得分:{{score}}</view>
<canvas canvas-id="gameCanvas" />
<view class="btnBox">
<button type="primary" size="mini" bind:tap="changeDirection" data-direct = "{{2}}" data-img = "up">↑</button>
<view>
<button type="primary" size="mini" bind:tap="changeDirection" data-direct = "{{1}}" data-img = "left">←</button>
<button type="primary" size="mini" bind:tap="changeDirection" data-direct = "{{-2}}" data-img = "down">↓</button>
<button type="primary" size="mini" bind:tap="changeDirection" data-direct = "{{-1}}" data-img="right">→</button>
</view>
<button type="primary" size="mini" bind:tap="initGame">重新开始</button>
</view>
</view>