Skip to content

Instantly share code, notes, and snippets.

@jacobmischka
Created March 18, 2015 09:05
Show Gist options
  • Save jacobmischka/3b62d5d9901c301e4fe3 to your computer and use it in GitHub Desktop.
Save jacobmischka/3b62d5d9901c301e4fe3 to your computer and use it in GitHub Desktop.
idk!
n
dx = -dist*math.cos(-self.cam.rot)
dy = -dist*math.sin(-self.cam.rot)
if self.world:isLand(self.player.x+dx, self.player.y+dy) then
self.cam:move(dx, dy)
self.player:move(dx, dy, "left")
end
elseif key == "s" then
dx = dist*math.sin(self.cam.rot)
dy = dist*math.cos(self.cam.rot)
if self.world:isLand(self.player.x+dx, self.player.y+dy) then
self.cam:move(dx, dy)
self.player:move(dx, dy, "down")
end
elseif key == "d" then
dx = dist*math.cos(-self.cam.rot)
dy = dist*math.sin(-self.cam.rot)
if self.world:isLand(self.player.x+dx, self.player.y+dy) then
self.cam:move(dx, dy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment