forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help on LuaPlayerHMv2 final beta with analog

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
Pihas



Joined: 25 Oct 2008
Posts: 60
Location: Lithuania

PostPosted: Sat Oct 25, 2008 10:29 pm    Post subject: Need help on LuaPlayerHMv2 final beta with analog Reply with quote

hi, all i'm not new at programing in lua language but having problems on LuaPlayerHMv2 final beta can't uderstand how to use analog on this version, i tried a lot of different ways, but it doesn't work :/ , i too tried to convert old scripts to new one but same broblems...

Thats my project, so i converted bigest part of scripts to new lua player engine but having problems with mouse :(

That's on what i'm working:

(Don't follow link on image it's lithuanian website...)

Code:

red = Color.new(255,0,0,0)
black = Color.new(0,0,0,0)
white = Color.new(255,255,255,255)

--creates player
player = Image.createEmpty(32,32)

player:clear(Color.new(255,0,0,0))

--Players table
Player = { x = 100, y = 100, img = player }

--functiion for analog movement
function analogMove()

pad = Controls.read()

anaX = pad:analogX()
anaY = pad:analogY()

-- anaX and anaY represents number from -128 to 127
-- number "50" is analog deadzone
if anaX > 50 then
Player.x = Player.x + 5
end

if anaX < -50 then
Player.x = Player.x - 5
end

if anaY > 50 then
Player.y = Player.y + 5
end

if anaY < -50 then
Player.y = Player.y - 5
end
end

while true do

screen.clear(Color.new(0,0,0,0))

Image.blit(Player.x,Player.y,Player.img)   <-- Here is my problem  :cry:

analogMove()

-- prints X and Y analog coordinates
screen.print(5,5,"analogX: " .. anaX,12, white, white)
screen.print(5,15,"analogY: " .. anaY,12, white, white)

if pad:cross() then
break
end

screen.flipscreen()
screen.waitVblankStart()
end
Back to top
View user's profile Send private message Visit poster's website
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sat Oct 25, 2008 11:37 pm    Post subject: Reply with quote

You'd be better asking on the LuaPlayerHM forum: http://luaplayerhm.xtreemhost.com/forum/
Back to top
View user's profile Send private message
homemister



Joined: 24 Mar 2008
Posts: 25

PostPosted: Sun Oct 26, 2008 2:49 pm    Post subject: Reply with quote

It has been fixed on the LPHM forums.
Thx IWN for helping him.
kind regards
Homemister
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group