weiss = Color.new(255,255,255)
schwarz = Color.new(0,0,0)
hinterg = Image.load("zone1.png")
ash = Image.load("ash.png")
ash2 = Image.load("ashlinks.png")
ash3 = Image.load("ashrechts.png")
ash4 = Image.load("ashoben.png")
cursor_x = 200
cursor_y = 150
pic=0
timer=0
animation=0
--Mp3.load("a.mp3")
--Mp3.play()
while true do
screen:clear()
--Zone1
--Wand rechts
if cursor_x >443 then
cursor_x=443
end
--Wand oben
if cursor_y <-10 then
cursor_y=-10
end
--Wand unten
if cursor_y >225 then
cursor_y=225
end
--Wand links
if cursor_x <8 then
cursor_x=8
end
--Haus unten rechts
--horizontale ebene
if cursor_x <444 and cursor_x >362 and cursor_y >150 and cursor_y <152 then
cursor_y=150
end
if cursor_x <444 and cursor_x >362 and cursor_y >208 and cursor_y <210 then
cursor_y=210
end
--vertikale ebene
if cursor_x >360 and cursor_y <210 and cursor_y >155 then
cursor_x=360
end
--Haus oben
--horizontale ebene
if cursor_x <170 and cursor_x >80 and cursor_y <28 then
cursor_y=28
end
--vertikale ebene
if cursor_x <173 and cursor_x >170 and cursor_y <30 and cursor_y >-15 then
cursor_x=173
end
if cursor_x >77 and cursor_x <80 and cursor_y <30 and cursor_y >-15 then
cursor_x=77
end
-- Bus
--horizontale ebene
if cursor_x >0 and cursor_x <48 and cursor_y <132 and cursor_y>130 then
cursor_y=132
end
if cursor_x >0 and cursor_x <48 and cursor_y >85 and cursor_y<87 then
cursor_y=85
end
--vertikale ebene
if cursor_x <50 and cursor_y <132 and cursor_y >85 then
cursor_x=50
end
--Baeme links
--vertikale ebene
if cursor_x <30 and cursor_y <130 and cursor_y >-15 then
cursor_x=30
end
--Baeme unten
--horizontale ebene
if cursor_x >0 and cursor_x <270 and cursor_y >200 then
cursor_y=200
end
--vertikale ebene
if cursor_x <272 and cursor_y <250 and cursor_y >200 then
cursor_x=272
end
pad = Controls.read()
function Ashbew ()
if pad:right() then
cursor_x = cursor_x + 1.5
end
if pad:left() then
cursor_x = cursor_x - 1.5
end
if pad:down() then
cursor_y = cursor_y + 1.5
end
if pad:up() then
cursor_y = cursor_y - 1.5
end
end
if pad:down() then
timer = timer + 1
end
if timer > 10 then
animation = animation + 1
timer = 0
if animation > 3 then
animation = 0
end
end
if animation == 0 then
pic = 0
elseif animation == 1 then
pic = 32
elseif animation == 2 then
pic = 64
elseif animation == 3 then
pic = 96
end
Ashbew()
screen:blit(0,0,hinterg,true)
screen:blit(cursor_x, cursor_y, ash, pic, 0, 32, 32)
screen.flip()
screen.waitVblankStart()
end