Updated Return to Selection Screen


-- collision with bad

local flagged_sprites = get_sprites_with_flag(1)

for sprite in all(flagged_sprites) do

    if collide_bbox(snake[1], sprite, 8, 8) then

        -- only restart the level if snake is moving

        if snake_dir.x ~= 0 or snake_dir.y ~= 0 then

            if current_level == "air" then

                reset_snake_position()

            elseif game_state == "final" then

                restart_final_level()

            else

                restart_level()

                break -- exit the loop early as we've already found a collision

            end

        end

    end

end


CHANGED TO

-- collision with bad

local flagged_sprites = get_sprites_with_flag(1)

for sprite in all(flagged_sprites) do

    if collide_bbox(snake[1], sprite, 8, 8) then

        if game_state == "selection" then

            -- Logic to move snake back to center without resetting anything

            reset_snake_position()  -- Assuming this function moves the snake to the center

        elseif snake_dir.x ~= 0 or snake_dir.y ~= 0 then

            if current_level == "air" then

                reset_snake_position()

            elseif game_state == "final" then

                restart_final_level()

            else

                restart_level()

                break -- exit the loop early as we've already found a collision

            end

        end

    end

end

Files

SERPENT_SCALE_QUEST.HTML.zip Play in browser
Dec 02, 2023
serpent_scale_quest.p8.png 28 kB
Dec 02, 2023
serpent_scale_quest_linux.zip 746 kB
Dec 02, 2023
serpent_scale_quest_osx.zip 3 MB
Dec 02, 2023
serpent_scale_quest_raspi.zip 2 MB
Dec 02, 2023
serpent_scale_quest_windows.zip 986 kB
Dec 02, 2023

Get Serpent Scale Quest - Pico-8

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.