ソースコード:2022年度ゲーム部門審査員特別賞「デコピン野郎」

2022年度ゲーム部門審査員特別賞 「デコピン野郎」を元に、ブラウザ上でRubyグラフィックプログラミングができる「rbCanvas/p5」(https://rbcanvas.net/p5/)に移植しました。 そのソースコードの紹介をしています。

main


  1. # 初期設定用のコード (your setup code here)
  2. def setup
  3. createCanvas(800, 448)
  4.  
  5. angleMode(DEGREES)
  6. @stage = Stage.new # ステージの生成
  7. @image_continue = loadImage("scene_continue.png") # 選択画面用イメージのロード
  8. @sound_bgm = loadSound("bgm.mp3") # BGMのロード
  9. @sound_bgm.setLoop(true) # BGMの繰り返し再生
  10. @scene = :continue # 初期画面の設定
  11. @choi = 1 # 選択ステージ番号
  12. @xyd = 5 # 選択枠の太さ
  13. end
  14.  
  15. # 画面描画用のコード (your draw code here)
  16. def draw
  17. background(220)
  18. case @scene
  19. when :gamemain # ゲームプレイ画面
  20. scene_gamemain
  21. when :gameover # ゲームオーバー画面
  22. scene_gameover
  23. when :continue # ゲーム継続選択画面
  24. scene_continue
  25. end
  26. end
  27.  
  28. def scene_gamemain
  29. #@sound_bgm.play if !@sound_bgm.isPlaying
  30. status = @stage.play
  31. if status == false
  32. @scene = :gameover
  33. @choi = @stage.st_no
  34. @sound_bgm.stop
  35. end
  36. end
  37.  
  38. def scene_gameover
  39. # ゲームオーバー
  40. push do
  41. fill("white")
  42. rect(0, 0, width, height)
  43. push do
  44. textAlign(CENTER)
  45. fill("brown")
  46. textSize(48)
  47. text("G A M E O V E R", width / 2, 200)
  48. fill("black")
  49. textSize(20)
  50. text("つぎ頑張ろう", width / 2, 250)
  51. end
  52. fill("black")
  53. textSize(25)
  54. text("ENTERでステージ選択", 520, 410)
  55. end
  56. end
  57.  
  58. def scene_continue
  59. image(@image_continue, 0, 0)
  60. push do
  61. strokeWeight(@xyd)
  62. stroke("yellow")
  63. noFill
  64. x = 50 + ((@choi - 1) % 3) * 250
  65. y = 28 + ((@choi - 1) / 3).floor * 140
  66. w = 200
  67. h = 112
  68. rect(x, y, w, h, 5)
  69. end
  70. # x = 50 + ((@choi - 1) % 3) * 250 # 50, 300, 550, 50, 300, 550, 50, 300, 550
  71. # y = 28 + ((@choi - 1) / 3).floor * 140 # 28, 28, 28, 168, 168, 168, 196, 196, 196
  72. # w = 200
  73. # h = 112
  74.  
  75. # 枠の太さを変化(strokeWeight 8~0)
  76. @xyd -= 0.3
  77. @xyd = 8 if @xyd <= 0
  78. end
  79.  
  80. def keyReleased
  81. case @scene
  82. when :gamemain
  83. if keyCode == ESCAPE # ゲーム中止
  84. @scene = :continue # ステージ選択
  85. @sound_bgm.stop
  86. end
  87. when :gameover
  88. if keyCode == ENTER
  89. @scene = :continue # ステージ選択
  90. end
  91. when :continue
  92. # カーソルキーによるステージ選択
  93. if keyCode == RIGHT_ARROW
  94. @choi += 1
  95. @choi = 1 if @choi > 9 # ステージ9より大きい場合はステージ1
  96. end
  97. if keyCode == LEFT_ARROW
  98. @choi -= 1
  99. @choi = 9 if @choi < 1 # ステージ1より小さい場合はステージ9
  100. end
  101. #if keyCode == DOWN_ARROW
  102. # if @choi == 9
  103. # @choi = 1 # ステージ9の場合はステージ1
  104. # else
  105. # @choi += 3 # 下列のステージ
  106. # @choi -= 8 if @choi > 9 # 9より大きい場合は 8を引いた値のステージ
  107. # end
  108. #end
  109. #if keyCode == UP_ARROW
  110. # if @choi == 1
  111. # @choi = 9 # ステージ1の場合はステージ9
  112. # else
  113. # @choi -= 3 # 上列のステージ
  114. # @choi += 8 if @choi < 1 # 1より小さい場合は 8を足した値のステージ
  115. # end
  116. #end
  117. if keyCode == ENTER
  118. # ステージ決定
  119. @sound_bgm.play if !@sound_bgm.isPlaying
  120. @stage.select(@choi)
  121. @scene = :gamemain
  122. end
  123. end
  124. end

 

face

  1. # 追加のコード (your supplementary code here)
  2. class Face
  3. FRICTION = 0.99 # 移動するときの減速率
  4. FALL = 0.88 # 穴に入るときの縮小率
  5. attr_reader :x,:y, :r, :speed,:angle,:scale,:st_no
  6.  
  7. def initialize
  8. @image = loadImage("face.png").colorKey("white") # イメージのロード
  9. @sound_collision = loadSound("effect_collision.mp3") # 効果音(衝突)
  10. @r = @image.width / 2 # 顔の半径
  11. _init # 初期化処理
  12. end
  13.  
  14. # 初期化
  15. def _init
  16. @angle = 0 # 顔のデコピンの角度の初期値
  17. @speed = 0 # 顔の速度の初期値
  18. @roll = 0 # 顔の回転の初期値
  19. @scale = 1 # 顔の大きさの初期値
  20. @alpha = 0 # 顔の透明度の初期値
  21. end
  22.  
  23. #クリアしたときのリセット
  24. def reset
  25. _init # 初期化処理
  26. end
  27.  
  28. # 座標の設定
  29. def set_position(x, y)
  30. @x = x
  31. @y = y
  32. end
  33.  
  34. # マップ情報の設定
  35. def set_map(map)
  36. @map = map
  37. end
  38.  
  39. # ブロックかどうかの判定
  40. def block?(x, y)
  41. mx = floor(x / 32)
  42. my = floor(y / 32)
  43. if @map[my][mx] == 1
  44. return true # 当該座標の位置はブロックである
  45. end
  46. return false # 当該座標は位置はブロックではない
  47. end
  48.  
  49. # デコピンされたときの初期処理
  50. def shoot(speed, angle)
  51. @speed = speed # 速さ
  52. @angle = angle # 角度
  53. end
  54.  
  55. # 顔の動き
  56. def move
  57. @speed *= FRICTION #speedに摩擦係数をかけてだんだんと速度を落とす
  58. if @speed <= 0.8
  59. @speed = 0
  60. @speed = 0
  61. end
  62.  
  63. # 現在座標を退避
  64. tx = @x # x座標
  65. ty = @y # y座標
  66.  
  67. # 移動量
  68. dx = -cos(@angle) * @speed * 0.3
  69. dy = sin(@angle) * @speed * 0.3
  70.  
  71. # 移動後座標
  72. @x += dx
  73. @y += dy
  74.  
  75. # ブロックとの隙間(衝突判定時)
  76. gap = 1
  77.  
  78. # キャンバス枠の処理
  79. if @x > width - @r
  80. # 右側に当たった時の反射
  81. @x = width - @r
  82. @angle = 180 - @angle
  83. if @sound_collision.isPlaying
  84. @sound_collision.stop
  85. else
  86. @sound_collision.play
  87. end
  88. end
  89. if @x < 0 + @r
  90. # 左側に当たった時の反射
  91. @x = 0 + @r
  92. @angle = 180 - @angle
  93. if @sound_collision.isPlaying
  94. @sound_collision.stop
  95. else
  96. @sound_collision.play
  97. end
  98. end
  99. if @y > height - @r
  100. # 下に当たった時の反射
  101. @y = height - @r
  102. @angle = 360 - @angle
  103. if @sound_collision.isPlaying
  104. @sound_collision.stop
  105. else
  106. @sound_collision.play
  107. end
  108. end
  109. if @y < 0 + @r
  110. # 上に当たった時の反射
  111. @y = 0 + @r
  112. @angle = 360 - @angle
  113. if @sound_collision.isPlaying
  114. @sound_collision.stop
  115. else
  116. @sound_collision.play
  117. end
  118. end
  119.  
  120. # ブロックとの衝突判定
  121. collision_r = false # 右側面
  122. collision_l = false # 左側面
  123. collision_u = false # 上側面
  124. collision_d = false # 下側面
  125.  
  126. # 顔の上下左右から徐々に斜めのポイントをチェック
  127. (0..45).step(11.25) do |th|
  128. # 右側面
  129. th1 = 0 + th
  130. th2 = 0 - th
  131. if block?(@x + (@r - gap) * cos(th1), @y - (@r - gap) * sin(th1)) or
  132. block?(@x + (@r - gap) * cos(th2), @y - (@r - gap) * sin(th2))
  133. collision_r = true
  134. #noLoop
  135. break
  136. end
  137. # 左側面
  138. th1 = 180 + th
  139. th2 = 180 - th
  140. if block?(@x + (@r - gap) * cos(th1), @y - (@r - gap) * sin(th1)) or
  141. block?(@x + (@r - gap) * cos(th2), @y - (@r - gap) * sin(th2))
  142. collision_l = true
  143. #noLoop
  144. break
  145. end
  146. # 上側面
  147. th1 = 90 + th
  148. th2 = 90 - th
  149. if block?(@x + (@r - gap) * cos(th1), @y - (@r - gap) * sin(th1)) or
  150. block?(@x + (@r - gap) * cos(th2), @y - (@r - gap) * sin(th2))
  151. collision_u = true
  152. #noLoop
  153. break
  154. end
  155. # 下側面
  156. th1 = 270 + th
  157. th2 = 270 - th
  158. if block?(@x + (@r - gap) * cos(th1), @y - (@r - gap) * sin(th1)) or
  159. block?(@x + (@r - gap) * cos(th2), @y - (@r - gap) * sin(th2))
  160. collision_d = true
  161. #noLoop
  162. break
  163. end
  164. end
  165.  
  166. # 跳ね返りによる座標と角度の変化
  167. if collision_r or collision_l or collision_u or collision_d
  168. @x = tx # x座標復元
  169. @y = ty # y座標復元
  170. if @sound_collision.isPlaying
  171. # 無条件に stop, playを繰り返すと
  172. #「DOMException: The play() request was interrupted by a call to pause()」エラー
  173. @sound_collision.stop
  174. else
  175. @sound_collision.play
  176. end
  177. end
  178. if collision_r or collision_l
  179. # 右側または左側が衝突
  180. @x = floor(tx / 32) * 32 + 16 # x座標調整(メッシュの中央座標に調整)
  181. @angle = 180 - @angle # x方向角度反転
  182. end
  183. if collision_u or collision_d
  184. # 上側または下側が衝突
  185. @y = floor(ty / 32) * 32 + 16 # y座標復元(メッシュの中央座標に調整)
  186. @angle = 360 - @angle # y方向角度反転
  187. end
  188.  
  189. # 回転の処理
  190. @roll += (@speed * 0.3)
  191. if @roll <= 1
  192. @roll = 0
  193. end
  194. end
  195.  
  196. # 穴に入ったときの吸い込み処理
  197. def fall(hx, hy)
  198. # 縮小
  199. @scale *= FALL
  200. # 追尾をして穴に入れる
  201. @x += 1 if @x < hx
  202. @x -= 1 if @x > hx
  203. @y += 1 if @y < hy
  204. @y -= 1 if @y > hy
  205. end
  206.  
  207. # 顔の表示
  208. def draw
  209. @alpha += 1
  210. if @alpha >= 255
  211. @alpha = 255
  212. end
  213. push do
  214. angleMode(DEGREES) # 角度の単位を度数に設定(デフォルトは弧度(ラジアン))
  215. translate(@x, @y) # 顔の位置座標を原点に設定
  216. rotate(@roll) # 座標軸の回転
  217. imageMode(CENTER) # イメージの中心座標を基点に設定
  218. tint(255, @alpha) # フェードイン
  219. sw = @image.width * @scale
  220. sh = @image.height * @scale
  221. image(@image, 0, 0, sw, sh) # イメージを描画
  222. end
  223. end
  224. end
  225.  

 

finger

  1. # 追加のコード (your supplementary code here)
  2. class Finger
  3. attr_reader :shot
  4. def initialize(face)
  5. @images = []
  6. @images << loadImage("finger.png").colorKey("white")
  7. @images << loadImage("pin1.png").colorKey("white")
  8. @images << loadImage("pin2.png").colorKey("white")
  9. @sound_beam = loadSound("effect_beam.mp3") # 効果音
  10. @face = face
  11. _init
  12. end
  13.  
  14. # 初期化
  15. def _init
  16. @shot = 10 # デコピン回数
  17. @angle = 0 # デコピン角度
  18. @strength = 0 # デコピン強さ
  19. @inc = 1 # デコピン強さの増分
  20. @animation = 0 # アニメーション用添字
  21. end
  22.  
  23. # リセット
  24. def reset
  25. _init
  26. end
  27.  
  28. # 描画
  29. def _draw
  30. push do
  31. translate(@face.x, @face.y)
  32. rotate(@angle)
  33. imageMode(CENTER)
  34. image(@images[@animation], 0, 30)
  35. noStroke
  36. fill(255, 215, 0, @strength * 2 + 100) # ゴールド(強さに応じてα値変動)
  37. rect(10, 30, 10, -@strength, 3)
  38. end
  39. end
  40.  
  41. # プレイヤーによる操作
  42. def _pin
  43. if keyIsDown(RIGHT_ARROW)
  44. @angle -= 1
  45. elsif keyIsDown(LEFT_ARROW)
  46. @angle += 1
  47. end
  48. if keyIsDown(SPACE)
  49. @strength += @inc
  50. if @strength > 50
  51. @inc = -1 # 上限に達したら減少
  52. elsif @strength <= 0
  53. @inc = +1 # 下限に達したら増加
  54. end
  55. if @strength < 20
  56. @animation = 0 # インデックス0(標準の指)
  57. elsif @strength < 35
  58. @animation = 1 # インデックス1(中)
  59. else
  60. @animation = 2 # インデックス2(強)
  61. end
  62. else
  63. if @strength != 0
  64. @face.shoot(@strength, -(@angle + 90)) # デコピン!
  65. @strength = 0
  66. @animation = 0
  67. @shot -= 1
  68. @sound_beam.play
  69. end
  70. end
  71. end
  72.  
  73. # デコピン
  74. def pin
  75. _draw
  76. _pin
  77. end
  78. end
  79.  

 

hole

  1. # 追加のコード (your supplementary code here)
  2. class Hole
  3. attr_reader :x, :y, :r
  4.  
  5. def initialize
  6. @image = loadImage("hole.png").colorKey("white")
  7. @r = @image.width / 2 # 穴の半径
  8. @scale = 1.5 # 穴の描画時の拡大率(顔との衝突判定は @rを使用)
  9. @alpha = 0 # 穴の不透明度
  10. end
  11.  
  12. # リセット
  13. def reset
  14. @alpha = 0
  15. end
  16.  
  17. # 穴の位置を設定
  18. def set_position(x, y)
  19. @x = x
  20. @y = y
  21. end
  22.  
  23. # 穴の描画
  24. def draw
  25. @alpha += 1 # 255まで1を足し続けてだんだんと穴が表示されるようにする
  26. if @alpha >= 255
  27. @alpha = 255
  28. end
  29. push do
  30. imageMode(CENTER) # イメージの中心座標を基点に設定
  31. translate(@x, @y)
  32. scale(@scale)
  33. tint(255, @alpha) # フェードイン
  34. image(@image, 0, 0) # イメージを描画
  35. end
  36. end
  37.  
  38. end
  39.  

 

stage

  1. # 追加のコード (your supplementary code here)
  2. class Stage
  3. attr_accessor :st_no
  4.  
  5. def initialize
  6. _set_images # イメージのロード
  7. _set_map_tile # マップタイルのロード
  8. _set_map # マップ情報の設定
  9.  
  10. @h = @map[0].size # ステージの高さ(縦タイル数) 14
  11. @w = @map[0][0].size # ステージの幅(横タイル数) 25
  12.  
  13. @face = Face.new # 顔の生成
  14. @hole = Hole.new # 穴の生成
  15. @finger = Finger.new(@face) # 指の生成
  16. @effect_fall = loadSound("effect_fall.mp3") # 効果音(穴)
  17. @st_no = 1 # ステージ番号
  18. _init # 初期化処理
  19. end
  20.  
  21. # 初期化
  22. def _init
  23. _set_pos(@face, 2)
  24. _set_pos(@hole, 3)
  25. @face.set_map(@map[@st_no - 1])
  26. @face.reset
  27. @finger.reset
  28. @hole.reset
  29. end
  30.  
  31. # 顔および穴の位置を設定
  32. def _set_pos(obj, number)
  33. @w.times do |i|
  34. @h.times do |j|
  35. value = @map[@st_no - 1][j][i]
  36. if value == number
  37. obj.set_position(i * 32 + 16, j * 32 + 16)
  38. return
  39. end
  40. end
  41. end
  42. # map上に情報がない場合はランダムに位置を決める(ステージ1~2)
  43. obj.set_position(rand(16..(width - 16)), rand(16..(height - 16)))
  44. end
  45.  
  46. # 次のステージに遷移
  47. def _next_stage
  48. next_no = @st_no + 1
  49. next_no = 1 if next_no > 9
  50. @st_no = next_no
  51. _init
  52. end
  53.  
  54. # ステージの選択
  55. def select(st_no)
  56. @st_no = st_no
  57. _init
  58. end
  59.  
  60. # ステージ描画
  61. def _draw
  62. # 背景画像
  63. image(@images[@st_no], 0, 0)
  64. # ブロック
  65. @w.times do |i|
  66. @h.times do |j|
  67. value = @map[@st_no - 1][j][i]
  68. image(@map_tile[value], 32 * i, 32 * j)
  69. end
  70. end
  71. # 文字
  72. push do
  73. fill("gold")
  74. textFont("sans-serif")
  75. textStyle(BOLD)
  76. textSize(26)
  77. text("Stage#{@st_no}", 470, 30)
  78. text("残り#{@finger.shot}回", 600, 30)
  79. end
  80. # 穴
  81. @hole.draw
  82. # 顔
  83. @face.draw
  84. @face.move
  85. end
  86.  
  87. # 顔が穴に入ったかどうかの判定
  88. def _fall?
  89. d = dist(@face.x, @face.y, @hole.x, @hole.y)
  90. if @face.speed <= 2 and d <= @face.r + @hole.r
  91. return true # 穴に入った
  92. else
  93. return false # 穴に入っていない
  94. end
  95. end
  96.  
  97. # ゲームプレイ
  98. def play
  99. _draw # 描画
  100. if _fall?
  101. # 穴に入った場合
  102. @face.fall(@hole.x, @hole.y) # 吸い込み処理
  103. if @face.speed <= 0 # 顔が停止したら次ステージに遷移
  104. _next_stage
  105. end
  106. @effect_fall.play
  107. else
  108. if @face.speed == 0 # 顔が停止した場合
  109. if @finger.shot > 0
  110. @finger.pin # デコピン回数が残っていれば指を表示
  111. else
  112. return false # デコピン回数が残っていなければゲームオーバー
  113. end
  114. end
  115. end
  116. return true # プレイ継続
  117. end
  118.  
  119. # イメージのロードと配列への格納
  120. def _set_images
  121. @images = []
  122. @images << nil
  123. @images << loadImage("st01_mt.fuji.png")
  124. @images << loadImage("st02_jinja.png")
  125. @images << loadImage("st03_konjikidou.png")
  126. @images << loadImage("st04_tajimaha.png")
  127. @images << loadImage("st05_tenryou.png")
  128. @images << loadImage("st06_efferutou.png")
  129. @images << loadImage("st07_pisya.png")
  130. @images << loadImage("st08_colosseum.png")
  131. @images << loadImage("st09_moai.png")
  132. end
  133.  
  134. # マップタイル情報の設定
  135. def _set_map_tile
  136. @map_tile = []
  137. @map_tile[0] = createImage(32, 32) # 背景(透明)
  138. @map_tile[1] = loadImage("block.png") # ブロック
  139. @map_tile[2] = createImage(32, 32) # 顔
  140. @map_tile[3] = createImage(32, 32) # 穴
  141. end
  142.  
  143. # マップ情報の設定
  144. def _set_map
  145. #ブロックのマップデータ
  146. # 0: 背景(透明)
  147. # 1: ブロック
  148. # 2: 顔
  149. # 3: 穴
  150. @map = [
  151. [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  152. [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  153. [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  154. [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  155. [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  156. [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  157. [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  158. [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  159. [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  160. [0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
  285. ]
  286. end
  287. end
こんな作品を作ってみたい人はRubyを学ぼうからチャレンジしてみよう。
 Ruby学習サイト(https://www.ruby-procon.net/study/category/siteinfo/rubyonrails/
S