boot [string "Code/gamestate.lua"]:4: Gamestate not initialized. Use Gamestate.switch() stack traceback:
[string "boot.lua"]:833: in function 'error_printer'
[string "boot.lua"]:768: in function <[string "boot.lua"]:766>
[C]: in function 'error'
[string "Code/gamestate.lua"]:4: in function 'leave'
[string "Code/gamestate.lua"]1: in function 'switch'
[string "main.lua"]:138: in main chunk
[C]: in function 'require'
[string "boot.lua"]:282: in function <[string "boot.lua"]:215>
[C]: in function 'xpcall'
[string "boot.lua"]:838: in main chunk
HUMP - yet another set of helpers
Re: HUMP - yet another set of helpers
Thanks for clearing that up. Hmmm, seems the way I've structured the code is going to need to be changed though, as fixing that now gives:
Re: HUMP - yet another set of helpers
Whoops, my bad . This was caused because the initial error-throwing state also threw an error when leaving, which it does when switching to your initial state. This is hopefully fixed now.
Re: HUMP - yet another set of helpers
I updated hump. The short:
http://vrld.github.com/hump/#ringbuffer.lua
http://vrld.github.com/hump/#sequence.lua
You can get the sourcecode from github: http://github.com/vrld/hump
- vector has fast rotation by 90° and projection onto other vector (with some sketches in documentation)
- added ringbuffer, a circular data structure
- added scene/sequence management for intros/cutscenes/outros
http://vrld.github.com/hump/#ringbuffer.lua
http://vrld.github.com/hump/#sequence.lua
You can get the sourcecode from github: http://github.com/vrld/hump
Re: HUMP - yet another set of helpers
Small request:
in gamestate - push & pop gamestates with events
Another request... compatibility with Love 0.7.0?
in gamestate - push & pop gamestates with events
Another request... compatibility with Love 0.7.0?
Bartoleo
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: HUMP - yet another set of helpers
It should be perfectly compatible with 0.7.0.bartoleo wrote:Another request... compatibility with Love 0.7.0?
Re: HUMP - yet another set of helpers
I'm not sure I can follow you on that one. Could you give an example of what you mean?bartoleo wrote:in gamestate - push & pop gamestates with events
Re: HUMP - yet another set of helpers
think about a game with specific states
like a jrpg like final fantasy game:
a gamestate could be the 'exploration' part
another one the combat
so
intro/menu->game->combat and then return to game
intro/menu switch to game
push game and go to combat
on leaving combat pop game as it was
or another one could be
game->menu/inventory system
like a jrpg like final fantasy game:
a gamestate could be the 'exploration' part
another one the combat
so
intro/menu->game->combat and then return to game
intro/menu switch to game
push game and go to combat
on leaving combat pop game as it was
or another one could be
game->menu/inventory system
Bartoleo
Re: HUMP - yet another set of helpers
That's what the first parameter of Gamestate:enter is for:
Note that if you do initialization stuff in self.previous:enter you have to skip it if returning from the menu, possibly like so:
If you want abstraction, you can build push/pop operations on top of that. But as I want hump to be simple and small, I wont implement this.
Code: Select all
-- assuming menu
menu = Gamestate.new()
function menu:enter(previous)
self.previous = previous
end
function menu:update(dt)
-- do stuff
if timeToLeave then
Gamestate.switch(self.previous)
end
end
Code: Select all
function game:enter(previous, more, args)
if previous == menu then return end
-- more stuff
end
Re: HUMP - yet another set of helpers
I added a new module: timer.lua. Despite it's name it does not only offer a timer (delayed function calls), but also a function which helps to create functions that change behavior depending on how much time has passed (e.g. fading the background, ...).
The documentation is available here: http://vrld.github.com/hump/
You can see and download the source-code on github: http://github.com/vrld/hump
Edit: Added "oscillators" in addition to interpolating function.
The documentation is available here: http://vrld.github.com/hump/
You can see and download the source-code on github: http://github.com/vrld/hump
Edit: Added "oscillators" in addition to interpolating function.
Who is online
Users browsing this forum: Google Adsense [Bot] and 2 guests