local alphaShift = 1/256 local function onEnterFrame(event) local group = game.game.parent local bat = group.bat local foreground = group.foreground local isTouching = group.controls[1].isTouching local direction = isTouching and -1 or 1 local alpha = foreground.alpha + direction * alphaShift foreground.alpha = math.min(math.max(0, alpha), 1) bat.gravityScale = direction end
Comments