Example

Random Map Generator

4

was8bit 2020-01-01 22:21

TAP for a new map :)


Roger Davis 2020-01-01 23:58 (Edited)

Very nicely done was8bit! It works well! Can I just ask? 🤔 Would these maps just be used as backgrounds? Or can you program collision detection into them? For example, if I had a Sprite on screen that was moveable with the directional pad (Arrows), is it possible to make - say . . all of the trees an 'obstacle' by putting in a collision detection routine, or would that sort of thing only be possible with Sprite-to-Sprite? In other words, . . . Can collision detection be programmed between Sprites, and Character graphics. . . (OR, . . As in your example here, graphics that are 'drawn' and placed onto the playing area. . . .Or not? 🤔 Apologies for the convoluted question! : )


was8bit 2020-01-02 00:55

Sprite X,Y coordinated are at its top left corner... and is in PIXELS

CELLS are 8x8 pixels i.pn size, but CELL X,Y coordinates are in tile map positions, so tile 1,1 is one over from the left and one down from the top

It is neccessary convert SPRITE coordinated into CELL coordinates ... and cells can be read with CELL.C(X,Y) using tile coordinates and yields the graphic character# that is being used at that tile location..

Remembering that SPRITE X,Y is at its top left, detecting contact at its lower right corner must account for sprites pixel size...

Sprite.x\8 will convert it to tile X
Cell x*8 converts to sprite size...

To make it easier to see it in real code i have example code you can look at :)

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

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


Roger Davis 2020-01-02 00:58

Many thanks once again was8bit! You're a lifesaver! Thank you for replying! : )


was8bit 2020-01-02 00:58

:)


Tinycloud778 2020-01-04 19:50

Nice


was8bit 2020-01-05 05:57

:)


Log in to reply.