How To

Hello!

1

WhyCanInotThinkOfAName? 2021-03-16 19:02 (Edited)

hey! I'm new. I just found this programming language and I really like it. Mainly, because you can post your own programs. i made an account and i just wanted to say hello. If you have any beginner advice on programming, i would aprecciate it :)


nathanielbabiak 2021-03-16 22:53 (Edited)

Hi!

If you're new to programming in general, try to focus on "sequential program flow" (one line, one instruction, and lines just execute one-at-a-time). You can write simple programs with PRINT, INPUT, and CLS, use these essential IO commands to test out the code itself.

After that, you can add program flow control with loops and IF THEN ELSE (I'd stay away from GOTO, GOSUB, and RETURN.) Many of the text adventure games available on this site don't need much else, actually.

Once you're comfortable there, the sky's the limit - enjoy!

All of these COMMANDS are available in the manual, here:


WhyCanInotThinkOfAName? 2021-03-16 23:50 (Edited)

i acctually know some basic. so i familiar with print, input, dim, while-wend, for-next, cls, if-then-else, etc... but not the graphics commands. Thank you anyway!



WhyCanInotThinkOfAName? 2021-03-16 23:53

i acctually like gosub just because of not having to right GLOBAL all the time lol


was8bit 2021-03-17 05:56

https://m.youtube.com/watch?v=zjX1LpSow_g&list=PLdvc760bZ8GBX-ijj_NpJdcIMPP5SNz9T&index=1

Howdee :D


was8bit 2021-03-17 05:59

Graphics on lowres NX are designed as a "Tile-based" format, with each tile being 8x8 pixels in size... lowres call these CHARACTERS... think of a font set containing the images of each letter.. unlike modern font which are sizeable, lowres graphic blocks are fixed to 8x8 in size..


was8bit 2021-03-17 06:03 (Edited)

When looking at your code, open up the editor menu at the top right... and then select GFX Designer... (try this with an existing game you have downloaded)

You are now looking at the heart of graphics in lowres... now notice the 3 tabs on the lower right, it is already selected on Graphics, then it has Palette colors, and then Background file editor... for now, lets look at the graphics...


was8bit 2021-03-17 06:09 (Edited)

You will notice at the bottom of the screen it shows "1/4" this is means you are viewing page 1 out of 4 pages of graphics... use the up/down arrow buttons to switch the pages...

Now goto page one, use your finger to touch a small graphic.... you will notice 2 things...

1) to the left of the "1/4" you will see a #001 or similar... this is the reference# of the small graphic you touched... officially this is called the Character#

2) in the upper left you will see a big version of the small graphic... this is the edit screen where you can edit by touch each pixel in the 8x8 sized character graphic...

The file buttons on the left save edits... exit w/o saving to keep the original


was8bit 2021-03-17 06:17 (Edited)

To use your graphics, you have two options....

1) place characters onto one of the two backgrounds... directly with code is..

CELL,X,Y,Char#... example... CELL 3,3,1 will place character#1 into a background cell coordinates 3,3... 0,0 coordinates are at the very top left of the screen... the screen is a grid of 20x16 cells in size, each size being exactly 8x8 pixels in size...

Or ..

2) create a sprite, and give it a character for its graphics.... sprites float above both backgrounds, and move at the pixel level.. with code....

SPRITE Spr#,X,Y,Char#... example, SPRITE 0,20,20,1 will assign character graphic #1 to Sprite#0, at pixel location 20,20, pixel coordinate 0,0 is at the top left of the screen, and there are 20x8 by 16x8 pixels on the screen


was8bit 2021-03-17 06:21 (Edited)

The two backgrounds are layered... with BG 1 being below BG 0 (kind of backwards for me, but BG 0 is on top of BG 1)

All sprites are above backgrounds, normally by default (Priority settings can change that, but are tricky) ... and Sprite#0 is always layered above Sprite#1, etc. with Sprite#63 layered below all other sprites


was8bit 2021-03-17 06:24

PRINT kinda automatically takes charge of the screen, and acts like the old typewriters, automatically printing stuff on the screen...

To take charge of HOW your info is placed on the screen, there are two main ways...

1) TEXT 3,3,"HELLO" places the "H" in cell 3,3, the "E" in cell 4,3, etc...

2) NUMBER 3,3,SCORE,4 will place the value of SCORE, lets say SCORE=24..
Starting at cell 3,3... you will see 0024 .....


was8bit 2021-03-17 06:28

Do not hesitate to ask any questions... or even attach your code for help... there are plenty of people here that are happy to help :)


was8bit 2021-03-17 06:35

One more thought.... the graphic images (characters) are designed with generic colors... color #0 (clear, blank, or see thru), and colors #1,2,3...

You ASSIGN, or PAINT by number, using PALETTES, paletes #0 to 7, allow you to create a 3 set of colors ... and at any time you may change the palette set... so all characters may be assigned any one palette set at any time...

So, while a graphic can only have 3 colors at a time, you may change which palette set to display it with...


was8bit 2021-03-17 06:37

For characters on the background...

PAL 1
CELL 3,3,12
... places char#12 at cell coordinates 3,3, and paints it with color set (pallette) #1

For sprites...

SPRITE 0,,,12
SPRITE 0 PAL 1

Assignes Char#12 to sprite#0
sprite#0 is painted with palette#1


was8bit 2021-03-17 06:40

You may reassign different characters to different (or same) places on the background cells, and reassign different characters to different (or same) sprites , and repaint any of these at anytime.... in real time during the game....


was8bit 2021-03-17 06:42 (Edited)

One recommendation for timing your games is this... use one main DO LOOP like this..

DO

... game code....

WAIT VBL
LOOP

This will set your game to lowres standard of 60 graphic frames per second...


was8bit 2021-03-17 06:53

A tip... to see a variable's value in real time w/o messing up your screen graphics, use TRACE variable_name, then when running your game, tap the upper right corner and select DEBUG mode on... now TRACE will let you see your variable value in real game time without messing up any graphics :)


WhyCanInotThinkOfAName? 2021-03-17 17:47 (Edited)

Wow! thank for all the info! i cant belive you took the time to write that all out! thank you so much! I'll check out everything you said. by the way? is there anyway to change the size of text in the output?


CubicleHead 2021-03-17 18:01

Hiiiiiiiiiiiiiiiiiiiiiii! (≧∇≦) I'm excited too see new people here :D
Idk much about programming in here, I'm used too old lowres, but I think you can do that somehow by changing the font in gfx designer? (・・?)


was8bit 2021-03-17 18:18

Glad to be helpfull... and as far as using commands like TEXT and PRINT, they are restricted to a fixed 8x8 size... you can draw your own larger text and use them manually...

Try this... goto page 4 of the characters... select FILE button, then FONT button, then select NORMAL... now to save, select FILE, SAVE

Now you can actually design your own font set :) ... just be sure to save it... your new font set will work with TEXT and PRINT :D


was8bit 2021-03-17 18:25

You can even change font sets, in mid game... here is my example...

https://lowresnx.inutilis.com/topic.php?id=428

It uses fonts by desbyc

https://lowresnx.inutilis.com/user.php?id=4


was8bit 2021-03-17 18:31

Page 4 is usually left blank, as is file#0... so that NX will automatically load up a default font set, secretly, so you can easily use PRINT TEXT right away... i say secretly because NX doesnt actually "show" you the default font, it just quietly uses it...

... but as soon as you draw on page 4, you will quickly learn that this affects your text....


was8bit 2021-03-17 18:33 (Edited)

I have a big text font game, but placing them is done manually, you cannot use PRINT or TEXT with double sized fonts...

https://lowresnx.inutilis.com/topic.php?id=881

BTW, I let people "remix" anything of mine, where you can edit or add stuff and then can post and share... just add "REMIX" to the title, so everyone knows you remixed one of my stuff, but also added or edited some of your stuff....

So, if you would like to try editing a new design on my big font set, just to experiment, go ahead and create a new font for it, and post it... as the game might be mine but the font would be yours, so just add "remixed" to the title and let others know that the font is yours :)

... remixing can be a fun way to learn the language :)


Log in to reply.