0,]'ÿ$Sï}W ²D§ðp8·d�$)6o;]ÉA¦ösï÷ôôô”°ÂVl†4 226 then snake.x = 113 score = 0 snake.vx = snake.speed sfx(0,'B-3',10) time() end if snake.x < 8 then snake. x = 113 score = 0 snake.vx = snake.speed snake.avt = 274 sfx(0,'B-3',10) end if snake.y > 120 then snake.y = 60 score = 0 snake.y = 0 snake.vx = snake.speed snake.avt = 274 sfx(0,'B-3',10) end if snake.y < 8 then snake.y = 60 score = 0 snake.vy = 0 snake.vx = snake.speed snake.avt = 274 sfx(0,'B-3',10) end end end function update_apple() if mapa2.active == true then if not apple.active then apple.active = true apple.x = math.random(1,28)*8 apple.y = math.random(1,15)* 8 end end end function draw_apple() if mapa2.active == true then if apple.active then spr(apple.avt,apple.x,apple.y) end end end function apple_interaction() if mapa2.active == true then local pixel = 8 if snake.x < apple.x + pixel and snake.x + pixel > apple.x and snake.y < apple.y + pixel and snake.y + pixel > apple.y then score = score + 1 apple.active = false sfx(1,'C-7',10) end end end function body() if mapa2.active == true then -- check for score if score >= 1 then -- define part values part.x = snake.x - 8 part.y = snake.y -- add part spr(257, part.x , part.y) end if score >= 2 then part.x = snake.x - 16 part.y = snake.y -- add part spr(258, part.x , part.y) end if score >= 3 then part.x = snake.x - 24 part.y = snake.y -- add part spr(259, part.x , part.y) end end end function high_score() if mapa2.active == true then if score > high then high = score end end end function sco() if mapa2.active == true then print("Score:"..score,80,2) end end function hi_sco() if mapa2.active == true then print("High Score:"..high,5,2) end end function tim() if mapa2.active == true then print("Time:"..t , 130,2) end end function map_choice() if mapa.active == true then map(mapa.m1.x,mapa.m1.y,mapa.m1.w,mapa.m1.h) elseif mapa2.active == true then map(mapa2.m2.x,mapa2.m2.y,mapa2.m2.w,mapa2.m2.h) end end function draw_snake() if mapa2.active == true then spr(snake.avt,snake.x,snake.y) end end function menu_logic() if mapa.active == true then if not music_started then music(0) music_started = true end print("(Press z to start)",8,95) end if btnp(4) then music() mapa.active = false mapa2.active = true end end