Skip to content

Commit

Permalink
Merge pull request #25 from hackforplay/add-variable-assets
Browse files Browse the repository at this point in the history
feat: へんすう関係のアセット追加
  • Loading branch information
RyoTaniguchi authored Sep 12, 2020
2 parents f438b67 + 07ba507 commit 0faca30
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 0 deletions.
72 changes: 72 additions & 0 deletions src/assets/へんすう/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
const sco = require('../../preference/scopes')
const cat = require('../../preference/categories')

const base = {
scopes: [
// sco.ゲームがはじまったとき,
sco.たおされたとき,
sco.しょうかんされたとき,
sco.つくられたとき,
sco.ぶつかったとき,
sco.こうげきされたとき,
sco.つねに,
sco.ふまれたとき,
sco.どかれたとき,
sco.メッセージされたとき,
sco.へんすうがかわったとき,
sco.すすめなかったとき,
sco.マップがかわったとき,
sco.みつけたとき,
sco.タップされたとき
],
module: null, // 改造ボタン用のコードへのパス. null の場合は改造不可
category: cat.システム, // カテゴリーの参照を指定する
production: false, // www.hackforplay.xyz に表示する場合は true. earlybird だけなら false
plan: 'free' // 'free' にする
}

const scopeDeclare = [sco.ゲームがはじまったとき]

const scopeUp = [
sco.たおされたとき,
sco.しょうかんされたとき,
sco.つくられたとき,
sco.ぶつかったとき,
sco.こうげきされたとき,
sco.つねに,
sco.ふまれたとき,
sco.どかれたとき,
sco.メッセージされたとき,
sco.へんすうがかわったとき,
sco.すすめなかったとき,
sco.マップがかわったとき,
sco.みつけたとき,
sco.タップされたとき
]

module.exports = [
{
...base,
name: 'へんすうをせってい',
description: 'へんすう「スコア」を0にする',
scopes: scopeDeclare,
icon: './variable_declare.png', // アセットのアイコンへのパス
insert: './variable_declare.js' // 追加ボタン用のコードへのパス. null の場合は追加不可
},
{
...base,
name: 'へんすうを1ふやす',
description: 'へんすう「スコア」に+1する',
scopes: scopeUp,
icon: './variable_up.png', // アセットのアイコンへのパス
insert: './variable_up.js' // 追加ボタン用のコードへのパス. null の場合は追加不可
},
{
...base,
name: 'へんすうでゲームクリア',
description: 'へんすう「スコア」が10のとき、ゲームクリア',
scopes: scopeUp,
icon: './variable_gameclear.png', // アセットのアイコンへのパス
insert: './variable_gameclear.js' // 追加ボタン用のコードへのパス. null の場合は追加不可
}
]
1 change: 1 addition & 0 deletions src/assets/へんすう/variable_declare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
へんすう['スコア'] = 0
Binary file added src/assets/へんすう/variable_declare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/へんすう/variable_gameclear.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if (へんすう['スコア'] === 10) {
ハック.ゲームクリア()
}
Binary file added src/assets/へんすう/variable_gameclear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/へんすう/variable_up.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
へんすう['スコア'] += 1
Binary file added src/assets/へんすう/variable_up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0faca30

Please sign in to comment.