Skip to content

Commit

Permalink
Minor update to fix the smash animations. They didn't seem "vectory" …
Browse files Browse the repository at this point in the history
…enough. Now I use circles which increase in size.
  • Loading branch information
10yard committed Oct 19, 2022
1 parent c3ec301 commit 115850f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions vectorkong/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)" }
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vectorkong/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"plugin": {
"name": "vectorkong",
"description": "Vector Kong",
"version": "0.13",
"version": "0.14",
"author": "Jon Wilson (10yard)",
"type": "plugin",
"start": "false"
Expand Down

0 comments on commit 115850f

Please sign in to comment.