|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #module \
- Goatoh
-
- #defcfunc local \
- New \
- double p_initPosX,\
- double p_initPosY,\
- int p_initDirection
- posX.insNum = p_initPosX
- posY.insNum = p_initPosY
-
- ; 角度
- arg.insNum = 0.
-
- ; 首の角度
- neckArg.insNum = 0.
-
- walkVel.insNum = 3.
- walkAcl.insNum = 0.
-
- runVel.insNum = 5.
- runVel.insNum = 0.
-
- direction.insNum = p_initDirection
-
- walking.insNum = True
- running.insNum = False
- eating.insNum = False
- openingEyes.insNum = False
- openingMouth.insNum = False
-
- frame.insNum = 0
-
- insNum++
-
- Return insNum - 1
-
- #deffunc local \
- Walk \
- int p_insId
- If direction.p_insId = DIRECTION_LEFT {
- posX.p_insId -= walkVel.p_insId * Cos (arg.p_insId)
- posY.p_insId -= walkVel.p_insId * Sin (arg.p_insId)
- }
- Else {
- posX.p_insId += walkVel.p_insId * Cos (arg.p_insId)
- posY.p_insId += walkVel.p_insId * Sin (arg.p_insId)
- }
-
- Return
-
- #deffunc local \
- DoRun \
- int p_insId
- Return
-
- #deffunc local \
- Eat \
- int p_insId
- Return
-
- #deffunc local \
- Draw \
- int p_insId
- Pos posX.p_insId, posY.p_insId
- CelPut BUFFER_GOATOH_TAIL
-
- Pos posX.p_insId, posY.p_insId
- CelPut BUFFER_GOATOH_TARSO
-
- Pos posX.p_insId, posY.p_insId
- CelPut BUFFER_GOATOH_FACE_CC, 0, 1., 1., neckArg.p_insId
-
- Pos posX.p_insId, posY.p_insId
- CelPut BUFFER_GOATOH_HEAD, 0, 1., 1., neckArg.p_insId
-
- Pos posX.p_insId, posY.p_insId
- CelPut BUFFER_GOATOH_LEG
-
- Pos posX.p_insId, posY.p_insId
- CelPut BUFFER_GOATOH_LEG
-
- Pos posX.p_insId, posY.p_insId
- CelPut BUFFER_GOATOH_LEG
-
- Pos posX.p_insId, posY.p_insId
- CelPut BUFFER_GOATOH_LEG
-
- Interval@Goatoh p_insId
-
- Return
-
- #deffunc local \
- Interval \
- int p_insId
- If walking.p_insId {
- Walk@Goatoh p_insId
- }
- Else: If running.p_insId {
- DoRun@Goatoh p_insId
- }
-
- If eating.p_insId {
- Eat@Goatoh p_insId
- }
-
- frame.p_insId++
-
- Return
-
- #global
-
|