LameControl
Use the LameStation's joystick and buttons.
ctrl : "LameControl"
Functions
-
ctrl.A
- Gets 'A' button press.
-
ctrl.B
- Gets 'B' button press.
-
ctrl.Down
- Gets 'Down' direction.
-
ctrl.Left
- Gets 'Left' direction.
-
ctrl.Right
- Gets 'Right' direction.
-
ctrl.Start
- Start the LameControl library.
-
ctrl.Up
- Gets 'Up' direction.
-
ctrl.Update
- Update the state of all controls.
-
ctrl.WaitKey
- Wait until 'A' or 'B' button is pressed.
Constants
About
ctrl.Start
- Start the LameControl library.
ctrl.Update
- Update the state of all controls.
ctrl.WaitKey
- Wait until A
or B
button is pressed.
ctrl.A
- Gets 'A' button press.
ctrl.B
- Gets 'B' button press.
ctrl.Down
- Gets 'Down' direction.
ctrl.Left
- Gets 'Left' direction.
ctrl.Right
- Gets 'Right' direction.
ctrl.Start
- Start the LameControl library.
ctrl.Up
- Gets 'Up' direction.
ctrl.Update
- Update the state of all controls.
ctrl.WaitKey
- Wait until 'A' or 'B' button is pressed.
About
ctrl.Start
- Start the LameControl library.
ctrl.Update
- Update the state of all controls.
ctrl.WaitKey
- Wait until A
or B
button is pressed.
ctrl.Start
- Start the LameControl library.ctrl.Update
- Update the state of all controls.ctrl.WaitKey
- Wait until A
or B
button is pressed.Button Commands
ctrl.A
- Returns true if the ‘A’ button is pressed.ctrl.B
- Returns true if the ‘B’ button is pressed.
Joystick Commands
ctrl.Up
- Returns true if the joystick is tilted up.ctrl.Right
- Return whether the joystick is tilted right.ctrl.Down
- Return whether the joystick is tilted down.ctrl.Left
- Return whether the joystick is tilted left.
== About
The LameStation has six hardware controls for user input.
Before you can use them, you must call ctrl.Start
once at the beginning of your program. This tells the Propeller to listen to the controls.
To read the current state of the controls, call ctrl.Update
. A good place to do this is at the beginning of your main game loop, but it can be called at any time. If this is never called, all other commands will always return false.
PUB Main
repeat
ctrl.Update
After calling ctrl.Update
, you can call any of the button or joystick commands to get their state. The values returned will not update until ctrl.Update
is called again.
if ctrl.Up
' jump really high
if ctrl.A or ctrl.B
' do something