Ok this is starting to look interesting.
I've got some good news, but I've also hit a problem for which I need help (hopefully from the LÖVE core team)
*** GOOD NEWS ***
Now I've got Stateful classes more or less set up - Actors are Stateful classes.
A stateful class is a class with a currentState property. The current state is a list of functions(1) that "override" the default classes' methods. States work with inheritance and (will/might work now but I haven't tested yet) with interfaces.
On the example I'm attaching, a "Player" actor represented by a rectangle can move left and right with the arrow keys, and jump with the "up arrow". But he can't jump while he's on air. Instead of using a boolean for "playerCanJump", i used "Player" class has two states(2). "Air" and "Ground". While on the ground, the player can "jump" - when not touching ground, the actor is on "Air". The "Air" state redefines a method called "jump" so it does nothing.
Yes I'm aware that the player "sticks to walls" like spiderman. An interesting side effect that might come out handy later.
The attached example also "colors" the scenery in green when the player is touching it, and shows tiny circles on the player's origin of coordinates and cotact points with the scenery.
*** HELP NEEDED *** .love file works, uncompressed folder fails
The title says it all. This sample works ok as long as it is compressed on a .love file.
However, when I try to use the uncompressed folder (drag-n-dropping the folder to the love executable) I got an error message - which basically says that one of my variables is not set. I've tried commenting out the line that throws the error (it is one of my control asserts in PÄSSION). And that's where the weird things start... the assert keeps failing, even if I commented out the assert line.
It looks as if the love executable is storing an "older" copy of my files somewhere on a temp folder - it certainly isn't receiving the right "folder" when I drag-n-drop folders on it any more. For .love files, it runs as it should, though.
This is a big pain for me since now I've got to manually select, compress and rename my folder every time I want to test a change. Not cool.
I'm using the latest version from the builds(20091214 - 301312c82b00) on winXP.
I'd appreciate any feedback from anyone regarding this issue. Are you having similar problems on MacOS or Linux? Does anyone know of any "temporary cache" that I could purge?
Thanks a lot!
(1) -well, really the states are classes; the current state is an instance of a "state class".
(2) The states are actually inside the parent actor class, Pawn. Player inherits from Pawn. I did it this way so in the future I could inherit Enemy from Pawn, and have the enemies use the same rules for movement as the player.