joshtynjala/gtween.lua — Issue #1: runtime error 
Author: matthewswallace
Created: 2011-10-24 15:11:02+00:00
State: open

Ok, just thought I would report this runtime error I am getting. Not sure but maybe it's just something I am doing wrong when coding. The animations still run and work great. It seems that it just skips past the nil pointers but wanted to see if it's a bug or just something I need to code differently.

here is the error:

Runtime error
...ment/mobile/Flying-space-rocks/com/vendor/gtween.lua:402: attempt to perform arithmetic on local 'rangeVal' (a nil value)
stack traceback:
[C]: ?
...ment/mobile/Flying-space-rocks/com/vendor/gtween.lua:402: in function 'setPosition'
...ment/mobile/Flying-space-rocks/com/vendor/gtween.lua:56: in function <...ment/mobile/Flying-space-rocks/com/vendor/gtween.lua:46>
?: in function
Runtime error
...ment/mobile/Flying-space-rocks/com/vendor/gtween.lua:402: attempt to perform arithmetic on local 'rangeVal' (a nil value)
stack traceback:
[C]: ?
...ment/mobile/Flying-space-rocks/com/vendor/gtween.lua:402: in function 'setPosition'
...ment/mobile/Flying-space-rocks/com/vendor/gtween.lua:56: in function <...ment/mobile/Flying-space-rocks/com/vendor/gtween.lua:46>
?: in function

here is my code

```lua

local function moveEnemy(event)
enemy_ship.alpha = 1
enemy_ship.x = -20
gtween.new(enemy_ship, 10, {x=totalWidth + 100}, {onComplete=setTimer(moveEnemy)})
gtween.new(enemy_ship, 0.5, {y=randomNum(10, halfHeight-50)},
{delay=1, ease=gtween.easing.outCubic})
gtween.new(enemy_ship, 0.5, {y=randomNum(10, halfHeight-50)},
{delay=3, ease=gtween.easing.outCubic})
gtween.new(enemy_ship, 0.5, {y=randomNum(10, halfHeight-50)},
{delay=4, ease=gtween.easing.outCubic})
gtween.new(enemy_ship, 0.5, {y=randomNum(10, halfHeight-100)},
{delay=8, ease=gtween.easing.outCubic})

timer.performWithDelay(500, shoot, 15)
end

function enemy_ship:bullets(enemy_bullets)
bullets = enemy_bullets
end

setTimer(moveEnemy)

```