Skip to content
unXedDani edited this page Nov 15, 2015 · 9 revisions

###Tile Spec

Tile minimum spec https://u.pomf.io/nhwvzz.png

The coordinate system is based from the middle and X positive is down to the right, Y positive is down to the left. Z is straight up. Origin is in the middle of the screen https://u.pomf.io/lovsds.png

Wall height is 3.7 tiles

###Asset System https://www.youtube.com/watch?v=mQLwtYzGRUc

###Semi Stable Functions

grid.lua

  • grid.mouse.x mouse coordinate on the tiles
  • grid.mouse.y
  • translateToIso() translate a screen coordinate to tile coordinate
  • translateToSceen() Does the opposite.

main.lua

  • heart.hotload() I use it as a replacement for "require" to be able to reload files without restarting.
  • _Time is the time since the program started
  • _TimeF is math.floor(_Time)

mouse.lua

  • Functions in there maps the raw mouse positions from LÖVE to the canvas where the game is rendered. (hard coded to 1920x1080 currently)
  • mouse.x
  • mouse.y
  • mouse.left True if the left mouse button is down
  • mouse.right

Debug.lua

  • print() is overwritten to print into the program. (Instead of the console)
  • printv() prints a value that goes on the left side of the debug window
  • printo() print once, When a module is reloaded
  • _Loaded is a variable that is true for a single frame on load

programwalk.lua

  • Gives you a file containing every line of code executed.
  • programwalk.start()
  • programwalk.stop()

ui.lua

  • ui.graph() Draws the contents of an array as a graph
  • ui.slider() simple slider that takes value and returns a value

v.lua

  • Basic vectors.

viewport.lua

  • Drawing the canvas to the screen
  • viewport.fullCanvas The canvas object that the game is rendered to.

window.lua

  • Contains window start up code, and some keyboard toggles

utility.lua

  • math.round()
  • math.wrap()
  • math.minAngle()
  • math.dir() returns 1, -1 or 0
  • heart.hsv() returns rgba colors. Hue is 0-360. Saturation, value and alpha is 0-1
  • heart.sethsv() sets the color to a hsv value
  • heart.normalize()
  • heart.circle() Smarter circle function
  • heart.push() same as love.graphics.push() but safe for live code editing
  • heart.pop() same as love.graphics.pop()
  • heart.clearTable() clears every key in a table (Don't know if this is a good idea)
  • heart.clearArray() clears every index in a table
Clone this wiki locally