Iv'e only really know c# but I'm trying to learn but I wish there could be some more in the manual about how to use btn input in the code.
I do:
if btn 's'
x +=5
but it doesn't do anything
i use the x in the txt so im trying to make a letter move
a fantasy console for making small games · By
Hi! The input buttons don't correspond directly to the keyboard, sorry for the confusion.
I should support this with a function called "key" or something, probably.
"btn" provides a, b, x, y, select, start, and directional buttons.
to check the arrow keys, you can do something like this:
if btn 'u' -- up y -= 1 elseif btn 'd' -- down y += 1 elseif btn 'l' -- left x -= 1 elseif btn'r' -- right x += 1 end
Edit: Also! You can find the full input mapping for keyboard + controllers in the manual :)
iv'e done that but it doesn't seen to work. I have written the if's in the update method and im trying to draw an 'A' on the screen but it won't change place.
And I'm guessing I shouldn't have to use a loop because the engine loops the code. So how do I make the 'A' change place?
Edit: I solved it. Didn't relize that I had put my variables in the _init instead of class variables