Browse Source

ゴートう構築

main
Miteruzo 1 year ago
parent
commit
63f1bc15c5
4 changed files with 56 additions and 24 deletions
  1. +3
    -1
      android/.gitignore
  2. BIN
      android/icon.png
  3. +31
    -7
      android/main.hsp
  4. +22
    -16
      android/modules/goatoh.mod.hsp

+ 3
- 1
android/.gitignore View File

@@ -1,7 +1,9 @@
/hscl.ini
/main.ax
/main.cpp
/main.html
/main.data
/obj
/modules/obj
/modules/hscl.ini
/hsp3dish.js

BIN
android/icon.png View File

Before After
Width: 512  |  Height: 512  |  Size: 132 KiB

+ 31
- 7
android/main.hsp View File

@@ -1,5 +1,9 @@
#include "hsp3dish.as"

; 画面サイズ
#const global DISPLAY_WIDTH 1080
#const global DISPLAY_HEIGHT 1920

; バッファ
#enum global BUFFER_GOATOH_FACE_CC = 1 ; ゴートうの顔(閉眼,閉口)
#enum global BUFFER_GOATOH_FACE_CO ;       (閉眼,開口)
@@ -28,25 +32,39 @@


#ifdef _DEBUG
Screen 0, 540, 960

; デバッグ時は assets ディレクトリを参照する.
ChDir "assets"
#endif ; not _DEBUG

ViewCalc VPTYPE_2D, Double (gInfo_winX) / DISPLAY_WIDTH, Double (gInfo_winY) / DISPLAY_HEIGHT

; 背景
CelLoad "bg.jpg", BUFFER_BG

; ゴートうバッファ
CelLoad "goatoh-face-closed-closed.png", BUFFER_GOATOH_FACE_CC
CelLoad "goatoh-face-closed-open.png", BUFFER_GOATOH_FACE_CO
CelLoad "goatoh-face-open-closed.png", BUFFER_GOATOH_FACE_OC
CelLoad "goatoh-face-open-open.png", BUFFER_GOATOH_FACE_OO
; ゴートうの顔
files = "goatoh-face-closed-closed.png", "goatoh-face-closed-open.png", "goatoh-face-open-closed.png", "goatoh-face-open-open.png"
ids = BUFFER_GOATOH_FACE_CC, BUFFER_GOATOH_FACE_CO, BUFFER_GOATOH_FACE_OC, BUFFER_GOATOH_FACE_OO
Repeat 4
CelLoad files.cnt, ids.cnt
CelDiv ids.cnt, 0, 0, 100, 111
Loop

CelLoad "goatoh-head.png", BUFFER_GOATOH_HEAD
CelDiv BUFFER_GOATOH_HEAD, 0, 0, 77, 143

CelLoad "goatoh-leg.png", BUFFER_GOATOH_LEG
CelDiv BUFFER_GOATOH_LEG, 0, 0, 48, 29

CelLoad "goatoh-tail.png", BUFFER_GOATOH_TAIL
CelDiv BUFFER_GOATOH_TAIL, 0, 0, 22, 33

CelLoad "goatoh-tarso.png", BUFFER_GOATOH_TARSO
CelDiv BUFFER_GOATOH_TARSO, 0, 0, 97, 49

; ゴートうインスタンス生成
Goatoh = New@Goatoh (0., 0., DIRECTION_LEFT)
Goatoh = New@Goatoh (540, 800, DIRECTION_LEFT)

; サウンド読込み
MMLoad "mumumumu.wav", SOUND_MUMUMUMU
@@ -61,9 +79,15 @@
Repeat
ReDraw False
Pos 0, 0
CelPut BUFFER_BG
CelPut BUFFER_BG, 0, Double (DISPLAY_HEIGHT) / 533, Double (DISPLAY_HEIGHT) / 533

Draw@Goatoh Goatoh

Pos 0, 0
Print StrF ("gInfo_winX: %4d", gInfo_winX)
Print StrF ("gInfo_winY: %4d", gInfo_winY)
Print StrF ("gInfo_dispX: %4d", gInfo_dispX)
Print StrF ("gInfo_dispY: %4d", gInfo_dispY)
ReDraw True

Await LOOP_INTERVAL


+ 22
- 16
android/modules/goatoh.mod.hsp View File

@@ -9,6 +9,8 @@ New \
posX.insNum = p_initPosX
posY.insNum = p_initPosY

scale.insNum = 2.

; 角度
arg.insNum = 0.

@@ -23,7 +25,7 @@ New \

direction.insNum = p_initDirection

walking.insNum = True
walking.insNum = False
running.insNum = False
eating.insNum = False
openingEyes.insNum = False
@@ -62,29 +64,29 @@ Eat \
#deffunc local \
Draw \
int p_insId
Pos posX.p_insId, posY.p_insId
CelPut BUFFER_GOATOH_TAIL
Pos posX.p_insId - scale.p_insId * 50, posY.p_insId + scale.p_insId * 26
CelPut BUFFER_GOATOH_LEG, 0, scale.p_insId, scale.p_insId

Pos posX.p_insId, posY.p_insId
CelPut BUFFER_GOATOH_TARSO
Pos posX.p_insId + scale.p_insId * 30, posY.p_insId + scale.p_insId * 26
CelPut BUFFER_GOATOH_LEG, 0, scale.p_insId, scale.p_insId

Pos posX.p_insId, posY.p_insId
CelPut BUFFER_GOATOH_FACE_CC, 0, 1., 1., neckArg.p_insId
Pos posX.p_insId + scale.p_insId * 64, posY.p_insId - scale.p_insId * 12
CelPut BUFFER_GOATOH_TAIL, 0, scale.p_insId, scale.p_insId

Pos posX.p_insId, posY.p_insId
CelPut BUFFER_GOATOH_HEAD, 0, 1., 1., neckArg.p_insId
CelPut BUFFER_GOATOH_TARSO, 0, scale.p_insId, scale.p_insId

Pos posX.p_insId, posY.p_insId
CelPut BUFFER_GOATOH_LEG
Pos posX.p_insId - scale.p_insId * 30, posY.p_insId + scale.p_insId * 30
CelPut BUFFER_GOATOH_LEG, 0, scale.p_insId, scale.p_insId

Pos posX.p_insId, posY.p_insId
CelPut BUFFER_GOATOH_LEG
Pos posX.p_insId + scale.p_insId * 50, posY.p_insId + scale.p_insId * 30
CelPut BUFFER_GOATOH_LEG, 0, scale.p_insId, scale.p_insId

Pos posX.p_insId, posY.p_insId
CelPut BUFFER_GOATOH_LEG
Pos posX.p_insId - scale.p_insId * 64, posY.p_insId - scale.p_insId * 20
CelPut BUFFER_GOATOH_HEAD, 0, scale.p_insId, scale.p_insId, neckArg.p_insId

Pos posX.p_insId, posY.p_insId
CelPut BUFFER_GOATOH_LEG
Pos posX.p_insId - scale.p_insId * 64, posY.p_insId - scale.p_insId * 20
CelPut BUFFER_GOATOH_FACE_CC, 0, scale.p_insId, scale.p_insId, neckArg.p_insId

Interval@Goatoh p_insId

@@ -95,6 +97,10 @@ Interval \
int p_insId
If walking.p_insId {
Walk@Goatoh p_insId

If frame.p_insId \ 150 == 30 {
MMPlay SOUND_MUMUMUMU
}
}
Else: If running.p_insId {
DoRun@Goatoh p_insId


Loading…
Cancel
Save