hi guys i havent been coding with codea because i have been caught up by a depression.
but i have a simple circle in my code and i want to move left if i touch the left side of te screen and move right when touching the right.
can somebody help me with that?
-- player move
function setup()
--player variables
player_x = 250
player_y = 250
player_height = 50
player_width = 50
player_speed = 50
--
end
function draw()
background(40, 40, 50)
fill(200,120,200)
ellipse(player_x, player_y, player_width, player_height)
end
function player_move()
if
end
@Jessevanderheide Just in case you want to try other movements, move your finger around anywhere on the screen.
displayMode(FULLSCREEN)
function setup()
dx,dy=0,0
x=WIDTH/2
y=HEIGHT/2
end
function draw()
background(40, 40, 50)
fill(255)
ellipse(x+dx,y+dy,50)
end
function touched(t)
if t.state==MOVING then
dx=dx+t.deltaX
dy=dy+t.deltaY
end
end