i know what you mean though, the character is placed in the middle of a sideways device(might not be important), and is locked, only his arm and gun move, and it is a touch based shooter, the arm and gun follow the touch, and no other animation required, my first problem is;
I cant figure out how to make the two part sprite animation (arm/gun and player),
Second is after that ends up working, i cant find any source code or tutorials on how to make the “player” i don’t know how to make the correct event listener for the touch, everything i do, and the screen stays black, the only things i can get working are the background and 1 part sprite: local background =
display.newImage (“Grassland.png”)
myImage = display.newImage( “cannon.png”, 200, 217, true )
after i posted this i went looking into the Point A - Point B, which i have been using planes,
–local level = 1
–local spawnCnt = 0
–local planeType = 1
local _W = display.contentWidth
local _H = display.contentHeight
planes = {}
local function spawnPlane( _type )
if _type == 1 then
table.insert( planes, display.newImage(“plane1.png”) ) – plane image 1
planes[#planes].life = 5
planes[#planes].speed = 2
elseif _type == 2 then
table.insert( planes, display.newImage(“plane2.png”) ) – plane image 2
planes[#planes].life = 10
planes[#planes].speed = 3
elseif _type == 3 then
table.insert( planes, display.newImage(“plane3.png”) ) – plane image 2
planes[#planes].life = 20
planes[#planes].speed = 1
spawnCnt = spawnCnt +1
end
--if spawnCnt == 45 then
– level = level + 1
– planeType = planeType + 1
– spawnCnt = 0
– end
planes[#planes].x = _W + 100
planes[#planes].y = math.random(20,50)
transition.to( planes[#planes], { time = planes[#planes].speed * 1000, x = -200} )
end
timer.performWithDelay(2000, spawnPlane( math.random(1,3) ), 10 )