Hi guys, it's been a while, but I have a demo here for you to play with. I was going to create a whimsical game in which you play President Lyndon B. Johnson going to pick us his pants from dry cleaning. However, the joke got less funny as I worked on it, and then I lost interest in the project. Since it's been a few months and the project has no steam, I've decided to give it up. Here's the Love file, and if anyone wants to rip it apart and steal code, feel free to.
Controls:
Left and Right to Move
Z to jump
X to throw a Knife
F10 to quit
LBJ Picks Up His Pants
LBJ Picks Up His Pants
- Attachments
-
- lbjpicksuphispants.love
- Updated to fix the input.lua problem
- (23.7 KiB) Downloaded 92 times
Last edited by Inny on Fri May 17, 2013 2:32 am, edited 1 time in total.
Re: LBJ Picks Up His Pants
I get an error when pressing any of the arrow keys. "Input.lua:97: bad argument #1 to 'char' (invalid value)" I'm on my mac in case that has anything to do with it.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: LBJ Picks Up His Pants
Yeah. Same thing. Looking at your code, you're doing it... interestingly. Not the way I would do it.
Change line 97 to the following:
The "k" returns the key's actual name, not its Unicode.
Instead of:
Using the key string name works fine. The Character Code for the Left key for example doesn't exist as a Unicode. See, Unicode is not the same on all machines I believe. Either way, string.char does not recognize all keys so if one does not exist, it returns as a value you can't use in your key table. So use the string instead as all keys have a string value. So it'll work fine with the string.
That said, very impressive. I like the different tiles having different collisions so you only pass through one way. Really neat. Just fix that one problem and it works fine on both OS X and Windows.
Change line 97 to the following:
Code: Select all
self.kp = k
Instead of:
Code: Select all
self.kp = string.char(u)
That said, very impressive. I like the different tiles having different collisions so you only pass through one way. Really neat. Just fix that one problem and it works fine on both OS X and Windows.
Re: LBJ Picks Up His Pants
That was bizarre. I don't use the Input.kp or Input.last_key, it must have gotten copy+pasted from another project (which means I need to go hunting for where it came from). At anyrate, I made the change, thanks guys! Enjoy!
Who is online
Users browsing this forum: No registered users and 4 guests