Construct2で2Dゲームを作る(30)

ライフを追加します。

今回追加するライフの画像はこちら。画面上で適宜サイズ調整をしてください。

  • HUDレイヤーを選択しハートの画像を左上に配置
  • 先ほど作成したSprite fontを右側にコピペ
  • 右側の新たにペーストした方のテキストを選択し、Properties → type: life
  • 画面上のbirdをクリックし Properties → Instance variables → Add new
  • Name: life, Type: Number, Initial value: 5 → OK
  • Event sheet に移動し、Sprite font のイベント全体を選択しコピペ
  • コピペしたイベントの type = “star” 部分をダブルクリックし value に ”life” を入力
  • ペーストした方のイベントの “Set text to Star” をダブルクリック
  • Text: bird.life と入力(”.” は “bird の life” という意味です)

Leave a Reply

Your email address will not be published. Required fields are marked *