Code help
the 12.5 is the player height divided by 2 and mapcol is the map where I drew the collision points
camera = class
constructor = function(x,y,location)
this.x = x
this.y = y
this.location = location
end
draw = function()
screen.drawMap( "mapcol", this.x-199.5, this.y, 400, 400 )
screen.drawMap( "mapcol2", this.x+199.5, this.y, 400, 400 )
screen.drawMap( "map", this.x-199.5, this.y, 400, 400 )
screen.drawMap( "map2", this.x+199.5, this.y, 400, 400 )
end
update = function()
this.old_x = this.x
this.old_y = this.y
if keyboard.W then
this.y -=1
if mapHit(this.x,12.5,"mapcol") then
print("hi")
this.y+=1
end
elsif keyboard.A then
this.x += 1
elsif keyboard.S then
this.y += 1
elsif keyboard.D then
this.x -= 1
end
end
end

