123

123

123


function isPointInRectangle(x, y, rectX, rectY, rectW, rectH)

return x > rectX and y > rectY and x < rectX+rectW and y < rectY+rectH

end


function onTick()

inputX = input.getNumber(3)

inputY = input.getNumber(4)

temp = input.getNumber(5)

isPressed = input.getBool(1)


isPressingRight = isPressed and isPointInRectangle(inputX, inputY, 0, 192, 96, 160)

isPressingLeft = isPressed and isPointInRectangle(inputX, inputY, 0, 0, 96, 160)

isPressingUp = isPressed and isPointInRectangle(inputX, inputY, 0, 0, 288, 50)

isPressingDown = isPressed and isPointInRectangle(inputX, inputY, 0, 110, 288, 50)



output.setBool(1,isPressingLeft)

output.setBool(2,isPressingRight)

output.setBool(3,isPressingUp)

output.setBool(4,isPressingDown)

end

Report Page