I am just new to programming and it was pretty much the first thing that I learned in class. Not to use global's, that is.Goober wrote:Is there a reason you can't use a global variable? It's good to avoid using them when a local will do just fine, but you don't always need to avoid them.
Search found 28 matches
- Fri Mar 27, 2015 1:12 am
- Forum: Support and Development
- Topic: Local Variable Availability - Multiple Callback Functions
- Replies: 8
- Views: 5281
Re: Local Variable Availability - Multiple Callback Function
- Fri Mar 27, 2015 12:44 am
- Forum: Support and Development
- Topic: Local Variable Availability - Multiple Callback Functions
- Replies: 8
- Views: 5281
Local Variable Availability - Multiple Callback Functions
I need to make a local variable from my "love.draw()" available in my "love.keypressed()". Is there a way to let it be accessed without making it a global / public class field?
- Tue Mar 24, 2015 7:41 pm
- Forum: Support and Development
- Topic: Do you have the Spy?
- Replies: 5
- Views: 3681
Do you have the Spy?
Does anyone have a link to a full body picture of the "Spy" guy in a suit located at the top left hand side of this page. I want to draw it in Inkscape and put it in my game..
Any help is greatly appreciated!!

Any help is greatly appreciated!!






- Thu Mar 12, 2015 5:20 am
- Forum: Support and Development
- Topic: Asset(s) Located In Subfolders
- Replies: 1
- Views: 2001
Asset(s) Located In Subfolders
I would like to organize my art assets for my game. But, I realized that they will not be found if I put them within a subfolder located in the folder containing my main.lua. For example, if I create a folder for my art assets, then put one of my sprites in there and run the following line: sprite= ...
- Tue Mar 03, 2015 10:48 pm
- Forum: Support and Development
- Topic: A Bunch Of Joystick Questions
- Replies: 14
- Views: 9815
Re: A Bunch Of Joystick Questions
Weird. What OS are you using and what does Joystick:getGUID return exactly? Is it an official xbox 360 controller or some aftermarket variant? If you use this with [wiki]love.joystick.loadGamepadMappings[/wiki], does it work? Windows 7. I got the controller new from Walmart. Its should be official....
- Tue Mar 03, 2015 4:27 am
- Forum: Support and Development
- Topic: A Bunch Of Joystick Questions
- Replies: 14
- Views: 9815
Re: A Bunch Of Joystick Questions
Since you're using an Xbox 360 controller, you shouldn't need to set any mappings yourself – SDL has a built-in collection of mappings that includes Xbox 360 controllers. Your code might be remapping things to the wrong values (different drivers and controllers use different joystick button values ...
- Tue Mar 03, 2015 12:48 am
- Forum: Support and Development
- Topic: A Bunch Of Joystick Questions
- Replies: 14
- Views: 9815
A Bunch Of Joystick Questions
I am using a corded black Xbox 360 controller: (1) Is there not a button(s) for the left/right triggers? https://love2d.org/wiki/GamepadButton (2) What is the 4th argument supposed to be? https://love2d.org/wiki/love.joystick.setGamepadMapping success = love.joystick.setGamepadMapping( guid, button...
- Mon Mar 02, 2015 9:23 pm
- Forum: Support and Development
- Topic: Joystick Help Please
- Replies: 3
- Views: 2495
Re: Joystick Help Please
It's possible that your joystick isn't actually registered as a gamepad. Try putting this in your code (with console enabled in conf.lua): function love.joystickpressed(joystick, button) print(joystick, button) end Press buttons on your joystick, and if you get output, then that means you'll have t...
- Mon Mar 02, 2015 9:05 pm
- Forum: Support and Development
- Topic: Joystick Help Please
- Replies: 3
- Views: 2495
Joystick Help Please
I do not know whether the 2nd code snippet on this page is outdated or not, but it isn't working for me:
https://love2d.org/wiki/Joystick
I am also trying to use the function:
But it isn't working either. Does anyone have suggestions of what I am missing?
https://love2d.org/wiki/Joystick
I am also trying to use the function:
Code: Select all
love.gamepadpressed( joystick, button )
- Mon Mar 02, 2015 8:13 pm
- Forum: Support and Development
- Topic: Joystick Button String Names?
- Replies: 1
- Views: 2005
Joystick Button String Names?
So, I am using the code:
for input(s) for my Xbox controller, but I need the names of the buttons.
Any help would be greatly appreciated!
Code: Select all
joystick:isGamepadDown("?")
Any help would be greatly appreciated!