Ok, so I’m using http://developer.anscamobile.com/code/animation-along-path-flash to generate a path coordinates - which works famously. Brilliant stuff there.
The problem now comes that I’m a buffoon and have no clue how to take what was provided and use it with an actual loaded image …
What I have is this:
local ladyBug = display.newImage(imgPath .."bug.png", 1024, 150)
local coordCount = 1
local function moveObject()
if coordCount \<= #xcoords then
ladyBug.x = xcoords = { 1052.45,1043.2,1034,1026.3,1016.8,1007.6,998.6,989.75,980.8,972.1,963.5,955,946.8,939.15,932.3,927.1,925.2,927.65,934.05,915.75,903.35,892.8,876.45,870.55,874.35,874.3,870.6,864.75,858.3,851.95,853.4,838.9,833.8,835.25,844.4,847.3,828.35,819.2,808.75,789.75,784.3,779.15,773.85,768.2,762.1,758.35,748.25,770.45,774.9,774.65,766.75,753.75,740.55,728.75,715.45,706.75,700.45,694.75,689.45,684.05,682.9,681.1,676.8,671.25,664.15,646.75,635.25,624.3,617.05,615.2,611.65,605.8,600.3,595.5,596.85,597.45,592.35,581.1,567.95,556.5,546,535.35,523.7,515.45,508.2,501.35,494.5,487.4,480.25,473.9,468.9,462.35,455.2,447.95,440.6,433.65,427.15,439.3,446.3,452.15,458.05,467.35,472.9,465.25,460.4,456.9,451.75,445.45,438.5,431.25,423.55,415.25,406.7,413.2,390.3,382.65,374.85,371.1,367.95,364.65,359.75,351.05,339.6,327.85,316.95,306.75,294.2,285.2,277,269,261.2,253.6,246.05,238.75,231.8,225.55,243.75,258.35,268.65,278.5,288.05,297.7,307.45,317.4,327.45,335.7,336.1,333.05,328.2,320.15,309.6,298.25,287.15,276.25,265.95,257.3,248.4,239.4,230.3,221,211.45,200.85,189.35,181.95,177.15,172.4,166.9,160.4,153.95,167,141.15,134.75,129.55,125.4,120.6,110,97.2,82.75,73.4,67.95,62.2,55.85,49.05,41.7,34.1,26.35,18.3,13.85,11.25,7.7,3.15,-2.45,-9.25,-18.1,-28.95,-41,-52.95,-52.95,-52.95 }
ladyBug.y = ycoords = { 143.45,143.9,144.3,142.2,142.15,141.9,141.4,140.65,139.85,138.7,137.1,135.15,132.75,129.55,125.45,120.2,113.75,107.9,104.25,89.15,85.6,83.4,94.9,108,125.85,133.4,139.25,141.95,141.25,139.35,133.9,133.95,129.15,122.8,122.1,113.45,97.75,92.3,88.4,99.9,111.85,119.5,126.45,132.85,138.75,129,129,123.5,117.35,103.5,91.15,83.6,81.15,81.3,87.85,98.15,106.7,114.75,122.6,129.9,120.9,114.25,108.2,101.7,95.2,94.35,97.55,104.5,118.2,131.3,138.2,131.3,127.05,122.7,116,109.15,100,91.9,88.45,87.55,87.55,88.9,97.15,104.6,111.4,117.7,123.3,127.8,130.2,128.5,124.1,120.2,115.95,111.5,106.75,101.75,96.3,95.4,97.2,100.9,103.8,104.25,108.2,113.9,119.1,125.45,129.95,132.3,133.45,133.8,133.65,133.3,132.85,159.15,131.7,128.95,125.95,121.35,114.45,107.4,99.7,92.2,87.2,85.1,84.5,84.65,90.55,96.15,101.25,106.45,111.75,117.2,123.1,129.3,136.1,145.55,166.5,167.05,167.25,167.2,166.9,166.1,164.5,161.55,155.9,144.4,127.4,115.6,104.95,95.5,88.7,84.65,82.6,82.25,82.7,82.2,81.2,80.2,79.45,78.8,78.8,80.55,88.7,100.65,110,117.75,123.3,124.5,123.05,147.3,124.1,121.1,116.55,110.95,104.4,99.2,97.45,102.45,116.85,125.25,131.5,136.15,139.25,141.15,141.9,141.85,141.2,136.65,130.55,123.95,116.9,109.55,102.3,95.9,91.4,89.75,90.95,90.95,90.95 }
coordCount = coordCount + 1
else
Runtime:removeEventListener( "enterFrame", moveObject )
end
end
Runtime:addEventListener( "enterFrame", moveObject )
Which breaks the game completely. What am I doing wrong folks? I’m starting to lose it with this project!
Thanks for the continual help! This is a fantastic community! [import]uid: 97023 topic_id: 19740 reply_id: 319740[/import]