|
Submit
Your Own Code
PSP Lua CodeBase : Analog with
SensitivityDescription:
Uses analog with sensitivity, rather than like the d-pad.
-- EVILMANA.COM PSP LUA CODEBASE
-- www.evilmana.com/tutorials/codebase
-- Analog with Sensitivity
-- SUBMITTED BY: TacticalPenguin
p = {x = 0, y = 0, img = Image.createEmpty(32,32)}
p.img:clear(Color.new(255,0,0))
deadzone = 48
sensitivity = 32
while true do
pad = Controls.read()
screen:clear()
anx = pad:analogX()
any = pad:analogY()
if math.abs(anx) > deadzone then
p.x = p.x + anx/sensitivity
elseif math.abs(any) > deadzone then
p.y = p.y + any/sensitity
end
screen.waitVblankStart()
screen.flip()
end
Back to CodeBase
|