Implement multiple biomes.
This commit is contained in:
13
player.lua
13
player.lua
@ -1,5 +1,5 @@
|
||||
-- this module assumes all objects and the player are
|
||||
-- 1x1 sprite in size. larger sprites are not currently supported
|
||||
-- This module assumes all objects and the player are 1x1 sprite in size.
|
||||
-- Larger sprites will probably work for objects, but not for the player.
|
||||
--
|
||||
-- exported variables:
|
||||
-- player_pos # integer tuple {x,y}. absolute position of the player on the
|
||||
@ -10,10 +10,6 @@
|
||||
-- # each element can be -1 (up or left), 0 (neutral),
|
||||
-- # or 1 (down or right)
|
||||
--
|
||||
-- exported constants:
|
||||
-- player_lookup # used internally to look up the sprite to render for a
|
||||
-- # given facing
|
||||
--
|
||||
-- functions:
|
||||
-- init_player({x,y}) # call this in _init(). Sets player starting position,
|
||||
-- # assumes the top-left of the pico-8 map is currently
|
||||
@ -23,14 +19,9 @@
|
||||
-- draw_player() # call in _draw(). Draws the player sprite.
|
||||
|
||||
function init_player(start_pos)
|
||||
-- camera_pos is the relative coordinate of the camera
|
||||
-- on the currently generated map chunk. player_pos is
|
||||
-- the *absolute* world coordinates of the player.
|
||||
player_pos = start_pos
|
||||
camera_pos = {start_pos[1]-8, start_pos[2]-8}
|
||||
|
||||
-- [1] is vertical facing, [2] is horizontal, -1 is up/left, 0 is neutral,
|
||||
-- and 1 is down/right
|
||||
facing = {1, 0}
|
||||
|
||||
-- this is a constant for looking up player sprites by facing
|
||||
|
Reference in New Issue
Block a user