LBJ Picks Up His Pants

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

LBJ Picks Up His Pants

Post by Inny »

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.
CCcKTB0.png
CCcKTB0.png (6.85 KiB) Viewed 123 times
Controls:
Left and Right to Move
Z to jump
X to throw a Knife
F10 to quit
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.
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: LBJ Picks Up His Pants

Post by veethree »

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.
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LBJ Picks Up His Pants

Post by Jasoco »

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:

Code: Select all

self.kp = k
The "k" returns the key's actual name, not its Unicode.

Instead of:

Code: Select all

self.kp = string.char(u)
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.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: LBJ Picks Up His Pants

Post by Inny »

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!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest