Log In  
Follow
StrangeD0S

Hello!

I have just started working on a little metroidvania-style platformer. I started by following the platformer tutorial on [youtube]Youtube[https://www.youtube.com/watch?v=q6c6DvGK4lg&list=PLyhkEEoUjSQtUiSOu-N4BIrHBFtLNjkyE] and looking at some carts here.

I want to have different rooms connected by doors, which I have all drawn in the map editor. But apparently I don't understand how the map() function works.

I have one rooms that stretches from the map cells x000/y000 to x063/y015 and another smaller one below that from x000/y016 to x026/y022. I have a simple camera function like this:

function update_cam(m_start, m_end)
  cam_x=plr.x-64+(plr.w/2)
  cam_y=plr.y-64+(plr.w/2)
    if cam_x<m_start then
      cam_x=m_start
    end
    if cam_x>m_end-128 then
      cam_x=m_end-128
    end
  camera(cam_x,cam_y)
end

I have collision checks done like this:

function collide_map(obj,aim,flag)
  -- obj = table needs x,y,w,h

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=116420#p)
3 comments