diff --git a/index.html b/index.html index bc15348..d766764 100644 --- a/index.html +++ b/index.html @@ -91,7 +91,7 @@
require "hump.gamestate"
+ Gamestate = require "hump.gamestate"
A gamestate encapsulates independant data an behaviour into a single entity.
A typical game could consist of a menu-state, a level-state and a game-over-state.
require "hump.timer"
+ Timer = require "hump.timer"
hump.timer provides a simple interface to use delayed functions, i.e. functions that will only be executed after some amount time.
In addition, the module offers facilities to create functions that @@ -542,7 +542,7 @@ end
require "hump.vector"
+ vector = require "hump.vector"
A handy 2D vector class defining the most common things you do with vectors.
You can access the individual coordinates by using vec.x
and vec.y
.
require "hump.class"
+ Class = require "hump.class"
A small, handy class implementation with multiple inheritance.
Define a new class.
The constructor will receive the newly created object as first argument.
If you require
d the module to a variable, you can use the variable
@@ -1013,6 +1015,8 @@ spawner.direction:rotate_inplace(dt)
the_name
tostring()
on the class.super
Class = require 'hump.class'
+A = Class{name = 'A'}
+function A:foo()
+ print('foo')
+end
+
+B = Class{name = 'B'}
+function C:bar()
+ print('bar')
+end
+
+-- single inheritance
+C = Class{name = 'C', inherits = A}
+instance = C()
+instance:foo() -- prints 'foo'
+
+-- multiple inheritance
+D = Class{name = 'D', inherits = {A,B}}
+instance = D()
+instance:foo() -- prints 'foo'
+instance:bar() -- prints 'bar'
require "hump.camera"
+ camera = require "hump.camera"
Depends on vector
Camera abstraction for LÖVE. A camera "looks" at a position and can be moved, zoomed and rotated.
@@ -1432,7 +1457,7 @@ unit:plotPathTo(target)require "hump.ringbuffer"
+ ringbuffer = require "hump.ringbuffer"
A ring-buffer is a circular array. That means it does not have a first nor a last, but only a selected/current element.
You can use this to implement Tomb Raider style inventories, looping