Submit Your Own Code

PSP Lua CodeBase : Analog with Sensitivity

Description:
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
 

Please welcome daryy, our newest member.

Who's Online: 3 Guests, 0 Users

Total Members: 556
Total Posts: 13060
Total Topics: 1480
Total Categories: 8
Total Boards: 35

Recent Posts:

Re: Lua 5.1.4 help. by daryy
Re: PGELua Help - need term for a special rotation fix (mathematical issue) by yaustar
Re: Lua Loader? by Buddy4point0
Re: Lua Loader? by osgeld
Re: Lua Loader? by acer5050
Re: Lua Loader? by bumuckl
Re: Lua Loader? by acer5050
Re: Lua Loader? by bumuckl


Copyright © 2006-2007 www.EvilMana.com All rights reserved.
EvilMana Logo by emcp and Charlie