This object creates a score that popups when you create it and then fades away. Very good for shoot "em up games etc.
Create it when you want to show the score. The object will destroy itself when it is done fading down.
on new me, varScore, varLoc, varMember, varSprite
-- Set the member up
pMyMember = member(varMember)
duplicate member("fldPoints"), pMyMember
pMyMember.name = "Runtime"
pMyMember.text = string(varScore)
-- Set the sprite channel up
pMySpriteNum = varSprite
puppetSprite pMySpriteNum, TRUE
sprite(pMySpriteNum).member = pMyMember
sprite(pMySpriteNum).ink = 36
sprite(pMySpriteNum).loc = (varLoc + point(-40,-15))
-- Set my blend to 100
pMyBlend = 100
-- Add to the actor list to recieve stepFrame events
-- and to be able to destroy myself
add the actorList, me
return me
end
on stepFrame me
-- Lower blend
pMyBlend = pMyBlend - 4
-- If blend is 0 then destroy object, sprite and member
if pMyBlend = 0 then
sprite(pMySpriteNum).memberNum = 0
erase pMyMember
deleteOne the actorList, me
else
sprite(pMySpriteNum).blend = pMyBlend
end if
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA