Demos > CAMERA TUTORIAL


How to efficiently draw a scrolling map
made by trelemar
uploaded by trelemar
added:
download cartridge

5


Follow the complete tutorial here:

https://github.com/nesbox/tic.computer/wiki/Camera-tutorial

Comments


Zebirosca

I really can't make the first example work correctly, my object just move too fast to follow the camera. I'm making something wrong?

https://i.imgur.com/hw7XB0L.gif

Code:

t=0
player={}
camera={}
function Init()
player={x=32, y=32,sp=256}
camera={x=120,y=68}
end
Init()
function TIC()
cls(7)
map(0,0,240,136,-camera.x,-camera.y,0)
camera.x=120-player.x
camera.y=68-player.y



Post comment