Search found 64 matches

by stout
Sun Sep 13, 2020 7:32 pm
Forum: Support and Development
Topic: Getting a key as a number
Replies: 8
Views: 7920

Re: Getting a key as a number

Sorry, I should've added a use case. I want to do:

Code: Select all

if var[2] > 1 then
~other stuff
Right now, that won't work, because var[2] is a table. I want to eval that "2" there, as a number.
by stout
Sun Sep 13, 2020 6:36 pm
Forum: Support and Development
Topic: Getting a key as a number
Replies: 8
Views: 7920

Getting a key as a number

Basic lua question:

Code: Select all

var = { {}, {}, {} }
I want some way to get var[1] to return as the number 1, var[2] to return as the number 2, etc. Is there something built-in to do this, or would I need a complicated function?
by stout
Sun Jan 05, 2014 5:26 pm
Forum: Support and Development
Topic: [SOLVED] Key rebinding issue
Replies: 4
Views: 4448

Re: Key rebinding issue

Thanks! I'm still not 100% on why it's happening that way but I can poke at it more 'til I understand it.
by stout
Sun Jan 05, 2014 5:47 am
Forum: Support and Development
Topic: [SOLVED] Key rebinding issue
Replies: 4
Views: 4448

Re: Key rebinding issue

love.keypressed is called whenever a key is pressed. It's not something that loops or runs every frame unless you tell it to. You'd want to have a separate condition to check that the next keypress is going to be stored, so when you press 'b' set a flag so that the next keypress is the one that's s...
by stout
Sun Jan 05, 2014 12:55 am
Forum: Support and Development
Topic: [SOLVED] Key rebinding issue
Replies: 4
Views: 4448

[SOLVED] Key rebinding issue

function love.load() optbox = { x = 240, y = 70, xmin = 240, xmax = 490, ymin = 70, ymax = 270 } -- ending optbox whichkey = "up" -- move these later! don't need to be global whichkeyindex = 1 -- move these later! don't need to be global rebinding = "no" rebindingState = "k...
by stout
Fri Jan 03, 2014 11:05 pm
Forum: General
Topic: Get all keys currently pressed
Replies: 15
Views: 8975

Re: Get all keys currently pressed

Forget about love.keyboard. Use [wiki]love.keypressed[/wiki] and [wiki]love.keyreleased[/wiki] to update a table instead. Example (download and change extension to .zip to see the contents): keys_pressed.love Note that the amount of simultaneously pressed keys is limited to between 3 and 6 - that's...
by stout
Sat Feb 02, 2013 3:37 pm
Forum: General
Topic: Recommendations for a love2d development netbook?
Replies: 4
Views: 4068

Re: Recommendations for a love2d development netbook?

Thanks for the tips! I'd heard something about netbooks being on the way out, but didn't realize it was going to be so abrupt. I'll check the links out and see what'll work for me.
by stout
Sat Feb 02, 2013 1:34 am
Forum: General
Topic: Recommendations for a love2d development netbook?
Replies: 4
Views: 4068

Recommendations for a love2d development netbook?

I'd like a small, very portable, CHEAP netbook for doing love2d development and testing on. Anyone have recommendations? I have an iPad I use for most all of my mobile needs, but I have downtime between classes and it'd be nice to work on my code. I don't really need a full-sized laptop right now, j...
by stout
Thu Jan 03, 2013 2:58 pm
Forum: Support and Development
Topic: [resolved] Simple function error
Replies: 1
Views: 1676

Re: Simple function error

Still have no idea what's causing this.
by stout
Tue Jan 01, 2013 8:11 pm
Forum: Support and Development
Topic: [resolved] Simple function error
Replies: 1
Views: 1676

[resolved] Simple function error

RESOLVED: was calling propulationGeneration() wrong at one point, threw things off. Thanks Boolsheet! Issue is in popgen.lua. The trip is at line 27 (the line: populationMapData[y][x][#populationMapData[y][x] + 1] = popID ) but the culprit is down in populationGeneration() function. If you collapse ...