Browse Source

いろいろ

main
Miteruzo 1 year ago
parent
commit
684f74cbb6
3 changed files with 41 additions and 3 deletions
  1. +3
    -0
      .gitignore
  2. +38
    -3
      main.hsp
  3. BIN
      obj

+ 3
- 0
.gitignore View File

@@ -0,0 +1,3 @@
/hscl.ini
/obj


+ 38
- 3
main.hsp View File

@@ -30,13 +30,48 @@

direction = 1

moving = False
falling = True

Repeat
Pos nizikaX, nizikaY
GCopy SCREEN_NIZIKA, 0, NIZIKA_HEIGHT * (frame \ 24), NIZIKA_WIDTH, NIZIKA_HEIGHT
If GetKey2 (KEY_MOUSE_L) {
If moving {
nizikaX = LimitF (mouseX - offsetX, -NIZIKA_LEFT, gInfo_dispX - NIZIKA_RIGHT)
nizikaY = LimitF (mouseY - offsetY, Null, gInfo_dispY - NIZIKA_BASE)
}
Else {
moving = True

offsetX = Double (mouseX - nizikaX)
offsetY = Double (mouseY - nizikaY)
}
}
Else: If moving {
moving = False
falling = True

fallVel = 0.
}
Else: If falling {
nizikaY = LimitF (nizikaY + fallVel, Null, gInfo_dispY - NIZIKA_BASE)
fallVel += 9.8

If nizikaY >= gInfo_dispY - NIZIKA_BASE {
falling = False
}
}

ReDraw False
Color COLOUR_LIME
BoxF

Pos nizikaX, nizikaY
GCopy SCREEN_NIZIKA, IIf (direction < 0, NIZIKA_WIDTH, 0), NIZIKA_HEIGHT * (frame \ 24), NIZIKA_WIDTH, NIZIKA_HEIGHT
ReDraw True

nizikaX += direction * 4

If nizikaX >= NIZIKA_WIDTH {
If (nizikaX >= gInfo_dispX - NIZIKA_RIGHT) || (nizikaX < -NIZIKA_LEFT) {
direction = -direction
}



BIN
obj View File


Loading…
Cancel
Save