coding help

---- game1

-- Use this function to perform your initial setup
function setup()
    print("Move the people to the starting point.")
    spx = 300
    spy = 300
  
    spx2 = 350
    spy2 = 275
    
    if screen is touched then spx = 100 and spx2 = 100
    else sprite("Tyrian Remastered:Explosion Huge",spx, spy)
    end
    end


-- This function gets called once every frame
function draw()
    spx2 = spx2 + 1
     spx = spx + 1
    
    -- This sets a light background color 
    background(236, 227, 234, 0)
-- This sets the line thickness
    strokeWidth(5)

    -- Do your drawing here

sprite("SpaceCute:Beetle Ship", spx, spy)
    
sprite("SpaceCute:Rocketship", spx2, spy2)                  
 end
function touched(touch)

spx = touch.x
spy = touch.y

end
--

@Mcordova18 Please tell us where you think its going wrong, and how you think it could be fixed. We are not robots that are capable of doing this with little information. Also, please format your code with three of these ~

---- game1

-- Use this function to perform your initial setup function setup() print("Move the people to the starting point.") spx = 300 spy = 300

spx2 = 350
spy2 = 275

if screen is touched then spx = 100 and spx2 = 100
else sprite("Tyrian Remastered:Explosion Huge",spx, spy)
end
end
-- This function gets called once every frame function draw() spx2 = spx2 + 1 spx = spx + 1

-- This sets a light background color 
background(236, 227, 234, 0)
-- This sets the line thickness strokeWidth(5)

-- Do your drawing here
sprite("SpaceCute:Beetle Ship", spx, spy)

sprite("SpaceCute:Rocketship", spx2, spy2)
end function touched(touch)

spx = touch.x spy = touch.y

end

@Mcordova18 give us some information instead of just posting code. What are you trying to do and what isn’t working correctly?

btw like @Prynok said use three (~) at the start and end to format your code. I edited your post for you to include it.

The problem is that on this line: — if screen is touched then spx = 100 and spx2 = 100—
Codea shows an error it says then is expected near is

I think its saying you commented your code.

@MCordova18 That line is not valid code. It’s also in setup() which only gets executed when the program starts. Not sure what you’re trying to do.

If you just tell us what you are trying to do, you will get help.

Moved your touch and fixed the formatting.

---- game1

-- Use this function to perform your initial setup
function setup()
    print("Move the people to the starting point.")
    spx = 300
    spy = 300

    spx2 = 350
    spy2 = 275

    
    end


-- This function gets called once every frame
function draw()
    spx2 = spx2 + 1
     spx = spx + 1

    -- This sets a light background color 
    background(236, 227, 234, 0)
-- This sets the line thickness
    strokeWidth(5)

    -- Do your drawing here

sprite("SpaceCute:Beetle Ship", spx, spy)

sprite("SpaceCute:Rocketship", spx2, spy2)                  
 end
function touched(touch)
    if touched then spx = 100  spx2 = 100
    else sprite("Tyrian Remastered:Explosion Huge",spx, spy)
    end
    

spx = touch.x
spy = touch.y

end
--