BG pixel detection system 2


was8bit 2021-07-21 02:59 (Edited)

The 4 corners are constantly checked, these cells are converted to sprites, which are check to see if player sprite makes pixel contact with SPRITE HIT

The cells being checked are highlighted, and if a pixel is being touched it is shown in upper left corner...

Update 2 prevents movement onto any background pixel... as all cells have a character, standard cell detection would prevent all movement...

V2.1 changes graphics... now you are a pixel navigating a screen full of text...

V2.2 centers pixel, and holding (A) button lets you walk thru pixels (letters)

Here is my test of this system on a platform ...

CubicleHead 2021-07-24 15:27

This will be very useful :D

was8bit 2021-07-25 05:24

Thanky :)

There IS a repeatable bug.... when 2 zones are actually the same cell, it can cause issues... I discovered this as I was implementing this system into a rather advanced test... so if I find a fix for this bug I will post here to let you know, as I don't want to post my test until this is fixed...

was8bit 2021-07-25 06:17

Ah... update... i got around the problem by processing the vertical movement first (jumping and gravity) seperately, first.... then process the horizontal seperately, last... problem is solved :)

was8bit 2021-07-25 10:21

Test program posted :)

CubicleHead 2021-07-26 12:17

Super awesome 👍

was8bit 2021-07-26 14:58 (Edited)

Thanky :)

... my get around approach in the test (processing vertical then horizontal) does have an occasional issue (when jumping and moving r/l) of player getting a pixel stuck inside a cell, but as player can be easily freed again i am not worried about it as far as my test program is concerned.... and actually i have occaisonally used this stickiness to climb up a wall ;)

was8bit 2021-07-26 16:46

Ok, test works perfectly how.. the bug was in my test code, and NOT in the Pixel Detection System .. :D

BGelais 2021-07-29 04:22

"Spriting" the surouded 4 cells for good pixel sprite hit. Brilliant! :)

was8bit 2021-07-29 06:16

Thanky :)

Its a simple version of what i did with my pitfall game (er, my lafftip game) ;) there i converted everything i needed off the background into sprites.... this also had the advantage of the background cells spawning things and enemies that player will interact with...

I started the 4 cell idea with my worms game, but got stuck on how to get the worms to go up a hill.. i may revisit that game someday...

SP4CEBAR 2021-10-11 06:19

That's a neat solution!
I recently made something that does a similar thing but in a less efficient way: it reads character data to generate a height map for vertical collision

was8bit 2021-10-11 06:32

Thanks... :)

... generally i like experimenting with different ways to do things :)

Log in to reply.