Created
March 18, 2015 09:05
-
-
Save jacobmischka/3b62d5d9901c301e4fe3 to your computer and use it in GitHub Desktop.
idk!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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