Also, make sure to understand what you are writing. Just blindly copy-pasting code is a very bad programming practice. In case you don't understand something, don't hesitate to ask.
Are you using OPTION STRICT? If so, you will have to declare your variables first. Do that with the VAR command. You should initialize the variables before your game's main loop. Like this...
VAR CEXIT
VAR C$
VAR HP 'YOU COULD ALSO JUST REMOVE THE GODMODE COMMAND
WHILE 1 'MAIN GAME LOOP
'CONSOLE CODE GOES HERE
WEND
Esta fantastico el juego! Es como tener un 'Snake' super avanzado. El gameplay estuvo muy bien pensado y es bastante entretenido. Sigue con el buen trabajo!
It's the button to the left of A. It looks like a weird vertical line split in half. Putting two of those together makes the logic OR operator, which evaluates as true if any of its operands evaluates as true.
I'll write code snippets between <>.
You forgot the <THEN> after <IF BUTTON(2) AND #Y>.
Also, You forgot <" ||> after <IF C$=="EXIT>.
Also, remember all that code must go within your game's main loop.
Please be aware that the MOD operator only works with whole numbers (integers) and possibly only positive numbers. If you try using decimal values, they will be rounded off first. If you really need it to work with decimals, you can probably develop a custom algorithm pretty easily.
It's very simple! You probably already know that a number is divisible by another if the remainder of their division is 0. The MOD operator returns this remainder, so you can do something as simple as...
NUM1 MOD NUM2 == 0
...to check if NUM1 is divisible by NUM2.
You would write this inside your main game loop. You can add as many commands as you want. Just use more ELSEIFs.
IF BUTTON(2) AND #Y THEN
CEXIT=FALSE
WHILE !CEXIT
LINPUT "COMMAND: "; C$
IF C$=="EXIT" || C$=="CLOSE" THEN
CEXIT=TRUE
ELSEIF C$=="GODMODE" THEN
HP=10000
PRINT "HEALTH SET TO 10K"
ELSE
PRINT "UNKNOWN COMMAND"
ENDIF
WEND
ENDIF
Since you will be using LINPUT, a button to send the command is already established. You will have to use the A button or the ENTER key. There is no button to close the console, though. This means you will have to write a command to explicitly close the console. This is simple enough to code, though. I will write you a simple code in the next comment.
After getting the string input with LINPUT, you will need to parse the string to turn it into a command. We will stick to simple logic for this example. The simplest way to interpret the string as a command is to compare it to existing command strings in a really big IF statement. If the string matches a command string, then you would execute certain code.
Next, you will need a way to get keyboard input from the user. You have a couple of ways to do this. You can use LINPUT, which is the easiest way to get string input from the user. You can also use INKEY$, which allows more freedom to do stuff with the keyboard, but it's a bit more difficult to use. For this example, we will stick to LINPUT.
I can guide you a bit!
First, you'll need a way to bring up the console. For this example, we'll assign it to a button. When the console's open, you'll also need a way to send commands and close the console. We can assign these actions to a button, too.
Esta muy bueno el programa. Muy bien animado y con controles simples. Un tip, si presionas el boton L, el programa tira un error. Para solucionar esto escribe un END en la linea 124.
Tambien, si puedes, seria genial si logras que el gusano se mueva un poco de lado a lado por si solo. Verlo caminar en linea reta se vuelve un poco repetitivo.