a fantasy console for making small games · By int16_t
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.
if btn 's'
but it doesn't do anything
i use the x in the txt so im trying to make a letter move
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
Edit: Also! You can find the full input mapping for keyboard + controllers in the manual :)
New question, Does math.random work?
and is there in anyway I can bugtest my code because when i write run it just freezes until i press ESC, no error message or nothing
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