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