System.usbDiskModeActivate()

font = Font.load("Geek a byte 2.ttf")
font:setPixelSizes(15,20)

rot = Color.new(255,0,0)
blau = Color.new(0,0,255)
weiss = Color.new(255,255,255)

battr = System.powerGetBatteryLifePercent()

background = Image.load("Analog.jpg")

player = {}
player.img = Image.load("a.png")
player.x = 10
player.y = 10

while true do
pad = Controls.read()
screen:blit(0,0,background,true)
screen:blit(player.x, player.y, player.img)

if pad:analogX() > 64 then
screen:fontPrint(font,200,230,"The Analog-Stick is working!",blau)
end
if pad:analogX() < -64 then
screen:fontPrint(font,200,230,"The Analog-Stick is working!",blau)
end
if pad:analogY() < -64 then
screen:fontPrint(font,200,230,"The Analog-Stick is working!",blau)
end
if pad:analogY() > 64 then 
screen:fontPrint(font,200,230,"The Analog-Stick is working!",blau)
end 

if pad:analogX() > 50 and player.x < 430 then
player.x = player.x + 7
end

if pad:analogX() < -50 and player.x > 10 then
player.x = player.x - 7
end

if pad:analogY() > 50 and player.y < 200 then
player.y = player.y + 7
end

if pad:analogY() < -50 and player.y > 10 then
player.y = player.y - 7
end


if pad:start() then
background = nil
dofile("LUATool.lua")
end

screen:print(300, 10, "Batterie-Status:", weiss)
screen:print(440, 10, battr, rot)
screen:print(460, 10, "%", weiss)

collectgarbage()
screen.flip()
screen.waitVblankStart()
end



