-- scripts
on beginSprite me
-- checks whether modelMember is a valid member
if me.modelMember.type <> #bitmap then
alert "You did not choose a correct model..."
me.status = #error
return 0
end if
if me.modelMember.depth > 8 then
alert "The model depth must be 8 bits..."
me.status = #error
return 0
end if
sprite(me.spriteNum).ink = 36
sprite(me.spriteNum).trails = 1
-- Initializes painting parameters
JTMRinit(me)
end beginSprite
on JTMRinit me
me.initialLoc = point(random(me.modelMember.width), random(me.modelMember.height))
me.currentMovementLength = random(me.movementLength)
sprite(me.spriteNum).forecolor = getPixel(me.modelMember, me.initialLoc[1], me.initialLoc[2])
me.blendStep = 100/me.movementLength
sprite(me.spriteNum).loc = point(me.drawingRect[1], me.drawingRect[2]) + me.initialLoc
if sprite(me.spriteNum).locH > me.drawingRect[3] OR sprite(me.spriteNum).locV > me.drawingRect[4] then JTMRInit(me)
end JTMRinit
on prepareFrame me
if me.status = #error then return 0
sprite(me.spriteNum).locH = sprite(me.spriteNum).locH + (21-me.movementPressure)
if sprite(me.spriteNum).locH - me.drawingRect[1]> min(me.modelMember.width, me.initialLoc[1] + me.currentMovementLength) then
JTMRinit(me)
end if
sprite(me.spriteNum).blend = sprite(me.spriteNum).blend - me.blendStep
end prepareFrame