すくすくゴートうちゃん Android 版(黒歴史)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

goatoh.mod.hsp 3.5 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. #ifndef __GOATOH__
  2. #define __GOATOH__
  3. #module \
  4. Goatoh
  5. #enum LEG_LF = 0
  6. #enum LEG_RF
  7. #enum LEG_LH
  8. #enum LEG_RH
  9. #enum LEG_DIRECTION_FRONT = 1
  10. #enum LEG_DIRECTION_HIND
  11. #defcfunc local \
  12. New \
  13. double p_initPosX,\
  14. double p_initPosY,\
  15. int p_initDirection
  16. posX.insNum = p_initPosX
  17. posY.insNum = p_initPosY
  18. If Length2 (legArgs) = 0 {
  19. DDim legArgs, 4, 1
  20. }
  21. If Length2 (legDirections) = 0 {
  22. Dim legDirections, 4, 1
  23. }
  24. legArgs.LEG_LF.insNum = 0.
  25. legArgs.LEG_RF.insNum = 0.
  26. legArgs.LEG_LH.insNum = 0.
  27. legArgs.LEG_RH.insNum = 0.
  28. legDirections.LEG_LF.insNum = LEG_DIRECTION_FRONT
  29. legDirections.LEG_RF.insNum = LEG_DIRECTION_HIND
  30. legDirections.LEG_LH.insNum = LEG_DIRECTION_HIND
  31. legDirections.LEG_RH.insNum = LEG_DIRECTION_FRONT
  32. scale.insNum = 2.
  33. ; 角度
  34. arg.insNum = 0.
  35. ; 首の角度
  36. neckArg.insNum = 0.
  37. walkVel.insNum = 3.
  38. walkAcl.insNum = 0.
  39. runVel.insNum = 5.
  40. runVel.insNum = 0.
  41. direction.insNum = p_initDirection
  42. walking.insNum = True
  43. running.insNum = False
  44. eating.insNum = False
  45. openingEyes.insNum = False
  46. openingMouth.insNum = False
  47. frame.insNum = 0
  48. insNum++
  49. Return insNum - 1
  50. #deffunc local \
  51. Walk \
  52. int p_insId
  53. If direction.p_insId = DIRECTION_LEFT {
  54. posX.p_insId -= walkVel.p_insId * Cos (arg.p_insId)
  55. posY.p_insId -= walkVel.p_insId * Sin (arg.p_insId)
  56. }
  57. Else {
  58. posX.p_insId += walkVel.p_insId * Cos (arg.p_insId)
  59. posY.p_insId += walkVel.p_insId * Sin (arg.p_insId)
  60. }
  61. Repeat 4
  62. If legDirections.cnt.p_insId = LEG_DIRECTION_FRONT {
  63. legArgs.cnt.p_insId += Deg2Rad (1)
  64. }
  65. Else {
  66. legArgs.cnt.p_insId -= Deg2Rad (1)
  67. }
  68. If legArgs.cnt.p_insId > Deg2Rad (15) {
  69. legDirections.cnt.p_insId = LEG_DIRECTION_HIND
  70. }
  71. Else: If legArgs.cnt.p_insId < Deg2Rad (-15) {
  72. legDirections.cnt.p_insId = LEG_DIRECTION_FRONT
  73. }
  74. Loop
  75. Return
  76. #deffunc local \
  77. DoRun \
  78. int p_insId
  79. Return
  80. #deffunc local \
  81. Eat \
  82. int p_insId
  83. Return
  84. #deffunc local \
  85. Draw
  86. Repeat insNum
  87. Pos posX.cnt - scale.cnt * 50, posY.cnt + scale.cnt * 26
  88. CelPut BUFFER_GOATOH_LEG, 0, scale.cnt, scale.cnt, legArgs.LEG_RF.cnt
  89. Pos posX.cnt + scale.cnt * 30, posY.cnt + scale.cnt * 26
  90. CelPut BUFFER_GOATOH_LEG, 0, scale.cnt, scale.cnt, legArgs.LEG_RH.cnt
  91. Pos posX.cnt + scale.cnt * 64, posY.cnt - scale.cnt * 12
  92. CelPut BUFFER_GOATOH_TAIL, 0, scale.cnt, scale.cnt
  93. Pos posX.cnt, posY.cnt
  94. CelPut BUFFER_GOATOH_TARSO, 0, scale.cnt, scale.cnt
  95. Pos posX.cnt - scale.cnt * 30, posY.cnt + scale.cnt * 30
  96. CelPut BUFFER_GOATOH_LEG, 0, scale.cnt, scale.cnt, legArgs.LEG_LF.cnt
  97. Pos posX.cnt + scale.cnt * 50, posY.cnt + scale.cnt * 30
  98. CelPut BUFFER_GOATOH_LEG, 0, scale.cnt, scale.cnt, legArgs.LEG_LH.cnt
  99. Pos posX.cnt - scale.cnt * 64, posY.cnt - scale.cnt * 20
  100. CelPut BUFFER_GOATOH_HEAD, 0, scale.cnt, scale.cnt, neckArg.cnt
  101. Pos posX.cnt - scale.cnt * 64, posY.cnt - scale.cnt * 20
  102. If openingEyes {
  103. If openingMouth {
  104. CelPut BUFFER_GOATOH_FACE_OO, 0, scale.cnt, scale.cnt, neckArg.cnt
  105. }
  106. Else {
  107. CelPut BUFFER_GOATOH_FACE_OC, 0, scale.cnt, scale.cnt, neckArg.cnt
  108. }
  109. }
  110. Else {
  111. If openingMouth {
  112. CelPut BUFFER_GOATOH_FACE_CO, 0, scale.cnt, scale.cnt, neckArg.cnt
  113. }
  114. Else {
  115. CelPut BUFFER_GOATOH_FACE_CC, 0, scale.cnt, scale.cnt, neckArg.cnt
  116. }
  117. }
  118. Loop
  119. Interval@Goatoh
  120. Return
  121. #deffunc local \
  122. Interval
  123. Repeat insNum
  124. If walking.cnt {
  125. Walk@Goatoh cnt
  126. If frame.cnt \ 150 == 30 {
  127. MMPlay SOUND_MUMUMUMU
  128. openingMouth = True
  129. }
  130. }
  131. Else: If running.cnt {
  132. DoRun@Goatoh cnt
  133. }
  134. If eating.cnt {
  135. Eat@Goatoh cnt
  136. }
  137. frame.cnt++
  138. Loop
  139. Return
  140. #global
  141. #endif ; not __GOATOH__