Code: Select all
API.load("altpsystem")
API.load("nsmbwalls")
--HUD Settings
local hud = Graphics.loadImage(Misc.resolveFile("hud/hud.png"))
local generalReserve = Graphics.loadImage("hardcoded-48-0.png")
local marioReserve = Graphics.loadImage("hardcoded-48-1.png")
local luigiReserve = Graphics.loadImage("hardcoded-48-2.png")
local coinCounter = 0;
function onTick()
Graphics.activateHud(false)
Graphics.drawImageWP(hud, 0, 0, 5)
--Life Counter of the HUD
Text.printWP(mem(0x00B2C5AC,FIELD_FLOAT), 106, 14, 5)
--Star Counter of the HUD
Text.printWP(mem(0x00B251E0,FIELD_WORD), 298, 14, 5)
--Score Counter of the HUD
Text.printWP(mem(0x00B2C8E4,FIELD_DWORD), 634, 20, 5)
--Coin Counter of the HUD
Text.printWP(coinCounter, 516, 14, 5)
end
--How to count the Coins
function onNPCKill(eventObj,killedNPC,killReason)
if npcID == 10 then
coinCounter = coinCounter + 1;
end
if npcID == 103 then
coinCounter = coinCounter + 1;
end
if npcID == 258 then
coinCounter = coinCounter + 5;
end
if npcID == 274 then
coinCounter = coinCounter + 20;
end
end