Work in Progress

Level Demo [NOT WORKING]

1

TooFly 2019-02-12 16:12

I have no idea how to use backgrounds... tried using BG 0 but that doesn’t work, so copied this from the ‘Maze’ program. What’s wrong?


Timo 2019-02-12 17:42

Just remove the line "BG 1" and it works.

BG is similar to LAYER in LowRes Coder, it sets the current target for the following background commands. BG COPY was called when BG 0 was active, so it copied the map to BG 0, but then you set BG 1 and all following checks looked at an empty background.


TooFly 2019-02-13 03:10

Oh well that fixes it... and I didn’t realize BG was like LAYER, thanks for explaining!


was8bit 2019-02-13 04:18

Some things to remember...

BG 1 in NX is like LAYER 0 in original
BG 0 in NX is like LAYER 1 in original

In NX:
CLS clears BOTH backgrounds
CLS 0 clears only BG 0
CLS 1 clears only BG 1

In original CLS depends on what LAYER # you last used..


was8bit 2019-02-13 04:24

... remember that when using sprites, their XY coordinates are at the top,left corner of the Sprite... so when using X\8,Y\8 to convert Sprite coordinates to cell coordinates, it can get tricky..

When determining if your Sprite has hit a cell, it works great going up or left... but when going down or right you must add the sprite's width/height to its coordinates to tell if the Sprite has it a cell below or to its right...

so sprites coordinates x\8,y\8 for contact with cells above and to the left works, but (x+w)\8,(y+h)\8 for contact with cells below and to the right :)


Timo 2019-02-13 07:06

The sprite/cell collision in this program already works :)


Log in to reply.