From 115850f306243c4d90afffcf2651bfa91c04fcae Mon Sep 17 00:00:00 2001 From: 10yard Date: Wed, 19 Oct 2022 21:58:46 +0100 Subject: [PATCH] Minor update to fix the smash animations. They didn't seem "vectory" enough. Now I use circles which increase in size. --- vectorkong/init.lua | 19 +++++++++++++++++-- vectorkong/plugin.json | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/vectorkong/init.lua b/vectorkong/init.lua index d25e425..6a6bd24 100644 --- a/vectorkong/init.lua +++ b/vectorkong/init.lua @@ -10,7 +10,7 @@ local exports = {} exports.name = "vectorkong" -exports.version = "0.13" +exports.version = "0.14" exports.description = "Vector Kong" exports.license = "GNU GPLv3" exports.author = { name = "Jon Wilson (10yard)" } @@ -255,6 +255,19 @@ function vectorkong.startplugin() polyline({y,x,y+h,x,y+h,x+w,y,x+w,y,x}) end + function circle(y, x, r, color) + -- draw a segmented circle at given position with radius + local _save_segy, _save_segx + vector_color = color or vector_color + for _segment=0, 360, 24 do + local _angle = _segment * (math.pi / 180) + local _segy, _segx = y + r * math.sin(_angle), x + r * math.cos(_angle) + if _save_segy then vector(_save_segy, _save_segx, _segy, _segx) end + _save_segy, _save_segx = _segy, _segx + end + vector_color = WHT + end + function draw_vector_characters() -- Output vector characters based on contents of video ram ($7400-77ff) local _addr = VRAM_TR @@ -426,7 +439,9 @@ function vectorkong.startplugin() -- Add smashed item? _sprite = read(0x6a2d) if read(0x6a2c) > 0 and _sprite >= 0x60 and _sprite <= 0x63 then - draw_object(0xf00 + _sprite, _y+_smash_offset, read(0x6a2c) - 17, BLU) + -- v0.14 - prefer growing circle effect to the sprites + circle(_y+_smash_offset+4, read(0x6a2c) - 13, (_sprite - 95) * 5, 0xff444444 + math.random(0xbbbbbb)) + --draw_object(0xf00 + _sprite, _y+_smash_offset, read(0x6a2c) - 17, BLU) end end end diff --git a/vectorkong/plugin.json b/vectorkong/plugin.json index 88ac8df..d491a4e 100644 --- a/vectorkong/plugin.json +++ b/vectorkong/plugin.json @@ -2,7 +2,7 @@ "plugin": { "name": "vectorkong", "description": "Vector Kong", -"version": "0.13", +"version": "0.14", "author": "Jon Wilson (10yard)", "type": "plugin", "start": "false"