How To

Good habits and software to program LowRes NX programs with PC

0

G-9 2021-06-18 19:33

I’m not familiar with PC, I always coded with my iPhone. I have some issues with my iPhone rn, that’s why I ask you, the best LowRes coders that works on PC, to tell me what program are that using and some good habits.

Thanks, and have a nice holiday :3
P.S. : And nice weekend also 😂


CubicleHead 2021-06-19 02:49

Do you mean as in a text editor?
i use notepad but you can use any text editor
you just save the .nx file then drag it into the lowres nx window


was8bit 2021-06-19 05:25 (Edited)

There is post somewhere on a good PC editor, and someone made a file for it with LOWRES syntax... i cannot remember where that post is....


CubicleHead 2021-06-19 13:25

this?:
https://lowresnx.inutilis.com/topic.php?id=1808
and this is also helpful:
https://lowresnx.inutilis.com/topic.php?id=1923


nathanielbabiak 2021-06-22 00:24 (Edited)

I use Notepad++, it's free! It allows use of a user defined language (UDL), which I've created for LowRes NX's keywords and syntax, and uploaded to my dropbox.

Edit: UDL Version update

Here's the UDL: link


nathanielbabiak 2021-06-22 00:41 (Edited)

As far as good coding habits go, that might be a new subject for the forum! I'm hesitant to offer mine, as (and I'm sure most would agree) LowRes NX is supposed to be fun, so just do whatever works for you. :-)

If you're extremely organized, you can make some monstrous cartridges that do many complicated things. But, there's also plenty of uploads on the site that do one thing really well, like a pretty graphic, a good audio demo, or an interesting algorithm.

"Good coding" can also mean readable code, or something that executes super fast. Unfortunately these objectives are usually mutually exclusive (since we don't have the luxury of optimization-at-compile-time).

Heck, even the manual recommends using SUB and CALL (and avoid using labels, GOTO, and GOSUB), but it's used by Timo, was8bit, and even me. It's just not a big deal!

Just have fun with it.


was8bit 2021-06-22 02:27 (Edited)

Having fun, i believe, is the unwritten #1 rule ;

Some "tips" are..

TIP 1...

use one main DO LOOP with one WAIT VBL like this
DO

- code -

WAIT VBL
LOOP

This provides a times loop of exactly 60 frames per second... use code to slow animations or actions if needed, like
W1=(W1+1) MOD 3
IF W1=0 THEN
-code-
END IF
the code inside this IF THEN has been slowed down to 20 executions/second (60/3)


If you have multiple levels, or other need for it (like a special menu page, etc), it is OK to use more than one DO LOOP ... but for smaller games one DO LOOP will be fine


was8bit 2021-06-22 02:40

TIP 2...

Put all of your DIM GLOBAL and other things needed at the top

Put all of your SUBs below your code (and above rom files)

Try to name things to help you remember what you doing in the event you put your code down for awhile, then come back later to it... try to lay out your code so you can read thru it as easily as you read thru a book...


was8bit 2021-06-22 02:53

TIP 3... plan out your graphics to make programming easier... if you want to animate your player running, and you need say 5 images, dont spread the images randomly around... maybe line them up in a row so the code is simpler... i will give you an example with random images, and an example with images in a row....

EXAMPLE:RANDOM

DIM PCELL(5)
FOR I=1 TO 5
READ PCELL(I)
NEXT I
DATA 3,8,15,24,43
PANI=0
SPRITE 0,PX,PY,PCELL(1)

IF W1=0 THEN
ADD PANI,1,1 TO 5
SPRITE 0,,,PCELL(PANI)
END IF


EXAMPLE:GRAPHICS IN LINE

PANI=5
SPRITE 0,PX,PY,PANI

IF W1=0 THEN
ADD PANI,1,5 TO 10
SPRITE 0,,,PANI
END IF


nwallen 2021-06-25 17:28

For me I used VSCode and setup a script where when F5 is pressed ,in a .nx file, lowres starts with the game loaded. Saves me time when testing.


G-9 2021-11-10 19:20 (Edited)

hi @was8bit !! so know that im a normal developer and no more a dumb one, i did read some of your "code tips". most of them are kinda useful, but there is one which was special : the code to slow down animations.
So here is your code so far :
W1=(W1+1) MOD 3
IF W1=0 THEN
-code-
END IF

now, lemme show you mine, which is shorter (and should use less tokens) (i didn't tested it when i wrote this : please forgive errors ;))
IF TIMER MOD 3=1 THEN
-code-
END IF

i know, this is not the biggest change of the world. but imagine your code takes like 10 tokens and mine 7, then if you used this 10 times in different places with different values, then your code snippets would cost 100 tokens and mine 70, which (i know you know it :D) economizes 30 tokens ! this is important for very big games...

now @here, thanks a lot for your tips too, especially syntax hilighting :)


was8bit 2021-11-11 03:24

Timo also uses TIMER mod ... I choose not to for a couple of reasons...

1) feels cofnfusing for me... mine I can see exactly what I wan

2) mine is not an ablsolute, but a relative control... so for example f I or a user adjusts the WAIT VBL to something else, say WAIT 3 then whatever you are timing will not sync logically with everything else...

I am rather particular how my games FEEL when I play them and I carefully adjust everything to what I like ... ;)

But u r right, TIMER MOD is better, is an just the odd one ;)


Log in to reply.