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:
![Image](http://psp-triukai.net/uploads/posts/2008-09/1221577011_20080916173503_0.jpg)
(Don't follow link on image it's lithuanian website...)
Code: Select all
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