Skip to content

Instantly share code, notes, and snippets.

@tajuszk
Last active June 19, 2020 13:40
Show Gist options
  • Save tajuszk/2ee2d3b37418202444fdb85fbe10a057 to your computer and use it in GitHub Desktop.
Save tajuszk/2ee2d3b37418202444fdb85fbe10a057 to your computer and use it in GitHub Desktop.
// 攻撃したらパワーアップ
function attackA () {
attackBase(10) // ダメージ10を与える
powerUp() // attackAは攻撃力が上がる
}
// 効果はないけどダメージが強い
function attackB () {
attackBase(20) // ダメージ20を与える
}
// 全ての攻撃の共通処理
function attackBase (point) {
damage(point) // ダメージをpoint分与える
effect() // ダメージエフェクトを出す
comboCount++ // Comboカウントを増やす
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment