<aside> 📌
예제는 배포된 패키지의 carts/basic_example 아래 개별프로젝트로 존재합니다.
</aside>
<aside> 📌
걷기를 구현합니다.
X좌표의 변화에 따라서 스프라이트 번호를 바꾸는것이 핵심입니다.
스프라이트 에디터에서 0번셀과 1번셀에 스프라이트를 미리 그려놓으세요.
</aside>

x = 64
y = 64
size = 2
color = 2
function _update()
if btn(0) then x -= 2 end
if btn(1) then x += 2 end
if btn(2) then y -= 2 end
if btn(3) then y += 2 end
if btn(4) then size += 1 end
if btn(5) then color += 2 end
end
function _draw()
cls() --clear screen
circfill(x,y,size,color) --draw circle
end
<aside> 📌
걷기를 구현합니다.
X좌표의 변화에 따라서 스프라이트 번호를 바꾸는것이 핵심입니다.
스프라이트 에디터에서 0번셀과 1번셀에 스프라이트를 미리 그려놓으세요.
</aside>

x=64
spd=1.2
seeleft=false
sprite=0
function _update()
if btn(0) then
seeleft=true
x -= spd
elseif btn(1) then
seeleft=false
x += spd
end
sprite = (x/8) % 2 -- x좌표를 8로 나눈값의 홀수짝수 에 따라 스프라이트를0,1로 바꿉니다.
end
function _draw()
cls(13)
spr(sprite, x,127-(20), 1,1, seeleft,false)
end
<aside> 📌
점프를 구현합니다.
</aside>
