Asset

KEYBOARD TESTER

2

was8bit 2021-02-27 19:39 (Edited)

To test keyboard inputting... PAUSE toggles between single and two player mode...


G-9 2021-02-28 06:58

Nice !! Exactly what i was doing lol


was8bit 2021-02-28 08:02 (Edited)

Cool :)

Didja notice that many things in NX results in 0 or -1

Try
PRINT 1=1
PRINT 1=2

You can use

IF 1=1 THEN
or
IF 1=2 THEN

to test your code with this always executing or never executing...



qwaffe 2021-02-28 08:29

@was8bit you can also just use ' (comment markings)


was8bit 2021-02-28 13:13

That is true, but more difficult... say you have

IF variable>=value THEN
... do stuff
... do stuff
..
..
.. do stuff
END IF

then you have to add an ' in front of EACH LINE to take it out ..

Changing the top line to IF 1=2 THEN takes it out much easier

AND To make the code always execute, you have add 2 '

'IF ... THEN
..
'END IF

But this is one edit

IF 1=1 THEN


was8bit 2021-02-28 13:15 (Edited)

Also, on my big ipad, it takes 3 keypresses to add each ' symbol... each time I want a '... it's actually easier for me to add REM than '... which is unfortunate as I like ' better...


qwaffe 2021-02-28 13:44

oh... that actually makes a lot of sense for multiple lines. im guessing the next step is to use a GOSUB just so you would only need to use one REM or '


was8bit 2021-02-28 18:26 (Edited)

Well, my trick was just so you could test difference between the IF block executing always vs never..

Another trick to skip over whole blocks of code temporarily is

GOTO SKIP1

SKIP1:

You dont need the 1 if you only skipping one block of code, but if you want to skip 2 or more blocks of code, you will need the skip labels numbered.. these are easy to remove ...

These are just a few tricks that you can use if your code is acting oddly

For small problems, you can use TRACE Variable and run the game in DEBUG mode... Timo added that feature, and it lets you see how a variable chances in real time..


.... another trick i use is PLAY 0,90,1 or PLAY 0,90,90 and if i use more than one i use a different note for each one... this helps me test if a specific spot of code is being executing.... if your logic is incorrect the code may be being executed, but it isnt yielding the result you wanted... and these are easy to remove...


Log in to reply.