Thanks, but there is more code In the draw loop I should have posted earlier. When I said freeze, I was talking not reacting at all - I can’t even get back into the editor but have to manually close the app and restart.
Here is the whole code, just in case:
-- Use this function to perform your initial setup
function setup()
-- Variables
x = 900
w = 150
h = 100
counter = 3
parameter.watch("CurrentTouch")
parameter.watch("x")
th = HEIGHT - 20
tw = WIDTH
tht = HEIGHT - 40
i = 400
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(255, 255, 255, 255)
-- Do your drawing here
repeat
print (i)
i = i + 1
until i == 800
fill(0, 0, 0, 255)
font("MarkerFelt-Thin")
text("Leben:", 40, th)
text(counter, 80, th)
lineCapMode(SQUARE)
strokeWidth(5)
stroke(0, 0, 0, 255)
line(0, tht, WIDTH, tht)
if CurrentTouch.state == BEGAN then
fill(16, 178, 197, 255)
elseif CurrentTouch.state == MOVING then
fill(255, 0, 0, 255)
elseif CurrentTouch.state == ENDED then
fill(210, 218, 16, 255)
end
sprite("Documents:fant", CurrentTouch.x, CurrentTouch.y, w, h)
fill(255, 0, 110, 255)
if x == 0 then
sound(SOUND_JUMP, 39249)
x = x + 1
else
x = x - 1
ellipse(x, 300, 100)
end
if x == CurrentTouch.x then
sound(SOUND_EXPLODE, 6)
counter = counter -1
-- h = h - 10
-- if h == o then
-- h = 0
-- w = 0
-- end
end
-- end function draw()
end
Any idea?