i am new with the interactive apps using unity.and i find a link from google while playing some games online.
so i find one link which is compact and very interesting while playing.
need to find the ways how we can develop it in unity.i need some idea.
i found one way to do this with unity.here the algo for it:
============================
set cur to starting pixel
set cur-dir to default direction
clear mark and mark2 (set values to null)
set backtrack and findloop to false
while front-pixel is empty
move forward
end while
jump to START
MAIN LOOP:
move forward
if right-pixel is empty
if backtrack is true and findloop is false and either front-pixel or left-pixel is empty
set findloop to true
end if
turn right
PAINT:
move forward
end if
START:
set count to number of non-diagonally adjacent pixels filled (front/back/left/right ONLY)
if count is not 4
do
turn right
while front-pixel is empty
do
turn left
while front-pixel is filled
end if
switch count
case 1
if backtrack is true
set findloop to true
else if findloop is true
if mark is null
restore mark
end if
else if front-left-pixel and back-left-pixel are both empty
clear mark
turn left
fill cur
jump to PAINT
end if
end case
case 2
if back-pixel is filled
if front-left-pixel is not filled
clear mark
turn around
fill cur
jump to PAINT
end if
else if mark is not set
set mark to cur
set mark-dir to cur-dir
clear mark2
set findloop and backtrack to false
else
if mark2 is not set
if cur is at mark
if cur-dir is the same as mark-dir
clear mark
turn around
fill cur
jump to PAINT
else
set backtrack to true
set findloop to false
set cur-dir to mark-dir
end if
else if findloop is true
set mark2 to cur
set mark2-dir to cur-dir
end if
else
if cur is at mark
set cur to mark2
set cur-dir to mark2-dir
clear mark and mark2
set backtrack to false
turn around
fill cur
jump to PAINT
else if cur at mark2
set mark to cur
set cur-dir and mark-dir to mark2-dir
clear mark2
end
end if
end if
end case
case 3
clear mark
turn left
fill cur
jump to PAINT
end case
case 4
fill cur
done
end case
end switch
end MAIN LOOP
any suggestions,comments,improvements will be very much useful.