draw animation frames for whip attack
This commit is contained in:
163
fcore/box.sml
Normal file
163
fcore/box.sml
Normal file
@@ -0,0 +1,163 @@
|
||||
structure Box =
|
||||
struct
|
||||
fun lerp (startX, startY, drawWidth, drawHeight, windowWidth, windowHeight) : Real32.real vector =
|
||||
let
|
||||
val endY = windowHeight - startY
|
||||
val startY = windowHeight - (startY + drawHeight)
|
||||
val endX = startX + drawWidth
|
||||
val windowHeight = windowHeight / 2.0
|
||||
val windowWidth = windowWidth / 2.0
|
||||
in
|
||||
#[ (((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
(((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
(((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
(((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
(((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
(((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
(((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.125)) + (endY * 0.125)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.875)) + (endX * 0.875)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.125)) + (endX * 0.125)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 1.0)) + (endY * 1.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 0.0)) + (endX * 0.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 1.0)) + (endY * 1.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 1.0)) + (endY * 1.0)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
(((startX * (1.0 - 1.0)) + (endX * 1.0)) / windowWidth) - 1.0,
|
||||
(((startY * (1.0 - 0.875)) + (endY * 0.875)) / windowHeight) - 1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
]
|
||||
end
|
||||
end
|
||||
BIN
fcore/level/player/sprites/raster/attack.png
Normal file
BIN
fcore/level/player/sprites/raster/attack.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
4
fcore/level/player/whip.sml
Normal file
4
fcore/level/player/whip.sml
Normal file
@@ -0,0 +1,4 @@
|
||||
structure Whip =
|
||||
struct
|
||||
type box = {x: int, y: int, size: int}
|
||||
end
|
||||
Reference in New Issue
Block a user