See “This Application Has Been Corrupted Error” when launch my app on samsung galaxy s2.
Here is code:
local background = display.newImage( "back.png" )
require "sprite"
local sheet1 = sprite.newSpriteSheet( "anim.png", 70, 48 )
local spriteSet1 = sprite.newSpriteSet(sheet1, 1, 9)
sprite.add(spriteSet1, "jake", 1, 9, 500, 0 )
local instance1 = sprite.newSprite( spriteSet1 )
local xpos = display.contentWidth \* 0.5
local ypos = 242
local screenLeft = display.screenOriginX
local screenRight = display.viewableContentWidth + display.screenOriginX
instance1.x = xpos
instance1.y = ypos
local radius = 20
local xspeed = 0
local xdirection = 1
instance1.xScale = .5
instance1.yScale = .5
k=0
function touch (ev)
if (ev.phase == "began" or ev.phase == "moved") then
Xtouch = ev.xStart
k = 1
end
if (ev.phase == "ended" or ev.phase == "cancelled") then
k=0
end
end
Runtime:addEventListener("touch", touch);
local function animate(event)
if (k \> 0) then
instance1:play()
xpos = xpos + ( xspeed \* xdirection );
if (Xtouch \< display.contentWidth \* 0.5) then
xspeed = 5.0
xdirection = -1
instance1.xScale = - .5
if ( xpos \> screenRight - radius or xpos \< screenLeft + radius ) then
nstance1:stop()
instance1:pause()
instance1.xScale = - .5
end
end
if (Xtouch \> display.contentWidth \* 0.5) then
xspeed = 5.0
xdirection = 1
instance1.xScale = .5
if ( xpos \> screenRight - radius or xpos \< screenLeft + radius ) then
instance1.xScale = .5
instance1:stop()
end
end
if ( xdirection \< 0 ) then
instance1.xScale = - .5
end
instance1:translate( xpos - instance1.x, ypos - instance1.y)
end
if (k \< 1) then
instance1:pause()
end
end
Runtime:addEventListener( "enterFrame", animate );
instance1:prepare("jake")
Runtime:addEventListener( "enterFrame", move );
I’m new in Corona sdk. What i do wrong? [import]uid: 140468 topic_id: 24512 reply_id: 324512[/import]
[import]uid: 140468 topic_id: 24512 reply_id: 99232[/import]