diff --git a/fcore/box.sml b/fcore/box.sml new file mode 100644 index 0000000..dedcab3 --- /dev/null +++ b/fcore/box.sml @@ -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 diff --git a/fcore/level/player/sprites/raster/attack.png b/fcore/level/player/sprites/raster/attack.png new file mode 100644 index 0000000..01b261b Binary files /dev/null and b/fcore/level/player/sprites/raster/attack.png differ diff --git a/fcore/level/player/whip.sml b/fcore/level/player/whip.sml new file mode 100644 index 0000000..2bf3b4f --- /dev/null +++ b/fcore/level/player/whip.sml @@ -0,0 +1,4 @@ +structure Whip = +struct + type box = {x: int, y: int, size: int} +end diff --git a/oms.mlb b/oms.mlb index f0eb2c2..49d60ec 100644 --- a/oms.mlb +++ b/oms.mlb @@ -19,6 +19,7 @@ in vendored/cozette-sml/fonts/cozette-ascii.mlb fcore/block.sml fcore/field.sml + fcore'box.sml fcore/level/chain-edge.sml end